Page 1 of 1

POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 6:41 am
by skiman
Hi Roger,

I was changing my application to use an external DLL for my buttons. It seems as the POPCAPTION doesn't work with this. I did the following:

- I created the external DLL, named ABO_RES.DLL
- At the start of my application, I have:
nResDll := dllLoad("ABORES.DLL')
DC_BitmapResourceFile( nResDll)
- The captions of the pushbuttons are OK.
- Where I used a POPCAPTION, there is nothing shown.
- As POPCAPTION i have ABO_SEARCH_MINI. I tested this on a button, and it is working correctly, so it must be in my DLL.
- I tested the wonderfull BITMAP_BUG_M as POPCAPTION, and this is also working.

Is it possible that POPCAPTION doesn't use the 'nResDll' which is specified with dc_BitmapResourceFile?

Re: POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 7:53 am
by rdonnay
Chris -

You are right about this.
I never noticed this before.

Made the following change to _DCXBPGT.PRG at line 592 then rebuild DCLIPX.DLL by running BUILD19_SL1.BAT.
DC_GetBitmap() always returns an XbpBitmap object from a resource or file name.

WAS:

Code: Select all

  IF Valtype(cCaption[2])='A'
    ::popupButton:caption := cCaption[2,1]
  ELSE
    ::popupButton:caption := cCaption[2]
  ENDIF
IS:

Code: Select all

  IF Valtype(cCaption[2])='A'
    ::popupButton:caption := DC_GetBitmap(cCaption[2,1])
  ELSE
    ::popupButton:caption := DC_GetBitmap(cCaption[2])
  ENDIF

Re: POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 8:28 am
by skiman
Roger,

Yes, this fixes it. :dance:

Another question, as Icon for my application I now have the eXpress++ icon. Is it possible to change this without changing something in express.arc?

In express.arc there is a define of ICON_APP 2.

Do I have to change that to a number of my resources?

Regards,

Re: POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 8:52 am
by rdonnay
Try this:

Code: Select all

DC_IconExpress( DC_GetBitmap( MYICON ))

Re: POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 9:11 am
by skiman
Roger,

Seems as dc_iconExpress() is a function for the future? :D There is dc_iconDefault() but this is not the problem.

I want to have my icon when my application is in a listing with Explorer. It is not the icon after startup. This can be changed.

Also when a user creates a shortcut to my application on his desktop, I want my icon as standard. Now they will get the eXpress rocket.

Regards

Re: POPCAPTION with resources in external DLL

Posted: Thu Feb 18, 2010 9:38 am
by rdonnay
I meant DC_IconDefault(). Sorry.

I think you need to assign your icon to resource #1 to make it show up in Explorer.
I also think it needs to be in the EXE.