Re: Can't find a DLL when run from Debug
- From: erewhon@xxxxxxxxxx (J French)
- Date: Tue, 11 Apr 2006 08:16:02 GMT
On Sun, 9 Apr 2006 21:18:42 -0400, "Richard Lewis Haggard"
<HaggardAtWorldDotStdDotCom> wrote:
Thanks guys. I appreciate your input.
I never did figure out how to set a working directory in the project so I
just put an absolute path of the DLLinto the VB interface to DLL definition.
ChDir App.Path
Or tinker with the Path statement in the Environment Strings
This would be intolerable in a commercial project since it would lock the
project into always looking in a hard coded place for the DLL but this is a
development project, so I can get away with such sloppy practices.
There were multiple things I had to do to enable the VB program to find the
function in the DLL. Both the calling convention and the C++ propensity to
mangle names had to be addressed.
In the CPP code, the function is defined as:
BSTR _stdcall GetErrorString(SA_Status code, SA_Status* pStatus)
There are a couple of ways to disable C++ name mangling, but the easiest is
by putting the function export into the DEF file
;LIBRARY "SA_Sockets.dll"
DESCRIPTION 'SA Sockets Library'
EXPORTS
GetErrorString
.
- Follow-Ups:
- Re: Can't find a DLL when run from Debug
- From: Richard Lewis Haggard
- Re: Can't find a DLL when run from Debug
- References:
- Can't find a DLL when run from Debug
- From: Richard Lewis Haggard
- Re: Can't find a DLL when run from Debug
- From: Richard Lewis Haggard
- Can't find a DLL when run from Debug
- Prev by Date: Re: visual basic 5.0
- Next by Date: Re: input32
- Previous by thread: Re: Can't find a DLL when run from Debug
- Next by thread: Re: Can't find a DLL when run from Debug
- Index(es):
Relevant Pages
|