Using VB6 dll in Delphi app.
- From: David Kerber <ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 10:31:38 -0400
I'm the VB programmer on this project, and another guy is doing the
Delphi part.
System info:
Windows XP SP2
MSVBVM60.dll version 6.0.97.82, dated 2/23/04
I am using this hack:
http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html
to make a *windows standard* .dll with VB6. When I use it in another VB
app, using standard dll function calls, everything works great, the app
returns the values I expect, the logs are created, etc.
The trouble occurs when we try to use it in a Delphi app. After several
days of working with it, we can tell that it is getting into the
functions, but it appears that nothing which requires any kind of IO
from the dll is working, and throws Access violations in module
MSVBVM60.dll. A low level debugger shows that statements are executing
until we hit ones which require IO. This occurs whenever we try to
write to do debugging outputs such as writing to disk file, or pop up a
msgbox, and when we try to do real work such as make an OpenDatabase
call. If we only do internal processing (such as number crunching or
parsing the passed parameters), it works ok and returns what we expect.
We checked the obvious things:
we are using stdcall for the calling convention
the parameters are all aligned on 4-byte boundaries
variable types are compatible (VB long = Delphi Integer, etc)
DEP is set for "Essential windows programs and services only"
We use many of the structure (user-defined Types) definitions in other
working code, including a delphi dll used in VB, so we know they are
compatible.
One thing I'm not sure of is what I need in DllMain. Right now I've got
it always returning 1, but not doing any processing.
Any suggestions or pointers will be greatly appreciated. If it would
help, I can post source code as well...
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.
- Follow-Ups:
- Re: Using VB6 dll in Delphi app.
- From: Michael C
- Re: Using VB6 dll in Delphi app.
- From: Mike D Sutton
- Re: Using VB6 dll in Delphi app.
- Prev by Date: Re: Help needed on Hooking Crashes VB exe very often
- Next by Date: Re: Copy GIF to the clipboard
- Previous by thread: Correct group?
- Next by thread: Re: Using VB6 dll in Delphi app.
- Index(es):
Relevant Pages
|