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.
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?
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.
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.
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.