Plz help me - How to skin ActiveX controls using Directskin?

Hi,

I was able to create simple MFC applications (Dialog based & SDI) and add skinning ability to them using DirectSkin (WindowBlinds). I have added skinning code to OnCreate function as below:


int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
.....
.....
.....
if (!w.Create("", 0, CRect(0, 0, 0, 0), this, 0, NULL, FALSE, 0))
{
AfxMessageBox(_T("Failed to load WindowBlinds skinning OCX"));
return FALSE;
}
w.SetRootPathStr(_T("D:\\Skins"));
w.LoadUIS (_T("dogmax\\dogmax.uis"));
w.InitWB();
w.DoWindow((long)m_hWnd);
return 0;
}





Now I have created a simple ActiveX control which can add two numbers & has ability to launch a dialog. When I tried to add skinning code the project fails. The code where I tried to ad skinning is below:


int CSimpleAdditionAtxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
.....
.....
.....
if (!w.Create("", 0, CRect(0, 0, 0, 0), this, 0, NULL, FALSE, 0))
{
AfxMessageBox(_T("Failed to load WindowBlinds skinning OCX"));
return FALSE;
}
w.SetRootPathStr(_T("D:\\Skins"));
w.LoadUIS (_T("dogmax\\dogmax.uis"));
w.InitWB();
w.DoWindow((long)m_hWnd);
return 0;
}


The debugger displays foll statements & raises Unhandeled Exception:
Warning: AfxEnableControlContainer has not been called yet.
>>> You should call it in your app's InitInstance function.





I'm not sure where n how call "AfxEnableControlContainer". So anyone can help me in this regard to solve the problem.

Or anyone know how to add skinning for OCX controls?
2,007 views 3 replies
Reply #1 Top
Reply #3 Top
Actually, ff you have a technical question, please contact [email protected].