Plz help me - How to skin ActiveX controls
from
Stardock Forums
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:
control
Now I have created a simple ActiveX control that adds 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:
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?
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:
Code: c++
- 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;
- }
control
Now I have created a simple ActiveX control that adds 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:
Code: c++
- 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?