Can not register window class, pls help!

Joined
Jul 11, 2006
Messages
1
Reaction score
0
Dear all,
I'm using BorlandC 5.5 on Window 2000. I have defined a class as following:

class FormFormulaInput
{
private:
WNDCLASSEX wndcls;
HWND hwnd;
int bError;

public:
FormFormulaInput();

void initForm(HINSTANCE hInstance, HWND hwndParent, PVOID frmFormulaInputProc);
HWND GetHandler();
void Show();
void Hide();
};

method initForm defined as following:

void FormFormulaInput::initForm(HINSTANCE hInstance, HWND hwndParent, PVOID frmFormulaInputProc)
{
//initialize window class structure
wndcls.cbSize = sizeof(WNDCLASSEX);
wndcls.style = CS_HREDRAW|CS_VREDRAW;
wndcls.hInstance = hInstance;
wndcls.lpfnWndProc = (WNDPROC)frmFormulaInputProc;
wndcls.hIcon = LoadIcon(hInstance,(LPSTR)IDI_APPLICATION);
wndcls.hIconSm = LoadIcon(hInstance,(LPSTR)IDI_APPLICATION);
wndcls.hCursor = LoadCursor(NULL, IDC_ARROW);
wndcls.lpszClassName = "frmformulainput";
wndcls.lpszMenuName = 0;//NULL;
wndcls.cbClsExtra = 0;
wndcls.cbWndExtra = 0;
wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

if(!RegisterClassEx(&wndcls))//check if fail on register window class
{
MessageBox(NULL,"Can not register class FormFormulaInput","Vision Shape - Error",MB_OK);
bError = 1;
}
else
{

hwnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,
"frmformulainput",
"Input form for formula", //window name
WS_OVERLAPPEDWINDOW|WS_CHILD,
CW_USEDEFAULT,
0,
CW_USEDEFAULT,
0,
NULL,//hwndParent, //parent window
NULL, //menu
hInstance,
NULL);
if(!hwnd)
{
MessageBox(NULL,"Can not create form FormFormulaInput","Vision Shape - Error",MB_OK);
bError = 1;
}//end if
}
}//end iniForm

I alway get the message "Can not register class FormFormulaInput" when I call method initForm for an instance of FormFormulaInput class. Somethings wrong? please help...thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top