Call a Dll from an Exe
- don lowenstein
- Posts: 201
- Joined: Mon Oct 17, 2005 9:09 pm
- Been thanked: 3 times
- Contact:
Call a Dll from an Exe
I have setup a simple exe and dll. I am attempting to dynamicly call a dll from an exe. In my simple example I am calling the dll and execution is passing to the Dll no problem. However, when the dll returns, execution ends, and does NOT resume in the exe as I would suspect.
I am using the fwh\samples\tutor01.prg as the dll example, and I am using the testdll.prg as the exe.
My environment is xharbour 0.99.51 - fwx v2.6 using borland compiler.
Can anyone point me in the proper direction on this issue?
Any help is greatly appreciated.
I am using the fwh\samples\tutor01.prg as the dll example, and I am using the testdll.prg as the exe.
My environment is xharbour 0.99.51 - fwx v2.6 using borland compiler.
Can anyone point me in the proper direction on this issue?
Any help is greatly appreciated.
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
- don lowenstein
- Posts: 201
- Joined: Mon Oct 17, 2005 9:09 pm
- Been thanked: 3 times
- Contact:
What build...bat are you using to build the DLL ?
I modified the buildhd.bat in the fivewin samples to adher to my environment - did not change any compile / link switches.
I am attempting to create a self contained dll.
I modified the buildhd.bat in the fivewin samples to adher to my environment - did not change any compile / link switches.
I am attempting to create a self contained dll.
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Don,
Here it is working fine using FWH 8.06 and current xHarbour provided with it. Here you have the EXE and the DLL, so you can test it yourself:
http://www.mediafire.com/?hwwlfmibi1u
Here it is working fine using FWH 8.06 and current xHarbour provided with it. Here you have the EXE and the DLL, so you can test it yourself:
http://www.mediafire.com/?hwwlfmibi1u
- don lowenstein
- Posts: 201
- Joined: Mon Oct 17, 2005 9:09 pm
- Been thanked: 3 times
- Contact:
Antonio - Thank you for the quick response and sample.
This example works great
Can you send the source - and scripts used to make/link?
This is exactly what I am atempting, however - my exe never gets control back after the dll return.
Thank you for your help
This example works great
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Can you send the source - and scripts used to make/link?
This is exactly what I am atempting, however - my exe never gets control back after the dll return.
Thank you for your help
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Don,
I used the same sources as you: the ones from fwh\samples without modifying them:
I guess the differences come from the different xHarbour build that we are using. I suggest you to upgrade to the most recent FWH and xHarbour.
I used the same sources as you: the ones from fwh\samples without modifying them:
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
HbDLLEntry( "MAIN" )
MsgInfo( "ok from EXE" )
return nil
DLL FUNCTION HBDLLENTRY( cProc AS LPSTR ) AS LONG PASCAL LIB "Tutor01.dll"
I guess the differences come from the different xHarbour build that we are using. I suggest you to upgrade to the most recent FWH and xHarbour.
- don lowenstein
- Posts: 201
- Joined: Mon Oct 17, 2005 9:09 pm
- Been thanked: 3 times
- Contact:
Antonio - Thank you for the assistance.
The most current xHarbour we have is v1.0 - with FWH v7
What versions are you using?
I also noticed in the scripts a reference to maindll.obj
I do not have this module - what is it?
Thanks again for all your help
The most current xHarbour we have is v1.0 - with FWH v7
What versions are you using?
I also noticed in the scripts a reference to maindll.obj
I do not have this module - what is it?
Thanks again for all your help
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Don,
We are using current FWH 8.06 with the xHarbour (June 2008) published on these forums in http://fivetechsoft.com/forums/viewtopic.php?t=2486
maindll.obj is a Harbour/xHarbour module, that it is not included by default in the setup file. Here you have it:
http://rapidshare.com/files/123510556/maindll.obj.html
We are using current FWH 8.06 with the xHarbour (June 2008) published on these forums in http://fivetechsoft.com/forums/viewtopic.php?t=2486
maindll.obj is a Harbour/xHarbour module, that it is not included by default in the setup file. Here you have it:
http://rapidshare.com/files/123510556/maindll.obj.html
Re: Call a Dll from an Exe
Hi Antonio i have the same problem with tutor01.prg and testdll.prg using the buildhd.bat.
I DONT HAVE THE FILE NAMED MIANDLL.OBJ, SO I REM THE LINE BUT....
It runs the DLL but does not cam back in the EXE file.
Any solution for me ?
FWH 8.1 HARBOUR 1.01 (build. 9361)
I DONT HAVE THE FILE NAMED MIANDLL.OBJ, SO I REM THE LINE BUT....
It runs the DLL but does not cam back in the EXE file.
Any solution for me ?
FWH 8.1 HARBOUR 1.01 (build. 9361)
Re: Call a Dll from an Exe
Hi to all,
can sameone very kkkiiiinnnnddddlllyyyy pass me the maindll.obj ?
Tks
can sameone very kkkiiiinnnnddddlllyyyy pass me the maindll.obj ?
Tks
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: Call a Dll from an Exe
Romeo,
Files names have been changed in Harbour, here you have what it is available now:
http://www.mediafire.com/file/mijlz2nhol1/maindllh.obj
http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/src/vm/
Files names have been changed in Harbour, here you have what it is available now:
http://www.mediafire.com/file/mijlz2nhol1/maindllh.obj
http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/src/vm/
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: Call a Dll from an Exe
Romeo,
I think it is going to be much more convenient and easier for you if you upgrade to the most recent Harbour version and also if you use HRB files instead of DLL files. There have been so many changes in Harbour.
I think it is going to be much more convenient and easier for you if you upgrade to the most recent Harbour version and also if you use HRB files instead of DLL files. There have been so many changes in Harbour.