Marshaling to c++ DLL vector

R

rdh

I'm trying to call a C++ DLL with a parameter that is a
vector<string>.
The C# program Marshaling keeps throwing an exception.

any thoughts?
 
W

Willy Denoyette [MVP]

rdh said:
I'm trying to call a C++ DLL with a parameter that is a
vector<string>.
The C# program Marshaling keeps throwing an exception.

any thoughts?


You can't pass std lib objects across module (exe, dll ...) boundaries and certainly not
across managed/unmanaged code boundaries.
You need to change the function in such way that it takes a C style array.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top