943,844 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 19846
  • C# RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 29th, 2008
0

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

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.
Reputation Points: 11
Solved Threads: 4
Light Poster
nvmobius is offline Offline
39 posts
since Jul 2008
Jul 30th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by nvmobius ...
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?
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
ninjaneer is offline Offline
56 posts
since Jun 2008
Aug 11th, 2008
0

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

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.
Reputation Points: 11
Solved Threads: 4
Light Poster
nvmobius is offline Offline
39 posts
since Jul 2008
Jul 5th, 2009
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
h.sileem is offline Offline
2 posts
since Jul 2009
Jul 6th, 2009
0

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

Please open a new thread about it.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Delegate Events
Next Thread in C# Forum Timeline: NumericUpDown - No maximum or minimum





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC