Discussion Locked

dll registration

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have source for an old DLL the in Visual C that I would like to put a wrapper around so that it can be registered as a resource in VB rather than having to put declarations in the VB source and put the DLL in the PATH.
I am looking for a simple example that I could follow. someting like the f_to_c function in a DLL that can be called from VB6.

5 replies

by madestroitsolutions

My friend, if you have a DLL, its methods are probably callable from VB. DLL's are meant to be shared by applications regardless of their source code language, unless the methods are protected (not public) or the DLL is not creatable. If you want touse it in VB, simply select references in the project menu, and select it. If it doesnt appear on the list, you can either browse to it, or register it on the system with regsvr32.exe. Registering it makes it available in the reference list. If youdistribute the application make sure you include your DLL with it.

Any questions or comments, please feel free to write at: juanja01@optonline.net

Good Luck!

by dlembry

I think you missed my point. I have a DLL that doesn't get registered by regsvr32.exe. Since I know the entry points and I have the .LIB file I can put declarations in the VB source and call the DLL. But the DLL doesn't can't be found unless it is in the Path.

by dlembry

Point value changed by question poster.
The DLL was orginally created with VC 1.5 as a 16bit dll and was upgraded to 32bit, but it does not contain any registration code.

by smart_santanu

In the DLL you require to declare the exported function as stdcall so that it can in turn be called by VB.

The next steps are as simple as API programming in VB.

by dlembry

The point is that I don't want to have to set up declarations in the VB code for the DLL functions that have been exported. Yes, I have used the stdcall, else they would not be found by the VB application at all.

This discussion is closed to new replies.