Jump to content
  • Advertisement
Sign in to follow this  

COM Problem Unmanaged Calling Managed

This topic is 4023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, This is all new to me so please be patient. I have an unmanaged c++ app that needs to call into a c# dll. I have done a HelloWorld app just to get a feel for how this will work. The HelloWorld app works fine, but when I apply the same techniques to the my project it fails. I swapped out the pieces of the HelloWorld with my project until I found that the problem is coming from my C# dll. For some reason the CLSID that's coming from the C# is not correct, and therefore the pointer ends up being NULL. Has anyone seen something like this before? Here's the little bit of code that does all the work: HRESULT hr; hr = CoInitialize(NULL); CLSID clsid_SessionSFTP = __uuidof(SessionSFTP); hr = pISessionSFTPPtr.CreateInstance(clsid_SessionSFTP); hr = S_OK; int testCallInt = pISessionSFTPPtr->getIntTest(); CoUninitialize (); Thanks in advance for any and all assistance. Daniel

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!