cajuginja

cajuginja

  • NA
  • 1
  • 2.5k

Help with callbacks in C#

Mar 8 2006 6:27 AM

Hello
I have the following code written in c++ 6.0.
I need to write it in C# 2.0 , but i don't know
how to define those callbacks in C#.
Is it possible to use that API in C#?
Can any one help me?

Thank You
Caju Ginja

 


TEST.h

typedef DWORD (CALLBACK* PACCOMSVRCALLBACK_CONNECT)(LPVOID, AC_TERMINAL_CONNECTINFO*, LPDWORD);
typedef DWORD (CALLBACK* PACCOMSVRCALLBACK_DISCONNECT)(LPVOID, DWORD);

typedef struct {
 PACCOMSVRCALLBACK_CONNECT    pCallbackConnect;
 PACCOMSVRCALLBACK_DISCONNECT    pCallbackDisconnect;
} AC_CALLBACK_FUNCTION_1;

void WINAPI ACCOM_SetCallbackFunctions(LPVOID pParam, DWORD nCallbackType, LPVOID pCallbacks);

 

///////////////////////////////////////////////////////////////

TEST.CPP

 AC_CALLBACK_FUNCTION_1 callbacks;

 memset(&callbacks, 0, sizeof(AC_CALLBACK_FUNCTION_1));

 callbacks.pCallbackConnect = NULL;
 callbacks.pCallbackDisconnect = Callback_Disconnected;

 ACCOM_SetCallbackFunctions( this, 1, &callbacks);
////////////////////////////////////////////////////////////////////


 


Answers (1)