Interoperability in VC++ and VB.NET

Perseus

Member
Joined
Aug 5, 2009
Messages
7
Programming Experience
Beginner
Hi friends,
I am planing to create and vb.NET application in which i have to call some existing vc++ codes... :rolleyes:
After some initial reading i found i have to create some .dll and then call them..
but i cant able to do so with existing big code..
I need some expert guidance for that..:D
Any tutorials or any examples will be greatly appreciated.
Thanks in advance..:)
 
There are really only three options:

1. The C++ DLL is a .NET assembly, in which case you simply reference it like any other assembly.

2. The C++ DLL is a COM component, in which case you simply reference it as though it was an assembly. You then need to be careful that you destroy all your unmanaged objects correctly.

3. The C++ DLL exports functions directly, in which case you declare matching methods in your VB code and apply the DllImport attribute, just like for Windows API functions.

If you can tell us which applies then we can help further but there are plenty of existing examples of each available.
 
Thanks jmcilhinney,
To be honest i am not sure about it...I am new in .NET and started building a vb.NET application.. I have some of VC++ codes which have their functanilities..
I read somewhere that to transfer them as dll i have to chage codes ( like insted of passing the result in function return type ..store the pointer ... :rolleyes:)
Anyways if you can refer me to some examples site , i will try them and study them..:D
Thanks for reply..
 
If you want to know how to change C++ code then this is not really the right place to ask. As I said, there are three ways that .NET apps could consume a C++ DLL but you first have to work out which of those three ways the DLL exposes its functionality. I'm guessing the third but, again, that's not really an issue for a VB.NET forum. If you can tell us how the C++ DLL exposes its functionality then we can tell you how to consume it in VB. Anything beyond that is not really within the scope of this forum.
 
Hay hay..
after some googling...;) I can manage to create a DLL...
and it was like i have to register it with regsvr32 command...but when i tried so..it pops the msg that DLL was loaded but the DLLRegisterServer entry point was not found... :(

Any clues
 
Back
Top