- 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.
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.