Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I am trying to show up a multiline message FS window (something similiar to the loading scenery window and such. I know that it is possible as I think I saw that on maybe FSNet)

I tried to build a text write function in VB as follows:

Function WriteText(ttext As String, tTitle As String)
    Dim dwResult As Long
    Dim writetxt As String
    Dim titleTmp As String
    writetxt = Left(ttext, 127)
    writetxt = writetxt & vbNullChar
    titleTmp = Left(tTitle, 32)
    titleTmp = titleTmp & vbNullChar
    Call FSUIPC_WriteS(&H6D60, Len(titleTmp), tTitle, dwResult)
    Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    Call FSUIPC_Process(dwResult)
End Function

But this does not work.

Any guideness please?

Thanks in advance.

Posted
    Call FSUIPC_WriteS(&H6D60, Len(titleTmp), tTitle, dwResult)
    Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    Call FSUIPC_Process(dwResult)

But this does not work.

Ahem. Did you check the documentation at all? Writing to 3380 just provides the text to be displayed. The activation is by what you write into 32FA. It does say this quite clearly if you look up 3380, and the options and values you can provide are detailed against offset 32FA, though some of those don't apply to the multiline window.

Regards

Pete

Posted

So, I didn't understood that well from the documentation that even if I want a multiline window I need that offset as I thought 6D60 (The window's title) is instead of the 32FA.

But, even when I do the follows:

Function WriteText(ttext As String, tTitle As String)
    Dim dwResult As Long
    Dim writetxt As String
    Dim titleTmp As String
    writetxt = Left(ttext, 127)
    writetxt = writetxt & vbNullChar
    'Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    'Call FSUIPC_Write(&H3302, 2, VarPtr(0), dwResult)
    titleTmp = Left(tTitle, 32)
    titleTmp = titleTmp & vbNullChar
    Call FSUIPC_WriteS(&H6D60, Len(titleTmp), tTitle, dwResult)
    Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    Call FSUIPC_Write(&H32FA, 2, VarPtr(1), dwResult)
    Call FSUIPC_Process(dwResult)
End Function

I get a normal text message instead of a pop-up window.

Thanks.

Posted
So, I didn't understood that well from the documentation that even if I want a multiline window I need that offset as I thought 6D60 (The window's title) is instead of the 32FA.

No, that cannot be. For several reasons:

1) The title is written before the text, so if that activated it the window would be empty!

2) Only one title for the wole session is used, because once the window is created it stays created no matter what. FSUIPC doesn't support multiple such windows, only the one, so the first title sent wins. I'm pretty sure it says that too. You only write the title once, on initialisation, and hope you are the first such application.

It most certainly says you need to write 32FA to activate it.

    'Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    'Call FSUIPC_Write(&H3302, 2, VarPtr(0), dwResult)

Why is there a write to the read-only location 3302 there?

Call FSUIPC_Write(&H32FA, 2, VarPtr(1), dwResult)

I don't know what "VarPtr(1)" does. Is it a pointer to an integer 1? If so the display is only for 1 second maximum. Is that what you want?

I get a normal text message instead of a pop-up window.

Not sure what you mean -- they are both pop up windows with text messages in them. Just a different place and, normally, a different shape. but both can be undocked and re-shaped and so on.

Have you enabled the multiline message window on the first page of the FSUIPC options?

Is there more than one line of text in your message? Even if you only want one line you need a New Line or Return character in there as the whole point is to filter single lines to the standard message window, allowing only multiline messages to the multiline message window.

Regards

Pete

Posted

Oh ! thanks Pete, my problem was that I didnt knew that a multiline text is a condition for this and because of that I only wrote something for testing.

    'Call FSUIPC_WriteS(&H3380, Len(writetxt), writetxt, dwResult)
    'Call FSUIPC_Write(&H3302, 2, VarPtr(0), dwResult)

Why is there a write to the read-only location 3302 there?

In VB " ' " means a remark equals to // in C I think.

I don't know what "VarPtr(1)" does. Is it a pointer to an integer 1

Exectly.

About the seconds the message appears, Im aware of what I have done, It was as well - Only for testing.

How can I set the location of the window opened? I just want it to be cented in the screen

And another issue:

I have tried writting this, after setting the title of the window so as I understood from the documentions writting 0 to will turn the text white with no luck..

Call FSUIPC_Write(&H3302, 2, VarPtr(0), dwResult)

Thanks again!

Posted

How can I set the location of the window opened? I just want it to be cented in the screen

Same as with all FS windows -- drag it, size it, dock it, undock it, do what you like with it. When you save a Flight it is saved as well. It is an FS window, it isn't mine.

I have tried writting this, after setting the title of the window so as I understood from the documentions writting 0 to will turn the text white with no luck..
Call FSUIPC_Write(&H3302, 2, VarPtr(0), dwResult)

As I said before, and as documented, 3302 is set by user options, not by IPC writes -- the documentation explicitly says it is read-only. It is for user's to decide what they can read best.

The white messages user option doesn't appear to work in FSX at present, by the way.

Pete

Posted
As I said before, and as documented, 3302 is set by user options, not by IPC writes -- the documentation explicitly says it is read-only. It is for user's to decide what they can read best.

Where execly can a user set that?

Thank you Pete!

Posted
As I said before, and as documented, 3302 is set by user options, not by IPC writes -- the documentation explicitly says it is read-only. It is for user's to decide what they can read best.

Where execly can a user set that?

Thank you Pete!

Registered users, in the 'miscellaneous' options; non-registered have to edit a parameter in the INI file.

Please do check the FSUIPC user guide some time. It describes the user facilities including this one.

Regards

Pete

Posted
As I said before, and as documented, 3302 is set by user options, not by IPC writes -- the documentation explicitly says it is read-only. It is for user's to decide what they can read best.

Where execly can a user set that?

Thank you Pete!

Registered users, in the 'miscellaneous' options; non-registered have to edit a parameter in the INI file.

Please do check the FSUIPC user guide some time. It describes the user facilities including this one.

Regards

Pete

Thank you very much for your help!

Omer.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.