473,503 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exported C++ class

Hi,

I have a DLL that has a C++ class exported. Is there any way that I can
use this class in a C# program? I know about the COM interop but this class
isn't a COM class. I also know about accessing functions in DLLs using the
DllImport attribute but I don't think that imports classes (or does it??).
Any help will be appreciated. Thanks!

Gene
Aug 10 '05 #1
2 1183
Gene,
I have a DLL that has a C++ class exported. Is there any way that I can
use this class in a C# program?


Not directly no. The easiest way to do it would be to write a COM or
managed wrapper in C++.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Aug 11 '05 #2
Thanks!

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Gene,
I have a DLL that has a C++ class exported. Is there any way that I
can
use this class in a C# program?


Not directly no. The easiest way to do it would be to write a COM or
managed wrapper in C++.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Aug 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1803
by: Mayer | last post by:
Hello: Is there a way to see at the python prompt the names of all the public methods of a class or the names exported by a module? I know that GUI-based IDEs have a nifty way of displaying...
1
1414
by: Ingo Nolden | last post by:
Hi there, following example: class __declspec( dllexport ) Example { public: // ... some public funcs
1
1881
by: vijay | last post by:
I'm having trouble with calling an exported function in a native DLL compiled with eMbedded Visual C++ using C#. Basicly, I have one exported function in the DLL: whenever i execute this exe to...
2
4182
by: Rookie | last post by:
Hi, I have a DLL written in VC++ which exports a class. I want to import this class into a C# application and be able to instantiate it in the C# code. Is it possible to do this? If yes, is...
4
1767
by: mccoyn | last post by:
I have a class exported in a dll that has member variables I wish to access. When I do it I get an error C2039: 'myVar' : is not a member of myClass Here is an example of what my code looks like...
2
274
by: Gene Daniel | last post by:
Hi, I have a DLL that has a C++ class exported. Is there any way that I can use this class in a C# program? I know about the COM interop but this class isn't a COM class. I also know about...
1
1229
by: amitdedhia | last post by:
Hi I am migrating a product code (originally written in VS2003) to VS2005. The application is written in VC++ (using MFC) and has mix of managed and unmanaged classes. It is a desktop based...
18
1774
by: ciccio | last post by:
Hi all, The intel c++ compiler supports exported templates but I was wondering a bit about their used syntax. If I compare the syntax written in strostroup's book then there is a difference. ...
4
2670
by: =?Utf-8?B?SmVzc2ljYQ==?= | last post by:
Hi All, I know that I can use the GetProcAddress to get the proc address of a global exported function from a WIn32 dll. But if I have an exported class in the dll, is there a way to...
0
7204
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.