December 8, 201411 yr 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
December 8, 201411 yr 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
December 8, 201411 yr 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