Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with an MFC Simconnect app

Featured Replies

Hi,

 

I've made a basic MFC app and hooked up SimConnect.  I used Simconnect_Open, giving it an HWND and user eventId and my event function is getting messages.  I just need to know how to get the simconnect message and data from the wParam and lParam.  Can someone help?  My function is below...

 

Gregg

BEGIN_MESSAGE_MAP(CTestMFCDlg, CDialogEx)
    ON_WM_SYSCOMMAND()
    ON_WM_PAINT()
    ON_WM_TIMER()
    ON_WM_QUERYDRAGICON()
    ON_BN_CLICKED(IDC_APPLY, &CTestMFCDlg::OnBnClickedApply)
    ON_MESSAGE(WM_USER_SIMCONNECT, &CTestMFCDlg::OnSimMsg)
END_MESSAGE_MAP()

LRESULT CTestMFCDlg::OnSimMsg(WPARAM wParam, LPARAM lParam) {
	CString msg;
	msg.Format(_T("Sim Msg: %d"), lParam);
	Log(msg);
        return 0;
}

Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i9 64GB RAM, GTX-5090

  • Author

Welp, I think I sorted that part out.  I now have a functioning Dispatch proc.  Another issue, though...

 

I have a line in my code which is from the examples...

 

        hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_SIM_START, "SimStart");

 

First thing, I haven't found any evidence of what "SimStart" is.  Second thing, if the sim is already running, I don't get that event...however, I do get a SIMCONNECT_RECV_ID_OPEN event which I'm not handling. Do I need to handle SIMCONNECT_RECV_ID_OPEN as well...basically, with the same logic I'm using for SimStart? 

 

Gregg

Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i9 64GB RAM, GTX-5090

  • Author

Clearly, talking to myself here.  Anyway, found the reason why "SimStart" isn't called when the sim is already running.  Still, begs the question as to how to handle the situation when it's already running and my app starts. 

 

Gregg

Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i9 64GB RAM, GTX-5090

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.