Using: VS2008, Win32, C/C++
I'm trying to encapsulate my entire dialog window into a class for reusability. Sort of like a custom control. In doing this, I am moving my seperate functions into a class. The following struct design though is giving me problems, with Visual Studio outputting: error C2334 '{'.
It's a simple message map layout. But I can't seem to escape this C2334 error. :(
Here is my class code snippet.
class CScrollingListDlg
{
private:
LRESULT DoCommandMain (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoPaintMain (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoAnimationTimer (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoHandleTouch (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoDestroyMain (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
//
// message maps
//
// Generic defines and data types.
struct decodeUINT {
UINT Code;
LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};
struct decodeCMD {
UINT Code;
LRESULT (*Fxn)(HWND, WORD, HWND, WORD);
};
// WM_Message dispatch table for MainWndProc.
//
// *** error C2334 '{' ***
//
const struct decodeUINT MainMessages[] = {
WM_PAINT, DoPaintMain,
WM_DESTROY, DoDestroyMain,
WM_QUIT, DoDestroyMain,
WM_COMMAND, DoCommandMain,
};
};
What am I missing here?
Thanks.