SmokingCookie
Member
Hi,
It seems my VB.NET (console) application has trouble seeing that a structure is used locally. Below, I have posted a few pieces of code.
Structure definition:
It all seems to work properly, until the call to AICreateNonATCAircraft is made. I get the following error:
Thanks in advance.
It seems my VB.NET (console) application has trouble seeing that a structure is used locally. Below, I have posted a few pieces of code.
VB.NET:
'hSimConnect has been created properly
hSimConnect.AddToDataDefinition(DEFINITION_1,"Kohlsman setting hg","inHg",SIMCONNECT_DATATYPE.SIMCONNECT_DATATYPE_FLOAT32,0,0)
hSimConnect.RequestDataOnSimObject(RequestId,DefineId,SimConnect.SIMCONNECT_OBJECT_ID_USER,SIMCONNECT_PERIOD.ONCE,0,0,0,1)
Dim POS As SIMCONNECT_DATA_INITPOSITION ' This is the structure passed to AICreateNonATCAircraft()
POS.Airspeed = 300
POS.Altitude = PlayerAlt
POS.Bank = 0
POS.Heading = PlayerHDG
POS.Latitude = LAT
POS.Longitude = LON
POS.OnGround = 0
POS.Pitch = 0
PrintNewLine()
' "POS" parameter in the next line triggers the error
hSimConnect.AICreateNonATCAircraft("Boeing 737-800 Paint6","N01000",POS,REQUESTID)
VB.NET:
Structure SIMCONNECT_DATA_INITPOSITION
Public Latitude As Double
Public Longitude As Double
Public Altitude As Double
Public Pitch As Double
Public Bank As Double
Public Heading As Double
Public OnGround As Double
Public Airspeed As Double 'DWord equivalent?
End Structure
Could anyone please help me on this one?Value of type 'ConsoleApplication1.SIMCONNECT_DATA_INITPOSITION' cannot be converted to 'Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATA_INITPOSITION'.
Thanks in advance.