CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: thumperj

Search: Search took 0.02 seconds.

  1. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Night Wulfe, our posts passed in the ether. Thanks. I just figured out the solution you suggested.

    Thanks again for the help.
  2. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Ok, so this has been a learning experience but I'll share how I've solved the issue in case anyone wanders into this thread. Of course, this is going to be pretty obvious to most people. It's...
  3. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Thanks, Night Wulfe.

    So, my original claim was incorrect - the DLL *IS* being compiled with /clr. So, given that, any suggestions how I can just pass a string down to it?

    I've posted a zip...
  4. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Thanks, vcdebugger. After your suggestion I've been off reading about MarshalAs. All new to me.

    However, unless I've misunderstood or misplaced something, adding that to the code doesn't help...
  5. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Instead of continuing the back and forth, I've created a simple example that demostrates the issue I'm trying to resolve. I've attached it to this thread.

    Check out Form1.cs, line 27. Just...
  6. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Yes, ok. The /clr flag is set so it apparently does support CLR.
  7. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Hmmm.... I guess I'm even more confused than I thought I was. I thought I had answered all those questions. Let me try again.

    The C++ is unmanaged, which is what I thought meant it was not CLI. ...
  8. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Der... yeah. That would make sense:

    Error The best overloaded method match for 'MyClass.MyClassClass.Foo(sbyte*)' has some invalid arguments
    Error Argument '1': cannot convert from 'string' to...
  9. Re: C# System.String parameter passed into an unmanaged C++ DLL

    I'm confused. What "important bits" am I missing? I thought I had included all that was needed, else I would have included the rest. Can you be more specific?

    Thanks.
  10. Re: C# System.String parameter passed into an unmanaged C++ DLL

    Don't have one.

    Why, you ask? Since I have included the DLL as a reference, I didn't think I needed a C# function definition. I'm calling all kinds of other functions from the DLL with no...
  11. C# System.String parameter passed into an unmanaged C++ DLL

    Lost..... :( How do I call an unmanaged C++ DLL class member function from C# code? I can change any and all of these definitions. I just need to get a string from the C# world to the C++ world...
Results 1 to 11 of 11





Click Here to Expand Forum to Full Width

Featured