WINAPI CALL

  • Thread starter Thread starter Qindong Zhang
  • Start date Start date
Q

Qindong Zhang

I have a API function which declared in VC++ like this:

DLLimport BOOL WINAPI bl_HERA16_SetPlayBuffer(int iChannel,BYTE
**bpBuffer);

How could I declare and call this function in C#. I have problem on
second parameter.

Thks
 
Qindong Zhang,

The declaration should be as follows:

[DllImport("mydll.dll")]
public static extern bool bl_HERA16_SetPlayBuffer(
int iChannel,
IntPtr bpBuffer);

You are going to have to marshal the reference to the byte pointer
yourself, depending on what is being passed in. Is it a two-dimensional
array? Or is it a pointer to an array? Or is it a double pointer to a
single byte?
 
Back
Top