PC Review


Reply
Thread Tools Rate Thread

How to call a C++ DLL from C# code

 
 
falk
Guest
Posts: n/a
 
      15th Dec 2003
i've a c++ library and want to use it from my c# code.
how can i do it?
is there a need to compile the c++ code with .NET c++
compiler?
thanks a lot, falk
 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      15th Dec 2003
Nope, you can use P/Invoke:

Source: http://www.ondotnet.com/pub/a/dotnet...ominterop.html
While Microsoft has incorporated much functionality into the .NET Framework
class libraries, significant additional functionality resides outside of the
managed world of .NET. COM interoperability is necessary in order to access
native system APIs, such as shell integration, DirectX, Microsoft Office,
and the Windows Registry, as well as custom legacy COM objects. COM
interoperability in .NET can be a tricky issue for developers, who have to
deal with issues such as figuring out the appropriate data types to use and
marshalling data between managed and unmanaged code.


..NET provides access to COM components through its P/Invoke facility.
P/Invoke allows developers to invoke native unmanaged methods from managed
code. In this article, we will walk through an example of COM
interoperability from within C#.
--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan

"falk" <(E-Mail Removed)> schreef in bericht
news:037d01c3c34a$3c31aab0$(E-Mail Removed)...
> i've a c++ library and want to use it from my c# code.
> how can i do it?
> is there a need to compile the c++ code with .NET c++
> compiler?
> thanks a lot, falk





 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call code to make phone call Mary Windows XP General 1 8th Nov 2004 08:18 PM
How to call code in aspx webform from functions defined in code behind modules CW Microsoft ASP .NET 3 2nd May 2004 03:20 PM
disable call waiting on a local call puts in area code JMB Windows XP General 0 17th Feb 2004 10:32 PM
disable call waiting on a local call puts in area code JMB Windows XP Print / Fax 0 17th Feb 2004 10:32 PM
disable call waiting on a local call puts in area code JMB Windows XP Print / Fax 0 16th Feb 2004 11:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 PM.