Expression must have class type error
Jul 28, 2011 at 10:23pm UTC
So, I'm new to Windows programming, but have a base of Console C programming, VBScripting for web and simple Micro-controller C++ programming (PIC 18f series). I've got a Dialog Box that takes an array of a class in via it's call, modifies the array and sends it back out the call.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
class NetCueClass
{
public :
char id[3];
char description[50];
};
BOOL CALLBACK ConfigDlgProc(TCHAR ConfigFile[MAX_PATH], NetCueClass* NetCue[2][8], short *direction[2]) //truncated here for readability
{
switch (Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
{
int x,y; //counters
ofstream configfile(ConfigFile);
for (x = 0; x<2; x++)
{
cout << direction[x] << endl;
for (y = 0; y<8; y++)
cout << NetCue[x][y].id << endl << NetCue[x][y].description << endl;
}
configfile.close();
EndDialog(hwnd, IDOK);
break ;
}
case IDAPPLY:
//save file
break ;
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
}
default : return FALSE;
}
return TRUE;
}
The Error is on Line 26. It shows in VS as underlined and the hover says
NetCueClass *(*NetCue)[8]
Error: expression must have class type
Thoughts?
I know I'm not modifying NetCue in this excerpt, but if I can't read via what I've given, then I definitely won't be able to write to the variable.
Topic archived. No new replies allowed.