Hi,
I've got a C++ DLL and a C# GUI. The DLL gets a value and then needs to pass it back to the C# program in the form of a string.
I know this is probably a glaringly simple thing to achieve but it's escaping me at the moment.
I want something simple like this, a function that I can call from the C# part of my program that returns a string that I can then print to file/messagebox or whatever:
extern "C" __declspec(dlle xport)
string DataToReturn()
{
string test="TEST";
return test;
}
I've tried a few combinations of char/string etc but seem to always come accross access violation exceptions.
Anyone have any insight into this? :)
I've got a C++ DLL and a C# GUI. The DLL gets a value and then needs to pass it back to the C# program in the form of a string.
I know this is probably a glaringly simple thing to achieve but it's escaping me at the moment.
I want something simple like this, a function that I can call from the C# part of my program that returns a string that I can then print to file/messagebox or whatever:
extern "C" __declspec(dlle xport)
string DataToReturn()
{
string test="TEST";
return test;
}
I've tried a few combinations of char/string etc but seem to always come accross access violation exceptions.
Anyone have any insight into this? :)
Comment