VC++ DLL and VB call VC++ DLL
Hi,
I am using win xp service pack2, vb and vc version 6.0. MS studio service pack 5.
I have the following scenario:
vc1.dll call vc2.dll functions, then vc1.dll functions is called by vb program.
My vb program when compiled as a exe file works fine, but ran from vb IDE doesn't work fine. I notice vb program when ran from my pc vb IDE can call vc1.dll as the vc1 dll declaration is declare in vb program, however vc2.dll is not called at all from vc1.dll ! The strangest thing, my program runs fine on other pcs, both from running from vb IDE, and as vb.exe file.
I would like to get the basics correct,
I only included the vc2 library files insides my vc1 workspace, and declare an object of vc2 to access vc2 whatever functions. I ran my vb program from vc++ IDE, it works fine. Do I need to specifically declare a block of statements ie _declspec(dllimport) my vc2 dll into my vc1???
I looked at series of articles at http://www.codeproject.com/dll/XDllPt1.asp but I am still not very clear on this.
Could anyone please advise me?
I tried all kinds of ways, putting the vc++ dlls in the same directory as vb program, or in the system directory or specifically include my directory path in the PATH env, reinstalling Microsoft visual studio. All attempts fail.
Thanks, Sally
Re: VC++ DLL and VB call VC++ DLL
sallypeh,
well one thing i can add dont use _declspec(dllimport) Please use __stdcall <fn Name > and export this function from .def file like exports
fnname @1 etc ...some times _declspec gives problmes ...of course this is what my Experience is
Good Luck,
x8086
Re: VC++ DLL and VB call VC++ DLL
Quote:
Originally Posted by x8086
sallypeh,
well one thing i can add dont use _declspec(dllimport) Please use __stdcall <fn Name > and export this function from .def file like exports
fnname @1 etc ...some times _declspec gives problmes ...of course this is what my Experience is
Good Luck,
x8086
For .def, that's for vb to use the DLL functions.
What should I declare in my vc1.dll or vc2.dll coding so my vc1.dll use vc2.dll functions ?
Thanks, Sally
Re: VC++ DLL and VB call VC++ DLL
Declare the im[ported functions in the .def file.
use proper __stdcall(...) decalaring statement of the function to be imported.
&
one easy thing u can do that , use WM_USER message from vc1 dll to vc2 dll to check whether message passing is right or wrong.