Sign in to follow this  

Help with an MFC Simconnect app

Recommended Posts



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



    ON_BN_CLICKED(IDC_APPLY, &CTestMFCDlg::OnBnClickedApply)

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

Share this post

Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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? 



Share this post

Link to post
Share on other sites

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. 



Share this post

Link to post
Share on other sites

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
Sign in to follow this