Link to home
Start Free TrialLog in
Avatar of Nniol
Nniol

asked on

Creating DLL's in Visual C++, for use in VB

I am creating some DLL's in Microsoft's Visual C++ for use in VB.

I can compile and create the DLL's, however, when I try to register them using regsvr32.exe or try to access them in VB using the DECLARE method, the system can't find a DLL entry point.

Do I need to explicitly create this in the VC++ code, or is there a setting I need to use - which I do not know about,
Avatar of Gandalf32
Gandalf32

Normal DLL are not registered with regsvr32. This is only for COM components. To use a regular DLL in Visual Basic, copy it to the program's directory, and declare the functions in a global module.
Remember to declare the functions in the DLL as EXPORT.
You should note that VB uses _stdcall calling convention for functions in DLLs

Is this a Standard DLL or a DLL that exports some com compliant interface ??

Have U defined UR exported functions in .def file in the dll? if not so add them and try
Regards
I believe, if I'm not mistaken, that you may also need to make sure that your references in VB are updated to include the dll so that VB knows what kind of objects you are using...
You don't need a DEF file to export functions
You do need the def file to set theexported names correctly for VB to find them
There is an alternative for def file:

extern "C"
ASKER CERTIFIED SOLUTION
Avatar of SampsonC
SampsonC

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial