I have a console application with SimConnect, this gives me the first
message loop / callback combination:
Within my application I create a window planned to serve as a child window in FSX.
Here I have a second message loop:
Since I hardly can have two loops, I see the following options:
Which is the right way to proceed? And hints, suggestions?
Updated: I can merge them both in the SimConnect loop, this works. But is the way to go?
message loop / callback combination:
Code:
while( 0 == quit ) {
SimConnect_CallDispatch(hSimConnect, MyDispatchProcMI, NULL);
Sleep(50);
}
Within my application I create a window planned to serve as a child window in FSX.
Here I have a second message loop:
Code:
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Since I hardly can have two loops, I see the following options:
- One loop runs in an independent thread, which is at least not possible for window message loops.
- The SimConnect handling goes in the Windows Message loop
- Vice versa, the DispatchMessage for the window goes in the SimConnect loop
Which is the right way to proceed? And hints, suggestions?
Updated: I can merge them both in the SimConnect loop, this works. But is the way to go?
Code:
MSG msg;
while (0 == quit) {
if (hSimWindowInclude && PeekMessage(&msg, hSimWindowInclude, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
SimConnect_CallDispatch(hSimConnect, MyDispatchProcMI, NULL);
Sleep(50);
}
Last edited:
