Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi

i want to know how we can write module for FS, i know some C/C++ but i don't know how to get info from FS in program. and what i must write in my program to work

please help me to write a module for reading data from FS

tell me where to start and what should i write in my program

thank you

efratomer:

i don't know VB6 but i'm sure there is way to do what you want you can have C/C++ code and then make it DLL to use in VB

in .NET framework it's so simple and in other version it's possible with COM i think, i think it's the way you can use C/C++ in VB

  • 2 weeks later...
Posted

That is of course possible. One possible solution would be to use window messages to communicate with the VB program (there are of course many other ways...). But why do you need that FS module then? Are you missing something in FSUIPC that requires a module?

Thomas

Posted

I would like a FS Module because I have built a VB program which comunicates with FSUIPC

and I find it more comftarble to users who uses my program to use it without minize the FS each time.

Posted

But you don't need a module then. You have to modify the parent window of your main VB window, so it uses the FS main window as its parent and is displayed infront of FS. But this does not work very well with all VGA cards out there. So you need to be careful with this.

Thomas

Posted
But you don't need a module then. You have to modify the parent window of your main VB window, so it uses the FS main window as its parent and is displayed infront of FS. But this does not work very well with all VGA cards out there. So you need to be careful with this.

Thomas

I didn't know this option,

how do I do it execly? or if you can tell me where I can learn about it.

Thanks in advance,

Omer.

Posted

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

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

Posted

What you need is the FS main window hwnd. This can be done by searching for the windclass name 'FS98MAIN' (via API 'FindWindowEx'). I am now away for three weeks, so maybe someone else can continue to assist you. ;)

Thomas

  • 2 weeks later...
Posted

Well, on other windows, it works great, but somewhy when I try it on the simulator main screen it appers and it looks like the simulator window cover it, so you can't see it anymore..

Anyone?

Thanks in advance,

Omer.

  • 3 weeks later...
Posted
Well, on other windows, it works great, but somewhy when I try it on the simulator main screen it appers and it looks like the simulator window cover it, so you can't see it anymore...

Yes, it is almost impossible. Try running FS in Windowed mode instead, you can make it work then. Otherwise you have to keep trying all sorts of horrible repainting tricks involving intercepting loads of messages. It really sucks and gets extremely convoluted. Ugh. It worked with FS2002 (but even then it was messy). The problem with FS2004 is the new way the DirectX does the graphics. I once asked some FS team guys how to get around it and they pretty much said "don't, it isn't possible"duh! :-(

Pete

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.