How to use dialog in resources and bitmaps in dll?

Post Reply
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

How to use dialog in resources and bitmaps in dll?

Post 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!
FiveWin 9.03 + xHarbour !!
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post 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
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

Post 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?
FiveWin 9.03 + xHarbour !!
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post 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
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

Post 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.
FiveWin 9.03 + xHarbour !!
Post Reply