Jump to content
The simFlight Network Forums

Offset 32FA


Recommended Posts

I am using the FSUIPC DLL and VB.NET to display messages in Flight Sim. I can get the message to display fine, but it stays there. I am writing data to offset 32FA, but the message still says there. Here is my code:

    Public Function ShowFSMessage(ByVal Message As String, ByVal Delay As Integer)
        Dim FSWriteMessage As Offset(Of String) = New FSUIPC.Offset(Of String)(&H3380, 127)
        Dim DelayMessage As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H32FA)
        Dim WriteText As String
        WriteText = Message
        WriteText = WriteText
        FSWriteMessage.Value = WriteText
        DelayMessage.Value = Delay
        FSUIPC.FSUIPCConnection.Process()
        Return 0
    End Function

Any ideas to why it is doing this?

Link to comment
Share on other sites

I am using the FSUIPC DLL and VB.NET to display messages in Flight Sim. I can get the message to display fine, but it stays there. I am writing data to offset 32FA, but the message still says there. Here is my code:

Sorry, the code is no good to me. It doesn't tell me what you are writing to FSUIPC. Please use the FSUIPC Logging (see the options, Logging page). Log IPC Writes, then repeat your test, and look at the log. Show me it if you like. You should easily be able to see what you end up writing to 32FA. Yu are probably writing a value that tells FSUIPC to let the message to stay there till replaced (eg zero), or maybe for a very long time (eg thousands of seconds).

Pete

Link to comment
Share on other sites

There's two issues here - one is a bug in the DLL which I will fix tomorrow: When you do a write it continues to write on every process after that. I think this was intruduced in the last update.

The other issue is that you're adding the two offsets into the default group by not specifying a group name. I'm guessing you have another loop somewhere that's also calling Process(). When you do that it'll write the message and delay offset again.

You can fix your code (even with the broken DLL) by adding these offsets to a seperate group. Another thing you need to do is disconnet the group before these offsets go out of scope at the end of the function. As it stands at the moment you can only run this function once. The second time it will throw an error because you're trying to re-register the offsets

Below is a new version which will fix it. The user guide describes the group and scope concepts in more detail. If you need any more explaination let me know.

(BTW, I can't see any need for the WriteText bits. Just do FSWriteMessage.Value = Message)

    Public Function ShowFSMessage(ByVal Message As String, ByVal Delay As Integer)
        Dim FSWriteMessage As Offset(Of String) = New FSUIPC.Offset(Of String)("Message",&H3380, 127)
        Dim DelayMessage As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)("Message",&H32FA)
        Dim WriteText As String
        WriteText = Message
        WriteText = WriteText
        FSWriteMessage.Value = WriteText
        DelayMessage.Value = Delay
        FSUIPC.FSUIPCConnection.Process("Message")
        FSUIPC.FSUIPCConnection.DisconnectGroup("Message")
        Return 0
    End Function

Hope this helps. Look out for the update tomorrow.

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.