Hi,
I have the following code defined:
<StructLayout(LayoutKind.Sequential)> Public Structure Callbacks
<MarshalAs(UnmanagedType.FunctionPtr)> Public OnError As
OnErrorDelegate
<MarshalAs(UnmanagedType.FunctionPtr)> Public OnConnect As
OnConnectDelegate
End Structure
Dim pShuttleCallbacks As USTradeShuttleCallbacks
pCallbacks.OnConnect = New OnConnectDelegate(AddressOf OnConnect)
pCallbacks.OnError = New OnErrorDelegate(AddressOf OnError)
.....
and the "On..." fintion definitions.
when I call a function in my Unmanaged code in c++ with the callbacks
struct I get an NullReferenceException error, do I have to define
something to keep the delegate ?