I need some help with getting my unmanaged DLL to work.
that's my library function signature (in DLL):
extern "C" __declspec( dllexport ) BYTE* encrypt( char* ch_input, char* ch_key )
that's how I declare it in C#:
[ DllImport( "cbr_conv.dll" )]
static extern byte encrypt( string input, string key );
//... throws an exception
byte output = encrypt( input_string, key );
That doesn't work and I have "can not marshal return value" this error. I have very vague understanding of marshalling, but I know there're some restrictions on returning data from unmanaged code. Would appreciate if someone helps me to get it working. I have access to both files (C++ DLL and C# client) so I can change anything.