Using Unmanaged dll in C# ?
I know have alot of topics for this question i try everything but no offect ok here is my case: have C++ code:
typedef BYTE *BBSTR;
BBSTR __stdcall encode(BBSTR data)
{
UINT i, j;
BBSTR outstr;
outstr = AllocString(StringLen(data) * 2 + 1);
i = 0;
j = 0;
while(i < StringLen(data)) { //first to last char
if(data[i] < 0x08) {
outstr[j] = 0x07;
j++;
outstr[j] = data[i] ^ 0x0F;
} else {
outstr[j] = data[i];
}
i++;
j++;
}
outstr[j] = 1; //append 0x01 char
ReAllocString(&outstr, j + 1);
return outstr;
}
how to deffine this function in C# ? mybe is with marshal i try but ...
10x in advance
PS: sry about my bad english