Board index » delphi » Thunking Problem

Thunking Problem

I have an old Visual Basic 3 program which needs to call a routine in
a 32bit DLL written in Delphi 2 to allow two programs to share a
common database.

The easiest way I found to do this was for the VB program to call a
routine in a 16bit Delphi program which in turn calls the 32bit DLL.
To do the thunking I used a Unit from the Delphi Super Page called
Call32nt.  This was designed for Win NT but seemed to work fine on Win
95.

Everything worked ok until I discovered a particular sequence of
events which caused a GPF in the VB program:

1) Load the VB program and call the DLL routine.
2) Exit the VB Program.
3) Load the Delphi 32bit program.
4) Quit the Delphi program.
5) Load the VB program and call the DLL.  At this point the system
crashed.

The DLL's are being released correctly by VB and no other program uses
them.

Can anyone suggest what the problem may be or let me know of any other
thunking components available.

Thanks

Kev.

 

Re:Thunking Problem


Quote
Kev (k...@northg.demon.co.uk) wrote:

:[description of events revealing problem snipped]

: The DLL's are being released correctly by VB and no other program uses
: them.

This may be a shot in the dark, but I had a similar problem with
VB 4.0 not releasing the DLL, even though everything indicated
that it was released correctly.

The problem only occured when running the VB program under the
IDE, so if you have not already, make an executable on your VB program
and run it like that.  I don't know why (we're talking about VB), but
it solved the DLL-release problem for me.

: Thanks

: Kev.

Chris.

Other Threads