[DllImport("some.dll")]
private static extern bool someFunction(string source, ref long num, ref long num2);
public void someOtherFunction(string source)
{
long num = 0L;
long num2 = 0L;
bool flag = this.someFunction(source, ref num, ref num2);
Console.WriteLine(num);
Console.WriteLine(num2);
}
#define sizeof_var( var ) ((size_t)(&(var)+1)-(size_t)(&(var)))
extern "C" bool __declspec(dllexport) someFunction(std::string source, int64_t* num, int 64_t* num2) {
std::vector<char> bytes(source.begin(), source.end());
bytes.push_back('\0');
char* c = &bytes[0];
*num = *c; // ???
*num2 = sizeof_var(c);
return true;
}