Exporting c++ dlls to VB 
Author Message
 Exporting c++ dlls to VB

I post here as I think the main users of old fashioned C++ win32 dlls might
well be VB developers hacking up the odd bit of fast code.

I have followed the instructions in the MSDN notes that deal exactly with
this, but __stdcall is not behaving.  The function I declare as

__decslspec(dllexport) int __stdcall funkyfunc1 (int i)

should be described in the .map file as


rather than


I can get VB to call the function if I give it the gibberish name in the
Declare alias, but the output from the function is aslo gibberish.  I have
the "use __stdcall" option turned on in the project settings and I am using
MS Visual Studio 6.

Has anyone else had similar problems with __stdcall / __declspec(dllexport)
in VC++ 6?

TIA

Steven

--
----------------------------------
Steven Riley
----------------------------------
Wellcome Trust Centre for the
Epidemiology of Infectious Disease
University of Oxford
South Parks Road
Oxford
OX1 3PS
----------------------------------
Linacre College
Oxford
OX1 3JA
----------------------------------
01865 - (2)81229 (W)
01865 - 209295   (H)
----------------------------------



Sat, 12 Jan 2002 03:00:00 GMT  
 Exporting c++ dlls to VB
Did you add an Exports list to the Dll's DEF file? Without this, C++ will
"mangle" the function name. In earlier versions of  VC++ you had to use an
"Extern 'C'" declaration, but this is not necessary with the appropriate DEF
file.



Quote:
> I post here as I think the main users of old fashioned C++ win32 dlls
might
> well be VB developers hacking up the odd bit of fast code.

> I have followed the instructions in the MSDN notes that deal exactly with
> this, but __stdcall is not behaving.  The function I declare as

> __decslspec(dllexport) int __stdcall funkyfunc1 (int i)

> should be described in the .map file as


> rather than


> I can get VB to call the function if I give it the gibberish name in the
> Declare alias, but the output from the function is aslo gibberish.  I have
> the "use __stdcall" option turned on in the project settings and I am
using
> MS Visual Studio 6.

> Has anyone else had similar problems with __stdcall /

__declspec(dllexport)

- Show quoted text -

Quote:
> in VC++ 6?

> TIA

> Steven

> --
> ----------------------------------
> Steven Riley
> ----------------------------------
> Wellcome Trust Centre for the
> Epidemiology of Infectious Disease
> University of Oxford
> South Parks Road
> Oxford
> OX1 3PS
> ----------------------------------
> Linacre College
> Oxford
> OX1 3JA
> ----------------------------------
> 01865 - (2)81229 (W)
> 01865 - 209295   (H)
> ----------------------------------



Sat, 12 Jan 2002 03:00:00 GMT  
 Exporting c++ dlls to VB

Quote:
> Did you add an Exports list to the Dll's DEF file? Without this, C++ will
> "mangle" the function name. In earlier versions of  VC++ you had to use an
> "Extern 'C'" declaration, but this is not necessary with the appropriate
DEF
> file.

I was under the impression that a .DEF file was an alternative to the

__declspec(dllexport)

option, but I will try it with both and see how it goes.

Does anyone have example code for a dll exported under vc++ 6 with a

TA

Steven



Sat, 12 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

2. accessing exported C++ classes from a DLL

3. I need testers for serial port comm DLL and alpha paging DLL (Delphi, C/C++, VB)

4. VB DLL reading from ADO and colliding with C++ DLL reading there too (on NT)

5. DLL question -- integrating VB with C++ DLL

6. VB 5.0 calling C++ 5.0 DLL that calls winsock.dll

7. Calling a C++ DLL function which takes an C++ object as parameter

8. call C++ dll in VB.net

9. Problem using SmtpMail.Send() in a VB.NET dll with a C++ string

10. Debugging C++ DLL which is called from VB

11. Calling a C++ DLL using vb

12. Instability when calling a C++ DLL from VB.NET

 

 
Powered by phpBB® Forum Software