Hi
I'm trying to Pass pointer to a callback function from C# to C++ it's
working ok for a few minuts and then it's stops.
can anyone help with that ?
public class PA_Client
{
private int lHandle;
public delegate int pPAEvent( int lEventCode,int lOperationCode, string
sData);
//PAHandShake
[DllImport(@"\PA Api.dll" ,CallingConvent ion=CallingConv ention.Winapi
,CharSet=CharSe t.None, EntryPoint = "PAMultiHandSha ke")]
private static extern int _PAHandShake(re f int lClientHandle,i nt
lOperationCode, string sServerAddress, pPAEvent pEventFunc);
//PARequest
[DllImport(@"\PA Api.dll",Callin gConvention=Cal lingConvention. Winapi
,CharSet=CharSe t.None,EntryPoi nt = "PAMultiRequest ")]
private static extern int PARequest(int lClientHandle, int lOperationCode,
string sInputData);
//PAControl
[DllImport(@"\PA Api.dll",Callin gConvention=Cal lingConvention. Winapi
,CharSet=CharSe t.None, EntryPoint = "PAMultiControl ")]
private static extern int PAControl(int lClientHandle,s tring sInputData);
{
public void Run_PA()
{
int Success = _PAHandShake(re f lHandle,1,addre ss, new pPAEvent( Callback));
}
private int Callback(int opCode, int eventCode, string InputData)
{
//Do some thing
}
}
I'm trying to Pass pointer to a callback function from C# to C++ it's
working ok for a few minuts and then it's stops.
can anyone help with that ?
public class PA_Client
{
private int lHandle;
public delegate int pPAEvent( int lEventCode,int lOperationCode, string
sData);
//PAHandShake
[DllImport(@"\PA Api.dll" ,CallingConvent ion=CallingConv ention.Winapi
,CharSet=CharSe t.None, EntryPoint = "PAMultiHandSha ke")]
private static extern int _PAHandShake(re f int lClientHandle,i nt
lOperationCode, string sServerAddress, pPAEvent pEventFunc);
//PARequest
[DllImport(@"\PA Api.dll",Callin gConvention=Cal lingConvention. Winapi
,CharSet=CharSe t.None,EntryPoi nt = "PAMultiRequest ")]
private static extern int PARequest(int lClientHandle, int lOperationCode,
string sInputData);
//PAControl
[DllImport(@"\PA Api.dll",Callin gConvention=Cal lingConvention. Winapi
,CharSet=CharSe t.None, EntryPoint = "PAMultiControl ")]
private static extern int PAControl(int lClientHandle,s tring sInputData);
{
public void Run_PA()
{
int Success = _PAHandShake(re f lHandle,1,addre ss, new pPAEvent( Callback));
}
private int Callback(int opCode, int eventCode, string InputData)
{
//Do some thing
}
}
Comment