Newbie Please help

  • Thread starter Thread starter CQL90
  • Start date Start date
C

CQL90

Hi All,

First, I would like to thanks you all in advance.

My first question is: How can I call VB code and/or C++ code from C#( .cs ).

Any help is deeply appreciated. Thanks you...

Kate
 
Hi All,

First, I would like to thanks you all in advance.

My first question is: How can I call VB code and/or C++ code from C#( .cs ).

Any help is deeply appreciated. Thanks you...

Kate

Is this VB6 code? If so, you need to set a reference in the C# project
to the VB6 DLL. You can do that via the COM tab on the Add Reference dialog.
After that it's just like any other referenced assembly. If it's VB.NET,
then use either the Project tab or the .NET tab on the Add reference dialog.

C++ is the same if it's managed C++ or C++ COM objects. If it's 'old-fasioned'
C++, not COM, then DLLImport is what you need.
 
Hi,

the term VB/C++ code in kinda loose, because you can write both managed as
well as unmanaged code with both these
languages. So if it is managed code interoperation that you are looking for,
its a breeze. Just reference the DLL that contains
VB or C++ (managed) code and access them right away.

If it is managed/unmanaged code interop then you need to look at PInvoke
(Platform Invoke). Try searching MSDN.
If you are looking for COM interop, look at COM interop articles at
http://www.codeproject.com/. There are some
good ones there.

Hope this helps...
 
Back
Top