Hello,
I've a type that is declared within a class DriveControl ...
typedef unsigned short int word;
class DriveControl
{
public:
struct ControlWord2_bits
{
bool _00_Fixed_Frequency_Bit_1 : 1;
bool _01_Fixed_Frequency_Bit_2 : 1;
bool _02_Fixed_Frequency_Bit_3 : 1;
bool _03_Fixed_Frequency_Bit_4 : 1;
bool _04_Drive_Data_Set_Bit_0 : 1;
bool _05_Drive_Data_Set_Bit_1 : 1;
bool _06_Unused_Bit : 1;
bool _07_Unused_Bit : 1;
bool _08_PID_Enabled : 1;
bool _09_DC_Brake_Enabled : 1;
bool _10_Unused_Bit : 1;
bool _11_Droop_Enabled : 1;
bool _12_Torque_Control : 1;
bool _13_External_Fault : 1;
bool _14_Unused_Bit : 1;
bool _15_Command_Data_Set : 1;
};
union ControlWord2
{
ControlWord2_bits _Flags;
word _nNumeric;
};
....
};
... and I need a member variable of type ControlWord2 in one of my other classes, like so:
#include "DriveControl.h"
class PZDRequest
{
private:
DriveControl::ControlWord2 mv_secondControlWord;
...
};
But MS VC6.0 refuses to cooperate. It spits out the following errors:
error C2146: syntax error : missing ';' before identifier 'mv_secondControlWord'
error C2602: 'DriveControl::ControlWord2' is not a member of a base class of 'PZDRequest'
see declaration of 'PZDRequest'
error C2501: 'mv_secondControlWord' : missing storage-class or type specifiers
What the hell, what am I doing wrong???