1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting past compiler error C3867

Discussion in 'SimConnect' started by Alphadog, 12/12/06.

  1. Alphadog

    Alphadog Guest

    Hello all. This is my first post. I hope you can help.

    I've just now taken the plunge into using Simconnect instead of doing any
    further development with the Panels and Gauges SDK.

    I'm also trying to mix things up a little and write my interface in OO C++
    rather than straight C.

    However, I've hit a roadblock when using Visual C++ 2005 Express Edition when trying to pass my callback function to SimConnect_CallDispatch.

    The error I get is on line 124 in the SimInterface.cpp file. This compiler
    gives me compiler error (error C3867) when I try to call my DispatchProc
    function. The full description of the error is:
    "Error C3867: 'CSimInterface::SimDispatchProc': function call missing argument list; use '&CSimInterface::SimDispatchProc' to create a pointer to member".

    So, I try to use an "&" in front of CSimInterface::SimDispatchProc and now
    receive the following error: "Error C2664: 'SimConnect_CallDispatch' :
    cannot convert parameter 2 from 'void (__stdcall
    CSimInterface::* )(SIMCONNECT_RECV *,DWORD,void *)' to 'DispatchProc'.
    There is no context in which this conversion is possible"


    Does anyone know how to solve this problem? I have attached my code.

    Attached Files:

  2. ronh

    ronh

    Joined:
    2/11/06
    Messages:
    343
    Country:
    canada
    I got your code to compile by adding static to the fuction dec in the .h file.

    static void CALLBACK SimDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContext);

    The main function has:

    SimConnect_CallDispatch(hSimConnect, CSimInterface::SimDispatchProc, NULL);

Share This Page