Plz help me - How to skin ActiveX controls

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:

Code: c++
  1. int CSimpleAdditionAtxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
  2. {
  3. if (COleControl::OnCreate(lpCreateStruct) == -1)
  4. return -1;
  5. .....
  6. .....
  7. .....
  8. if (!w.Create("", 0, CRect(0, 0, 0, 0), this, 0, NULL, FALSE, 0))
  9. {
  10. AfxMessageBox(_T("Failed to load WindowBlinds skinning OCX"));
  11. return FALSE;
  12. }
  13. w.SetRootPathStr(_T("D:\\Skins"));
  14. w.LoadUIS (_T("dogmax\\dogmax.uis"));
  15. w.InitWB();
  16. w.DoWindow((long)m_hWnd);
  17. return 0;
  18. }


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++
  1. int CSimpleAdditionAtxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
  2. {
  3. if (COleControl::OnCreate(lpCreateStruct) == -1)
  4. return -1;
  5. .....
  6. .....
  7. .....
  8. if (!w.Create("", 0, CRect(0, 0, 0, 0), this, 0, NULL, FALSE, 0))
  9. {
  10. AfxMessageBox(_T("Failed to load WindowBlinds skinning OCX"));
  11. return FALSE;
  12. }
  13. w.SetRootPathStr(_T("D:\\Skins"));
  14. w.LoadUIS (_T("dogmax\\dogmax.uis"));
  15. w.InitWB();
  16. w.DoWindow((long)m_hWnd);
  17. return 0;
  18. }


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?
1,430 views 1 replies
Reply #1 Top
You might want to email [email protected] for support