1

I am writing C# applications that use an SDK, called PQLabs SDK.

In the sample code, the functions are set to delegate:

static PQMTClientImport.PFuncOnReceiveGesture cur_rg_func = new PQMTClientImport.PFuncOnReceiveGesture(OnReceiveGesture);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PFuncOnReceiveGesture()

static void OnReceiveGesture(ref PQMTClientImport.TouchGesture gesture, IntPtr call_back_object)

In the function OnReceiveGesture, I want to call and use the variable of a form. But inside the function it cannot call the variable or functions inside.

Is there a way to use them?

I have checked some solutions online: Call non-static method from static method c#

But since I want to use those non-static variables in the form so it seems it is not a possible solution.

How can I solve this problem?

Community
  • 1
  • 1
Olivier Chung
  • 49
  • 1
  • 1
  • 9

0 Answers0