landus

landus

  • NA
  • 1
  • 0

access a c -dll function problem

Nov 22 2004 4:38 PM
Hi @ all and thanks for reading: i have got some problems to access a c - (dll)function from c# this is the prototype: status theFunction ( PVOID pvArg1,PVOID pvArg2, DWORD dwFlags ); pvArg1 Meaning depends on dwFlags pvArg2 Meaning depends on dwFlags dwFlags Determines format of returned information one way to use the function is DWORD i=0; char* Buffer[16]; / status = theFunction ((PVOID)i, Buffer, FLAG1|FLAG2); the function stores a value in the char-Buffer under visual c++ the function works perfectly this way. now i dont know how to marshal the first arg (PVOID)i .... i tried it with IntPtr, ref i ect., but without success :-( the second problem: how can i marshal char* Buffer? ([MarshalAs(UnmanagedType.LPTStr)] string? [MarshalAs(UnmanagedType.LPTStr)] StringBuffer??) thanks a lot Landy

Answers (2)