MFC Custom Control in Extension DLL

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 = ::DefWindowProc;
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
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top