MattWise Posted July 24, 2006 Report Posted July 24, 2006 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?
Pete Dowson Posted July 24, 2006 Report Posted July 24, 2006 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
Paul Henty Posted July 24, 2006 Report Posted July 24, 2006 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
Paul Henty Posted July 25, 2006 Report Posted July 25, 2006 The new dll (1.1) is now on the sticky post near the top of the forum. Paul
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now