How to use C++ class from .NET ?

  • Thread starter Thread starter Oleg Subachev
  • Start date Start date
O

Oleg Subachev

I have C++ source code of a class.
I need to use this class form .NET.

What is the easiest way to perform this ?
 
Hi Oleg,

A bit more detail would have been appreciated but I will make some
assumptions.

1. Assuming you encapsulated your class in a native Windows DLL, you'll have
to use PInvoke (see google)
2. Assuming you encapsulated your class in an ActiveX component, you'll have
to generate a wrapper class using the tlbimp tool.

Hope that helps

Fabien
 
1> If you use Visual C++.net, you should be able to use it directly.
2> If you use other .Net language, you need to build a dll firstly, and
then use P/Invoke to call it.

HTH.

Jianwei
 
2> If you use other .Net language, you need to build a dll firstly, and
then use P/Invoke to call it.

I need to use from Delphi.NET.

The best choise for me is to use COM-server, but as I am absolute layman in
C++
I need help for how to convert C++ class into COM-server.
 
Oleg Subachev said:
I need to use from Delphi.NET.

The best choise for me is to use COM-server, but as I am absolute layman
in
C++
I need help for how to convert C++ class into COM-server.


--
Best regards,

Oleg Subachev
(e-mail address removed)


Write a managed wrapper using VC7.1 managed extensions (or the upcoming VC8
C++/CLI), it's easier than to transform the C++ class into a COM server and
you can directly access the managed class from Delphi.NET.


Willy
 
Write a managed wrapper using VC7.1 managed extensions (or the upcoming
VC8
C++/CLI), it's easier than to transform the C++ class into a COM server and
you can directly access the managed class from Delphi.NET.

As I said I am absolute dilettante in C++.
Where can I read (or get manual) about how to write a managed wrapper ?
 
Back
Top