Page 1 of 1
How to use dialog in resources and bitmaps in dll?
Posted: Tue Feb 26, 2008 6:35 pm
by Anderson.OL
The distribution of the system is easier, because the dll will only be a send an only time.
I need to know how to load the dll without losing the included resource in the program!
Posted: Wed Feb 27, 2008 2:51 am
by dutch
Dear Anderson,
Try this, it works for me.
Code: Select all
Function main()
Public hResc
.....
hResc := GetResources() // Main .RC file
SET RESOURCES TO ("EZ4SCR.DLL")
SET RESOURCES TO ("BWCC.DLL")
SetResource( hResc )
.....
return
Function Sub
SET RESOURCES TO "EZ4SCR.DLL"
DEFINE DIALOG oDlg
.....
oDlg:bStart := {|| SetResources( MEMVAR->hResc ) }
ACTIVATE DIALOG oDlg
return
Posted: Wed Feb 27, 2008 12:34 pm
by Anderson.OL
Hello, thank you for helping, but it was not 100%!
My code is this:
Code: Select all
hRes := GetResources()
SetResources( hRes )
...
SetResources('Bitmaps.dll')
@ 10,10 Image oImage resource cWallPaper Of oWnd Pixel //-- In bitmaps.dll
...
SetResources( hRes )
DEFINE DIALOG oDlg Resource "DLGSELEMPRESA" of ownd //-- In Main.rc
SetResources('Bitmaps.dll')
REDEFINE ButtonBmp oBtnExit ID 203 of oDlg Bitmap "Exit24" //-- In bitmaps.dll
oDlg:bStart := {|| SetResources('Bitmaps.dll') }
ACTIVATE DIALOG oDlg CENTERED
The object oImage show the resource, but the object ButtonBmp not!
What is wrong?
Posted: Wed Feb 27, 2008 1:09 pm
by Richard Chidiak
Anderson,
There is no "automatic RESIZE" on buttonbmp, if the area reserved for displaying the button in your resource is not big enough, the buttonbmp will not show. Try to increase it.
HTH
Richard
Posted: Wed Feb 27, 2008 4:46 pm
by Anderson.OL
Richard Chidiak wrote:Anderson,
There is no "automatic RESIZE" on buttonbmp, if the area reserved for displaying the button in your resource is not big enough, the buttonbmp will not show. Try to increase it.
HTH
Richard
This is not the problem.
The problem is that I am moving the bitmaps from resource to dll.