Does anybody know how can I properly receive Custom Mission Actions in C# with simconnect?
The following C# code seems to be working, but I can only get the first letter of the szPayLoad...
I realised, that the SIMCONNECT_RECV_CUSTOM_ACTION class (from the DLL) looks like this:simconnect.OnRecvCustomAction += new SimConnect.RecvCustomActionEventHandler(simconnect_OnRecvEvent);
simconnect.SubscribeToSystemEvent(EVENTS.CUSTOM, "CustomMissionActionExecuted");
private void simconnect_OnRecvCustomAction(SimConnect sender, SIMCONNECT_RECV_CUSTOM_ACTION recAction)
{
// recAction.szPayLoad
}
... and the variable size attribute (from the DLL):public class SIMCONNECT_RECV_CUSTOM_ACTION : SIMCONNECT_RECV_EVENT_BASE
{
public uint dwWaitForCompletion;
public Guid guidInstanceId;
[VariableSize]
public string szPayLoad;
public SIMCONNECT_RECV_CUSTOM_ACTION();
}
Can anybody help me, how can I set this VariableSize attribute, or what's the problem with my code?public class VariableSizeAttribute : Attribute
{
public VariableSizeAttribute();
public string CountMember { get; set; }
public Type FixedType { get; set; }
public string TypeMember { get; set; }
}
Thanks.