Question Let the orbiter2016 be displayed as part of the software window you designed during the simulation process

xjflcf520

Member
Joined
Feb 26, 2021
Messages
70
Reaction score
6
Points
23
Location
Chana
I want to use MFC to design a software. After opening this, a window will be displayed. Part of the window is the simulated screen display after orbiter2016 starts the scene file. How can I achieve this?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,875
Reaction score
2,129
Points
203
Location
between the planets
I'm not sure I understand... I assume you're talking about Microsoft Foundation Classes, which seems to be a UI library. So there's two possible interpretations of your post, which needs some clarification.

Are you trying to...
a) Display an MFC window within the orbiter simulation, or
b) Rendering orbiter inside an MFC window?

I've done things similar to a (rendering an irrlicht scene to an orbiter surface handle), so I think that shouldbe possible with MFC, but nothing like b. I don't think b would work, unless MFC has very specific support to render a completely decoupled process in one of its windows. Since until 5 minutes ago I didn't even know what MFC was, I really can't make any guesses about that.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
I want to use MFC to design a software. After opening this, a window will be displayed. Part of the window is the simulated screen display after orbiter2016 starts the scene file. How can I achieve this?

In your MFC application, you could try to find the main window handle of the Orbiter process, then use SetParent() to put it inside you application's window. I'm not sure if it works with D3D9Client, but it should for standard Orbiter.
It would be a hack, though. It would mean that you have to be careful with all window messaging passing into that window, as well as with operations that resize the parent window.

Why do you want this? Can you elaborate a bit on the goal you are pursuing with all of this? I hope it is not to simply exchange the frame and pass it along as "My Space Sim" or somesuch.
 

xjflcf520

Member
Joined
Feb 26, 2021
Messages
70
Reaction score
6
Points
23
Location
Chana
In your MFC application, you could try to find the main window handle of the Orbiter process, then use SetParent() to put it inside you application's window. I'm not sure if it works with D3D9Client, but it should for standard Orbiter.
It would be a hack, though. It would mean that you have to be careful with all window messaging passing into that window, as well as with operations that resize the parent window.

Why do you want this? Can you elaborate a bit on the goal you are pursuing with all of this? I hope it is not to simply exchange the frame and pass it along as "My Space Sim" or somesuch.
I want to make a system in which I can select some flight tasks, and then enable orbiter to visualize the flight tasks, and the orbiter always exists in the area of the system interface I made during the flight simulation process
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
What's the problem with 2 windows? As I wrote, it would need a hack to do this embedding, and I don't see the advantage of having it this way in relation to the goal you sketched up.
 
Top