Tom@FlagMountain
10 Aug 2007, 11:28
I am attempting to create an AI aircraft in managed code (VB.NET).
The "create" process is straightforward:
fsxSimConnect.AICreateNonATCAircraft("Mooney Bravo", "N1701", InitPos, DataRequestID7.REQUESTMOONEY)
fsxSimConnect.RequestDataOnSimObjectType(DataReque stID7.REQUESTMOONEY, DefineID.ID1, 0, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_SI MOBJECT_TYPE.AIRCRAFT)
BUT... I need the objectID for the Mooney to use when setting waypoints, etc. and I am having trouble getting this information back from SimConnect. I have tried to set up an event handler of the type:
AddHandler fsxSimConnect.OnRecvAssignedObjectId
However, there doesn't seem to be a matching SimConnect event which has the correct matching signature. The closest I can find is:
SimConnect.RecvAssignedObjectIdEventHandler(Addres sOf fsxSimConnect_OnRecvSimobjectDataBytype)
and Visual Studio is complaining that the signature on this function doesn't match the OnRecvAssignedObjectId signature.
Any assistance would definitely be appreciated.
Thanx
Tom
The "create" process is straightforward:
fsxSimConnect.AICreateNonATCAircraft("Mooney Bravo", "N1701", InitPos, DataRequestID7.REQUESTMOONEY)
fsxSimConnect.RequestDataOnSimObjectType(DataReque stID7.REQUESTMOONEY, DefineID.ID1, 0, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_SI MOBJECT_TYPE.AIRCRAFT)
BUT... I need the objectID for the Mooney to use when setting waypoints, etc. and I am having trouble getting this information back from SimConnect. I have tried to set up an event handler of the type:
AddHandler fsxSimConnect.OnRecvAssignedObjectId
However, there doesn't seem to be a matching SimConnect event which has the correct matching signature. The closest I can find is:
SimConnect.RecvAssignedObjectIdEventHandler(Addres sOf fsxSimConnect_OnRecvSimobjectDataBytype)
and Visual Studio is complaining that the signature on this function doesn't match the OnRecvAssignedObjectId signature.
Any assistance would definitely be appreciated.
Thanx
Tom