Callback

giovedì 27 ottobre 2005 - 19.37

Matax Profilo | Newbie

Buona sera:
ho questo puntatore a funzione definito in c
BOOL ( * MSG_SERVICE_NOTIFY_PROC) (
DWORD dwNotify,
LPBYTE lpbyData,
DWORD dwItems,
LPVOID lpvUser );
e la seguente funzione in c che permette di attivare il servizio che comunicherà con me attraverso il puntatore a funzione:
BOOL MSRTStartMsgService (
LPDWORD lpdwServiceID,
MSG_SERVICE_NOTIFY_PROC lpfnNotifyProc,
LPMSG_FILTER_STRUCT lpMsgFilter,
DWORD dwNotifyMask,
LPVOID lpvUser,
LPCMN_ERROR lpError );

ho definito il seguente delegate:
public delegate bool MSG_SERVICE_NOTIFY_PROC(
uint dwNotify,
IntPtr lpbyData,
uint dwItems,
IntPtr lpvUser
);
con la seguente funzione:
[DllImport("msrtcli.dll",CallingConvention=CallingConvention.StdCall)]
public static extern bool MSRTStartMsgService (
out System.Int32 lpdwServiceID,
MSG_SERVICE_NOTIFY_PROC lpfnNotifyProc,
MSG_FILTER_STRUCT lpMsgFilter,
uint dwNotifyMask,
IntPtr lpvUser,
out WinCCErrorStructure ErrorStructure);
Riesco ad agganciarmi al servizio, ma quando costui tenta di mandarmi qualcosa attraverso la funzione interna puntata dal delegate mi va in pappa tutta l'applicazione, senza neanche darmi un misero errore (si chiude e basta).Help!
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5