Jump to content
The simFlight Network Forums

efratomer

Members
  • Posts

    76
  • Joined

  • Last visited

Posts posted by efratomer

  1. 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!

  2. 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.

  3. 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.

  4. The offset "Engine stops when out of fuel (<= FS2000 only)" (Addr. 033C)

    as I understand - support FS2000 and down only.

    Is there any other offset that I may use to read and write that same data?

    No, sorry. It was never easily accessible, and I'm not going to start hacking into FS2004 now.

    Regards

    Pete

    Ok thanks.

    Anyway the first issue just came back at me. I noticed it only appears when the flight simulator is not already open.

    My program after a few steps open the flight simulator by her self by using the Shell command:

    "D:\flight simulator 9\fs9.exe" /flt: d:\aitflight.flt

    I tried using the same Shell command using the Run input line in the Start menu and there were no problems. Meaning it does something to do with my program after all.

    Pete, You said earlier something about preventing access the fonts, my program uses simply the Arial font.

    Thanks in advance.

    Omer.

  5. I dont belive its somthing in my code that has to do with it

    If it only happens when you run your program, how could it be anything else?

    If you are writing stuff to FSUIPC and want me to check any of it, enable IPC write logging and show me the log. Then maybe try a binary-chop search on your program -- i.e. eliminate half the things it does and narrow it down that way.

    Regards

    Pete

    The problem doesn't occur anymore as I replaced the FLT file that my program loads, so it's probebly something in the FLT file.

    Thanks.

    Another issue:

    The offset "Engine stops when out of fuel (<= FS2000 only)" (Addr. 033C)

    as I understand - support FS2000 and down only.

    Is there any other offset that I may use to read and write that same data?

    Thanks!

  6. If I doesn't even see a red background behind where the text suppose to appear, is it still can be connected to the fonts?

    What red background? The text appears in red over whatever's there.

    I'm sorry, I really have no idea how your program is doing this. What does it do? Is is related to FS or not? Why are you running it with FS? If it is using FSUIPC and writing to unknown parts of FS it could do any sorts of damage.

    Perhaps you should say more about your program which is causing this? All you've told me so far is "I built a program and while its running all the red text bars (like: Pause text, Parking brakes, SHIFT + Z bar, Sounds off etc) just doesn't show. ". Don't you think you ought to start dissecting your program to see what it is your are doing to cause this to happen? Maybe it is doing something you didn't intend?

    Pete

    Hey,

    Pete, for your question, yes my program is related to FS and does communicate with FS with FSUIPC, I didnt thought that it worth to be mentioned as I do write in FS Modules forum...

    I dont belive its somthing in my code that has to do with it, anyway while im waiting for an answer here I simultaneously examine my code of course. I just thought it will be more simple than that.

    Thanks again!

    Omer.

  7. I have no idea rather it connects to FSUIPC or not but I built a program and while its running all the red text bars (like: Pause text, Parking brakes, SHIFT + Z bar, Sounds off etc) just doesn't show.

    Sorry, no idea. FSUIPC wouldn't know how to stop those, but there are parameters in your FS CFG file to stop them. Otherwise it sounds likely that you are somehow preventing access to the fonts used.

    Pete

    If I doesn't even see a red background behind where the text suppose to appear, is it still can be connected to the fonts?

    If yes, any idea how I could make it without meaning? :?

  8. I have no idea rather it connects to FSUIPC or not but I built a program and while its running all the red text bars (like: Pause text, Parking brakes, SHIFT + Z bar, Sounds off etc) just doesn't show.

    Sorry, no idea. FSUIPC wouldn't know how to stop those, but there are parameters in your FS CFG file to stop them. Otherwise it sounds likely that you are somehow preventing access to the fonts used.

    Pete

    Hey Pete,

    Thanks for the response, Any idea what the parameters in the CFG file are called?

    thanks.

  9. I have tried forcing my program to be a child window of FS2004 but evrything I tried only made it a child and while the form is flickering, How can I stop it from flickering?

    I could only do it by intercepting the main FS window WM_PAINT calls and dealing with them myself to stop FS painting over my Window which then redrew (hence the flicker).

    Do you have any idea how is it done using API functions?

  10. Hello,

    I am trying to make something like an ATC viewing which will be connected to the pilots's FS via FSUIPC. Therfore, I want to display the traffic on the program's form and I need for somehow to draw the traffic to a X and Y coordinates from the normal ones in FS...

    Anyway,

    I need to get distance and angel from 2 coordinate, distance I have already managed to return, I have problem only with the angel.

    Just to be sure... Im talking about those coordinates: N028.41.07.001 E034.03.45.000

    Thanks in advance!

    Omer.

  11. The best starting point is at MS MSDN: http://msdn.microsoft.com

    This is the online bible for windows APIs and all MS related products. You have to look for the API function 'SetParent', but it might be that you have to set different window styles/properties for you window via 'SetWindowLongA'.

    The VB declaration are:

    Public Declare Function GetParent Lib "user32" _

    (ByVal hwnd As Long) As Long

    Public Declare Function SetParent Lib "user32" _

    (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

    Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _

    (ByVal hwnd As Long, ByVal nIndex As Long) As Long

    Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _

    (ByVal hwnd As Long, ByVal nIndex As Long, _

    ByVal dwNewLong As Long) As Long

    You can try google to find some VB related articles about those API functions.

    Hope this helps

    Thomas

    I did found those functions but when I tried making my VB as a child window into FS my FS at least got stuck. what frame's hWnd I should select for it?

    Hi,

    Probably, you can find something here: Jose Oliveira has written some interesting applications (even Pete has made one available at his download pages, http://www.schiratti.com) and you can download some of his sources here:

    http://jcboliveira.flysplash.org/

    Regards,

    Hugo

    I tried looking for a program that I can learn from, I have read the program's descriptions and thought the FSUIPCRun Options program will do it.

    But I checked that program and what it does is executing another program which you select after the FS flight have started, But not in the FS Frame.

    Thanks in advance,

    Omer.

×
×
  • 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.