How can I call external 2 DLL files in my prog?*Successful*
How can I call external 2 DLL files in my prog?*Successful*
Dear All,
I've used our 2 DLL files. How can I register or load in program and switch to use Dialog in 2nd Resource file (DLL)? I've used in FW16bits but I don't know how to use with xHB/FWH 2.5.
Thanks in advance,
Dutch
I've used our 2 DLL files. How can I register or load in program and switch to use Dialog in 2nd Resource file (DLL)? I've used in FW16bits but I don't know how to use with xHB/FWH 2.5.
Thanks in advance,
Dutch
Last edited by dutch on Thu Dec 01, 2005 9:53 am, edited 2 times in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
It doesn't work with the same code FW and FWH
Dear Antonio,
This is my code is following and it've shown below message on EntryScr procedure.
** Fivewin Error/3 Cannot Create Dialog **
//---------------//
Function Main
Public hResc
hResc := LoadLibrary( "BWCC32.dll" ) // new fwh
SET RESOURCES TO "EZ4SCR.DLL" // new fwh
SET RESOURCES TO "EZ4.DLL" // new fwh
BWCCRegister( GetResources() ) // new fwh
...
...
return
//----------------//
Function EntryScr
SET RESOURCES TO "EZ4SCR.DLL"
DEFINE DIALOG oDlg RESOURCE 'RSFIELDS' TITLE 'In House List'
..
..
ACTIVATE DIALOG oDlg ON PAINT (SetResources( MEMVAR->hResc ))
return
Regards,
Dutch
This is my code is following and it've shown below message on EntryScr procedure.
** Fivewin Error/3 Cannot Create Dialog **
//---------------//
Function Main
Public hResc
hResc := LoadLibrary( "BWCC32.dll" ) // new fwh
SET RESOURCES TO "EZ4SCR.DLL" // new fwh
SET RESOURCES TO "EZ4.DLL" // new fwh
BWCCRegister( GetResources() ) // new fwh
...
...
return
//----------------//
Function EntryScr
SET RESOURCES TO "EZ4SCR.DLL"
DEFINE DIALOG oDlg RESOURCE 'RSFIELDS' TITLE 'In House List'
..
..
ACTIVATE DIALOG oDlg ON PAINT (SetResources( MEMVAR->hResc ))
return
Regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Dutch
Just curious why you have two .dll's ... If you are creating your .dll's from .rc you can combine all your .rc's into one single .rc and then import them into a single .dll
I have modified rc2dll32.bat file as follows:
rem RC file to 32 bits resources DLL
rem syntax: rc2dll32.bat Your_rc_file !!! without the .RC extension
DEL VEH32.DLL
DEL VEH32.RC
: combine all .rc into a single .rc
COPY *.RC VEH32.RC
bcc32 -c c:\fwh26\dll\screen32.c
brc32 -r %1.rc
ilink32 /Tpd c:\borland\lib\c0d32.obj screen32.obj, %1.dll,,c:\borland\lib\cw32.lib c:\borland\lib\import32.lib,, %1.res
echo done!
Rick Lipkin
SC Dept of Health, USA
Just curious why you have two .dll's ... If you are creating your .dll's from .rc you can combine all your .rc's into one single .rc and then import them into a single .dll
I have modified rc2dll32.bat file as follows:
rem RC file to 32 bits resources DLL
rem syntax: rc2dll32.bat Your_rc_file !!! without the .RC extension
DEL VEH32.DLL
DEL VEH32.RC
: combine all .rc into a single .rc
COPY *.RC VEH32.RC
bcc32 -c c:\fwh26\dll\screen32.c
brc32 -r %1.rc
ilink32 /Tpd c:\borland\lib\c0d32.obj screen32.obj, %1.dll,,c:\borland\lib\cw32.lib c:\borland\lib\import32.lib,, %1.res
echo done!
Rick Lipkin
SC Dept of Health, USA
Thanks
Dear Rick,
The 1st DLL (Convert to RC) file is our fixed entry screen (unmodification for user) and 2nd DLL is user modification entry screen (Booking screen) for each customer site. I compile my first DLL (RC) file to EXE file and 2nd will be able to modify (custom screen without changing source code) for customer need. Why has it 2 DLL files.
****************
Dear Antonio,
It has another problem is the program does not focus to the main resource (1st RC file) when exit from 2nd DLL. I try to do exit EZ4SCR.DLL and focus to EZ4.RC as following but it didn't work.
//--------------------//
Function EntryScr
local hDLL := SETRESOURCES("EZ4SCR.DLL")
BWCCRegister( GetResources() )
DEFINE DIALOG oDlg RESOURCE "RSFIELDS"
ACTIVATE DIALOG oDlg ON PAINT (FreeLibrary( hDLL), SetResource( MEMVAR->hResc ))
return
How can I tell the program to focus at 1 RC file?
Thanks&Regards,
Dutch
The 1st DLL (Convert to RC) file is our fixed entry screen (unmodification for user) and 2nd DLL is user modification entry screen (Booking screen) for each customer site. I compile my first DLL (RC) file to EXE file and 2nd will be able to modify (custom screen without changing source code) for customer need. Why has it 2 DLL files.
****************
Dear Antonio,
It has another problem is the program does not focus to the main resource (1st RC file) when exit from 2nd DLL. I try to do exit EZ4SCR.DLL and focus to EZ4.RC as following but it didn't work.
//--------------------//
Function EntryScr
local hDLL := SETRESOURCES("EZ4SCR.DLL")
BWCCRegister( GetResources() )
DEFINE DIALOG oDlg RESOURCE "RSFIELDS"
ACTIVATE DIALOG oDlg ON PAINT (FreeLibrary( hDLL), SetResource( MEMVAR->hResc ))
return
How can I tell the program to focus at 1 RC file?
Thanks&Regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
It works on FW16bits
Dear Antonio,
Yes, I've used Borland Control and it works in FW16bit. The 1st RC file is the same name of EXE file and the 2nd DLL is custom entry screen. This is my FW16 bits code
Example
=======
Static hResc
****************
Function main()
hResc := GetResources()
SET RESOURCES TO ("SECOND.DLL")
SET RESOURCES TO ("BWCC.DLL")
SetResource( hResc )
..
*************
Function Scr
Set Resource To "SECOND.DLL"
DEFINE DIALOG ...
ACTIVATE DIALOG ... ON PAINT SetResources( hResc )
return
Regards,
Dutch
Yes, I've used Borland Control and it works in FW16bit. The 1st RC file is the same name of EXE file and the 2nd DLL is custom entry screen. This is my FW16 bits code
Example
=======
Static hResc
****************
Function main()
hResc := GetResources()
SET RESOURCES TO ("SECOND.DLL")
SET RESOURCES TO ("BWCC.DLL")
SetResource( hResc )
..
*************
Function Scr
Set Resource To "SECOND.DLL"
DEFINE DIALOG ...
ACTIVATE DIALOG ... ON PAINT SetResources( hResc )
return
Regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
2 DLL files load is working
Dear Antonio,
It works if I use all in DLL files as below. But it didn't work if I use main resource as RC file. How can I load default (main) RC file as this cause.
ACTIVATE DIALOG oDlg ;
ON PAINT (SetResources("EZ4.DLL"), BWCCRegister( GetResources() ))
This code is working but can I do my case?
//---------------//
Function Main
Public hResc
hResc := LoadLibrary( "BWCC32.dll" ) // new fwh
SET RESOURCES TO "EZ4SCR.DLL" // new fwh
SET RESOURCES TO "EZ4.DLL" // new fwh
BWCCRegister( GetResources() ) // new fwh
...
...
return
//----------------//
Function EntryScr
SET RESOURCES TO "EZ4SCR.DLL"
DEFINE DIALOG oDlg RESOURCE 'RSFIELDS' TITLE 'In House List'
..
..
ACTIVATE DIALOG oDlg ;
ON PAINT (SetResources("EZ4.DLL"), BWCCRegister( GetResources() ))
return
Best regards,
Dutch
It works if I use all in DLL files as below. But it didn't work if I use main resource as RC file. How can I load default (main) RC file as this cause.
ACTIVATE DIALOG oDlg ;
ON PAINT (SetResources("EZ4.DLL"), BWCCRegister( GetResources() ))
This code is working but can I do my case?
//---------------//
Function Main
Public hResc
hResc := LoadLibrary( "BWCC32.dll" ) // new fwh
SET RESOURCES TO "EZ4SCR.DLL" // new fwh
SET RESOURCES TO "EZ4.DLL" // new fwh
BWCCRegister( GetResources() ) // new fwh
...
...
return
//----------------//
Function EntryScr
SET RESOURCES TO "EZ4SCR.DLL"
DEFINE DIALOG oDlg RESOURCE 'RSFIELDS' TITLE 'In House List'
..
..
ACTIVATE DIALOG oDlg ;
ON PAINT (SetResources("EZ4.DLL"), BWCCRegister( GetResources() ))
return
Best regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Can I use EZ4.RC file instead of EZ4.DLL?
Dear Antonio,
Can I load from default RC (same name with EXE file) instead of DLL? Because I want to include RC in EXE and distribute one DLL only but I don't know how to recall default RC file.
Best regards,
Dutch
Can I load from default RC (same name with EXE file) instead of DLL? Because I want to include RC in EXE and distribute one DLL only but I don't know how to recall default RC file.
Best regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Thanks a lot
Dear Antonio,
It works now.
Thanks for big help,
Dutch
It works now.
Thanks for big help,
Dutch