Export function from Visual C++ to be used in Visual Basic 
Author Message
 Export function from Visual C++ to be used in Visual Basic

I was having difficulty to export functions or member functions from
Visual C++ and build a DLL to be used in Visual Basic. I was
following the instruction and the example. But I got a message
saying the function is not found when calling it from VB code.
I used the marco __declspec(dllexport) to export the function
in C++. Could anyone shed some light on this for me? Thanks in
advance.

Jin Yang



Sun, 14 Feb 1999 03:00:00 GMT  
 Export function from Visual C++ to be used in Visual Basic


wrote in comp.lang.c++:

=>I was having difficulty to export functions or member functions from

=>Visual C++ and build a DLL to be used in Visual Basic. I was
=>following the instruction and the example. But I got a message
=>saying the function is not found when calling it from VB code.
=>I used the marco __declspec(dllexport) to export the function
=>in C++. Could anyone shed some light on this for me? Thanks in
=>advance.

This belongs more in a Windows newsgroup, but -
how did you declare the func? VB 3 only accepts CALLBACK funcs
(undecorated func name). I haven't done any DLLs for VB4, so I won't
comment on it.
Generally, your C or C++ func declaration should look similar to -
 extern "C" <returntype> CALLBACK func(arglist);

<><><><><><><><><><><><><><><><><><><><>

Wizard's First Rule:
    People are stupid.
            - Terry Goodkind

<><><><><><><><><><><><><><><><><><><><>



Mon, 15 Feb 1999 03:00:00 GMT  
 Export function from Visual C++ to be used in Visual Basic

It could be that C++ name mangling is getting in the way. You could try
declaring the routine as extern "C". You can also use a program like EXEHDR
to check the name which is being exported.
--

Robert Chafer
Digital iD Picture Systems

Quote:
> saying the function is not found when calling it from VB code.
> I used the marco __declspec(dllexport) to export the function
> in C++. Could anyone shed some light on this for me? Thanks in
> advance.



Mon, 15 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do you call a Visual C++ (DLL) function from Visual Basic

2. Calling Visual C++ 5.0 DLL Functions From Visual Basic 5.0

3. Visual C++ and Visual Basic and Visual J++

4. I am lokking for a professional who works with visual basic, poerbuilder, and C++

5. need some basic information on visual basic and visual c++

6. need some basic information on visual basic and visual c++

7. Visual C++ vs Visual Basic

8. Visual C++/Visual Basic/COM problem

9. visual basic vs. visual c++ which is better

10. Visual BASIC or Visual C++

11. Visual Basic Vs. Visual C++

12. FS: Visual Basic/Visual C++/Computer books 1/2 cover price

 

 
Powered by phpBB® Forum Software