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 isCode:// Camera control feature structure typedef struct { int SliderID; int AutoCheckID; int OnePushButtonID; int MinValueID; int MaxValueID; int CurrentValueID; int InqOID; 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.Code:c:\controler.h(82) : error C2061: syntax error : identifier 'PCAM_FEATURE_CONTROL_STRUCT'
How can I modify this structure to work with C++ compiler? Thanks