Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creation of Dynamic Link Library

Status
Not open for further replies.

KarthikSankar

Technical User
Apr 9, 2001
3
IN
I'm trying to create a dll from Visual C++ environment and then calling it in Visual Basic. When I do this the Visual Basic application closes. I can't understand the problem. Can anyone help me.
 
Is the C++ DLL a COM object, or is it a simple set of functions exported through an API. Also, when VB application closes, do you get any kind of error? - Jeff Marler B-)
 
No it is not a COM object. We defined a type library in C and created a dll. It does the necessary function which it has to do in VB. But it closes the VB application without any error. Sometimes it pops an error saying unreferenced memory, but this occurence is rare.
As an EXE the function is working perfectly well. But the problem crops up when it is converted to dll.
Is the process of creating dll using type libraries correct or is there any other way you can overcome this.

Waiting for your reply,
Thanks Marler.

With Regards,
KarthikSankar
 
Did you export your public functions via a .DEF file, and did you surround the function prototype with extern "C" { } ?

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top