C
Caronte
Hi all,
I have a problem using Custom control class inside a DLL Extension.
My Custom control use Class property to specify the register class name
for the control.
Both Dialog Class and Custom control class are inside the dll.
When i run the application i can't view the dialog and Vc++ display an
error on ShowWindow procedure.
If I use the class control and dilog outside the dll all go well but NOT
inside the dll.
I think that the problem is on registering control class that register
it on executable proc and not on the dll one.
Any idea?
Here is my resgister control class procedure.
WNDCLASS wndcls;
HINSTANCE hInst = AfxGetInstanceHandle();
if (!
:GetClassInfo(hInst, BUTTONSBOX_CLASSNAME, &wndcls)))
{
// otherwise we need to register a new class
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndcls.lpfnWndProc = :
efWindowProc;
wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
wndcls.hInstance = hInst;
wndcls.hIcon = NULL;
wndcls.hCursor =
AfxGetApp()->LoadStandardCursor(IDC_ARROW);
wndcls.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = BUTTONSBOX_CLASSNAME;
if (!AfxRegisterClass(&wndcls))
{
AfxThrowResourceException();
return false;
}
}
I hope that someone can help me.
Thanks in advice
I have a problem using Custom control class inside a DLL Extension.
My Custom control use Class property to specify the register class name
for the control.
Both Dialog Class and Custom control class are inside the dll.
When i run the application i can't view the dialog and Vc++ display an
error on ShowWindow procedure.
If I use the class control and dilog outside the dll all go well but NOT
inside the dll.
I think that the problem is on registering control class that register
it on executable proc and not on the dll one.
Any idea?
Here is my resgister control class procedure.
WNDCLASS wndcls;
HINSTANCE hInst = AfxGetInstanceHandle();
if (!
{
// otherwise we need to register a new class
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndcls.lpfnWndProc = :
wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
wndcls.hInstance = hInst;
wndcls.hIcon = NULL;
wndcls.hCursor =
AfxGetApp()->LoadStandardCursor(IDC_ARROW);
wndcls.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = BUTTONSBOX_CLASSNAME;
if (!AfxRegisterClass(&wndcls))
{
AfxThrowResourceException();
return false;
}
}
I hope that someone can help me.
Thanks in advice