2
Reply

Using Unmanaged dll in C# ?

veselin_iordanov

veselin_iordanov

Feb 24 2004 9:04 AM
1.6k
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

Answers (2)