Icons from resource DLL (solved)

This forum is for eXpress++ general support.
Message
Author
Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Icons from resource DLL (solved)

#1 Post by Wolfgang Ciriack »

Hello Roger,
is there a possibility, that eXPress uses Icons from a Ressource DLL ?
I don't succeed with that. That is what I tried:

Code: Select all

nResDll := DllLoad( "Resource.dll")
DC_BitmapResourceFile({nResDll})
DC_SetIconResource(11001, 11300)

* ICJ_LKW  = Icon with Nr. 11120
* BMP_BILD  = Bitmap

oIcon := XbpIcon():New():Create()
oIcon:Load(FVWFILE_RESFILE, ICJ_LKW, 32, 32)
@200, 100 DCPUSHBUTTONXP SIZE 80, 80 CAPTION "TEST" BITMAP oIcon ALIGN XBPALIGN_BOTTOM + XBPALIGN_HCENTER CONFIG M->oGDL:oBtnConf1
@200, 200 DCPUSHBUTTONXP SIZE 80, 80 CAPTION "TEST" BITMAP ICJ_LKW  ALIGN XBPALIGN_BOTTOM + XBPALIGN_HCENTER CONFIG M->oGDL:oBtnConf1
@200, 300 DCPUSHBUTTONXP SIZE 80, 80 CAPTION "TEST" BITMAP BMP_BILD ALIGN XBPALIGN_BOTTOM + XBPALIGN_HCENTER CONFIG M->oGDL:oBtnConf1
Button 1 and 3 are shown correct, but button 2 do not show the Icon.
Is it possibible, to force eXPress to use the icons from a resource dll, so that i do not have to recode my hole app ?
Last edited by Wolfgang Ciriack on Mon May 10, 2021 10:26 pm, edited 1 time in total.
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Icons from resource DLL

#2 Post by rdonnay »

Send me your DLL so I can try it.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Icons from resource DLL

#3 Post by Wolfgang Ciriack »

Have send it by mail.
_______________________
Best Regards
Wolfgang

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Icons from resource DLL

#4 Post by Wolfgang Ciriack »

Can not send you the DLL file by mail, although it is in a zip file and has another extention the mail is blocked because of an potential security risk.
I will send you a link, where you can download the file later today.
_______________________
Best Regards
Wolfgang

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Icons from resource DLL

#5 Post by Wolfgang Ciriack »

Hello Roger,
were you be able to download my Resource.dll from the link i send you ?
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Icons from resource DLL

#6 Post by rdonnay »

Yes, I have your files.
Working on it now.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Icons from resource DLL

#7 Post by rdonnay »

I looked a lot at the code to see if there was a way that I could modify DC_GetBitmap() and DC_BitmapResourceFile() so they would allow icons from a DLL. It looks like this is not possible from a DLL handle, but instead must use the DLL name.

It will take a lot of code changes to try to mix bitmaps and icons in a DLL.
I would prefer not to do this because I run the risk of breaking some already complicated code.
Also, nobody has ever asked for this until now.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Icons from resource DLL

#8 Post by Wolfgang Ciriack »

Hello Roger,
Thanks for looking at it.
So one way would be to change Icons to Bitmaps ?
Or what can you recommend ?

Edit: I will change my code to all commands which uses an icon to GetIc(nr) with

Code: Select all

function GetIc(nr)
LOCAL oIcon := XbpIcon():New():Create()
   oIcon:Load(FVWFILE_RESFILE, nr)
return oIcon
That works for me.
Or is there a better solution ?
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Icons from resource DLL

#9 Post by rdonnay »

I suggest the following:

Code: Select all

@200, 100 DCPUSHBUTTONXP SIZE 80, 80 CAPTION "TEST" BITMAP GetIcon(ICJ_LKW) ALIGN XBPALIGN_BOTTOM + XBPALIGN_HCENTER

FUNCTION GetIcon( nResource )

LOCAL oIcon := XbpIcon():new():create()
oIcon:Load(FVWFILE_RESFILE,nResource)
RETURN oIcon
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Icons from resource DLL

#10 Post by Wolfgang Ciriack »

Thanks Roger, this is exact my solution.
Now i have to do a lot of edit work.
_______________________
Best Regards
Wolfgang

Post Reply