C++ to C# interop -- wrapper class?

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 39
Reputation: nvmobius is an unknown quantity at this point 
Solved Threads: 4
nvmobius nvmobius is offline Offline
Light Poster

Re: C++ to C# interop -- wrapper class?

 
0
  #11
Jul 29th, 2008
CLR Managed code can call methods in another DLL via P/Invoke, but I recommend not doing that and instead having the native portion of you code handle dealing with other unmanaged code blocks.

C++/CLI is primarily designed to be a bridge language between managed and unmanaged code, so using it accordingly will save you a lot of time.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 56
Reputation: ninjaneer is an unknown quantity at this point 
Solved Threads: 6
ninjaneer ninjaneer is offline Offline
Junior Poster in Training

Re: C++ to C# interop -- wrapper class?

 
0
  #12
Jul 30th, 2008
Originally Posted by nvmobius View Post
CLR Managed code can call methods in another DLL via P/Invoke, but I recommend not doing that and instead having the native portion of you code handle dealing with other unmanaged code blocks.

C++/CLI is primarily designed to be a bridge language between managed and unmanaged code, so using it accordingly will save you a lot of time.

And to access a regular ol' unmanaged DLL with unmanaged code? Any special tricks like P/Invoke? Or can I just call it like normal?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 39
Reputation: nvmobius is an unknown quantity at this point 
Solved Threads: 4
nvmobius nvmobius is offline Offline
Light Poster

Re: C++ to C# interop -- wrapper class?

 
0
  #13
Aug 11th, 2008
You still need to set up your methods accordingly, but I find using C/C++ LoadLibrary and GetProcAddress to get the other native code and then calling the calling code with C++/CLI is much easier way to wrap things.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: h.sileem is an unknown quantity at this point 
Solved Threads: 0
h.sileem h.sileem is offline Offline
Newbie Poster

Re: C++ to C# interop -- wrapper class?

 
0
  #14
Jul 5th, 2009
i also have the same problem , as i have DLL in C++ and i wanna create C# wrapper for this dll to use it in C# project. so if some one can help me with better details for how exactly i can do this, i would greatly appreciate.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: C++ to C# interop -- wrapper class?

 
0
  #15
Jul 6th, 2009
Please open a new thread about it.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC