C to C++ migration for typedef struct
I have the following code that define the camera control feature in *.h . The code was written in C. However for my project, I use C++ (VS C++ 2005). The problem is when I force the VS to use C compiler, this code works fine. But when I use C++ compiler, I have the error from PCAM_FEATURE_CONTROL_STRUCT.
the compile error message is
// Camera control feature structure
int ControlOID; void (*ControlOnAuto)(PCAM_FEATURE_CONTROL_STRUCT , HWND , PFIREi_CAMERA_FEATURE_CONTROL_REGISTER);
void (*ControlOnOnePush)(PCAM_FEATURE_CONTROL_STRUCT , HWND , PFIREi_CAMERA_FEATURE_CONTROL_REGISTER);
} CAM_FEATURE_CONTROL_STRUCT, *PCAM_FEATURE_CONTROL_STRUCT;
It seems that the problem is about forward reference. Since PCAM_FEATURE_CONTROL_STRUCT is used before it is defined later.
c:\controler.h(82) : error C2061: syntax error : identifier
How can I modify this structure to work with C++ compiler? Thanks