• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

BeatlesBlog and DataStruct attribute

Messages
13
Country
unitedkingdom
First of all big respect to Tim for his replacement for simconnect.

I was using the old simconnect but hit a brick wall sending multiple waypoints to an AI. Comments elsewhere suggest this is a marshalling problem.

Anyway, thought I'd try Tim's software and sure enough it works perfectly.

However I've hit another brick wall, I can't work out to create objects to receive data back into them. I can't work out how to translate the examples in C# to VB.

The call I'm making is this sc.RequestDataOnSimObjectType(Requests.PlaneUpdate, 200000, SIMCONNECT_SIMOBJECT_TYPE.ALL, MyClass)

The error I get back is Attempt to register a data structure that is not tagged with the DataStruct attribute

So somehow I need to add the DataStruct attribute to MyClass and I can't work out how to do this.

Can anybody post an example of how a class needs to be written?

Thanks in advance.
 
Here's a simple example showing how to use the custom attributes with public fields in a class def (I'm sure you can do the same thing with public properties, I'm just not sure of the VB syntax to declare those):

Code:
    <BeatlesBlog.SimConnect.DataStruct()> _
    Public Class DataClass
        <BeatlesBlog.SimConnect.DataItem("Plane Latitude", "Degrees")> _
        Public Lat As Double

        <BeatlesBlog.SimConnect.DataItem("Plane Longitude", "Degrees")> _
        Public Lon As Double

    End Class
 
Thanks Tim, worked a treat.

Wish I'd used your dll earlier, just realising how much easier it is.

Cheers.
 
If you're still around please post the solution.

A complete VB.Net example on how to do simple tasks like the WinForm example would be great!

Is the dll still working for you?

Thanks!
 
Last edited:
Back
Top