FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to load resources from a RC AND DLL the same time ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Possible to load resources from a RC AND DLL the same time ?
Posted: Tue Jul 12, 2016 06:15 PM
Hello

Is it possible to use / link resources from a RC-file
and load resources from a DLL the same time ?
I want to save hight resolution images to a extra DLL
and normal resources like dialogs and other controls to a normal RC-file
because I want to keep the EXE small in size

As long I load the IMAGES from a DLL and all other controls
are defined from code, it works perfect.
The logic is used in my sample to show animated images.
It would be perfect to load dialogs and other controls from resource as well.

with using :

hResources := GetResources()
SET RESOURCES TO "IMAGES.dll"


I can call images from the DLL
but how I can call the needed resources from the RC-file ?

sample :

DEFINE DIALOG oDlg RESOURCE "TEST" ; // from RC
FONT oFont1 TITLE "Image-test" TRANSPARENT

REDEFINE BITMAP oImage ID 110 OF oDlg RESOURCE "Internet.bmp" ADJUST // from DLL

because of < SET RESOURCES TO "IMAGES.dll >
the resources defined in the RC-files are ignored.

any idea ?

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to load resources from a RC AND DLL the same time ?
Posted: Wed Jul 13, 2016 02:53 PM

hSave := GetResources()
SetResources( 0 )
// access from rc
SetResources( hSave )
// again back to DLL

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to load resources from a RC AND DLL the same time ?
Posted: Thu Jul 14, 2016 08:42 AM
Mr. Rao
thank You very much

the problem

REDEFINE BTNBMP oABtn[1] ID 120 RESOURCE "Save" OF oDlg 2007 ;
( how doe's the button know that I want to use the image from the DLL ? )

I'm using Res.-workshop from Borland creating the normal resources and
Resedit to save alphablended BMP's to a DLL

the same problem maybe will be xBrowse with the resource defined with Res.workshop
and showing images from the DLL

RESEDIT creating a DLL with alphablended BMP's
( NOT possible using BORLAND Resource-Workshop )



maybe I must include the images using a RES -file but that will create a very big EXE-file.
I would prefer using a external solution ( DLL )

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to load resources from a RC AND DLL the same time ?
Posted: Thu Jul 14, 2016 09:01 AM

There should not be any problem.
It is possible to keep switching between different DLLs and also linked RC/RES

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Possible to load resources from a RC AND DLL the same time ?
Posted: Thu Jul 14, 2016 12:26 PM

Uwe

I can not use 32 bit bitmaps .. I have to save them down to 24 in order for them to be compiled into my executable ? YES, I can save 32 bit bitmaps using Resedit, but when I compile to .res and burn into the .exe .. the .exe ( with borland 7 ) fails to create the .exe

Rick Lipkin

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to load resources from a RC AND DLL the same time ?
Posted: Thu Jul 14, 2016 01:00 PM
Rick,

thank You sharing Your experience working with resources

I think the DLL-solution is a option

here are my first tests using a selected image from the DLL testing on different controls
the image : 32 bit alphablended

started from CODE ( tests resource + DLL will follow )

1. window-test -> Image and button



2. Folderpage -> button and tabs



3. Dialog and Folder -> image



4. Folderpage -> xbrowse



4. Folderpage -> transparent button



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion