Storm
2004-06-29 14:23:22 UTC
Hello,
First I apologize if this is the wrong newsgroup, please redirect me
to the appropriate one if this is the case.
I have a Visual C++ 6.0 application that creates the main window
dynamically (it's not MFC, it uses standard Win32 calls).
I also have an OCX control that is used to skin an application (named
ActiveSkin).
My problem is that I have instructions on how to add this OCX control
if I have a main window inside the dialog editor, but main window is
created at runtime with CreateWindowEx.
One thing that I tought about was to create a dummy window in the
dialog editor and then have the previos main window be a child of this
one, but it feels wrong.
The right way would be if I could somehow init the ocx and attach it
to the main window after this one is dynamically created.
Any kind soul could help me on this ?
Thanks in advance,
Andrei
P.S. : here are the instructions that I have on how to install the ocx
control to a form :
===================== QUOTE =================================
To insert ActiveSkin's Skin control into the form, open the form in
dialog editor, right-click it and click "Insert ActiveX Control..."
menu item. Choose "ActiveSkin Control" from the available controls
list. Of course, AfxOleInit() and AfxEnableControlContainer()
functions should be called in InitInstance() method prior using any
OLE controls.
To access the control in runtime, import its type library first:
#import "actskin4.ocx" no_implementation raw_interfaces_only
raw_native_types
using ACTIVESKINLib;
Now you can query the Skin's control interface from the form:
CComQIPtr<ISkin> pSkin; // A smart pointer to the Skin component
pSkin = GetDlgItem(IDC_SKIN)->GetControlUnknown(); // Gets the ISkin
interface of the IDC_SKIN control
Now you can apply the skin, stored in resources, or load it from the
file and manipulate the skin in other ways.
Note: never use "Project->Add To Project->Components and Controls..."
menu item. The class wrappers created by this wizard can't be used
with ActiveSkin.
===================== END OF QUOTE ==============================
First I apologize if this is the wrong newsgroup, please redirect me
to the appropriate one if this is the case.
I have a Visual C++ 6.0 application that creates the main window
dynamically (it's not MFC, it uses standard Win32 calls).
I also have an OCX control that is used to skin an application (named
ActiveSkin).
My problem is that I have instructions on how to add this OCX control
if I have a main window inside the dialog editor, but main window is
created at runtime with CreateWindowEx.
One thing that I tought about was to create a dummy window in the
dialog editor and then have the previos main window be a child of this
one, but it feels wrong.
The right way would be if I could somehow init the ocx and attach it
to the main window after this one is dynamically created.
Any kind soul could help me on this ?
Thanks in advance,
Andrei
P.S. : here are the instructions that I have on how to install the ocx
control to a form :
===================== QUOTE =================================
To insert ActiveSkin's Skin control into the form, open the form in
dialog editor, right-click it and click "Insert ActiveX Control..."
menu item. Choose "ActiveSkin Control" from the available controls
list. Of course, AfxOleInit() and AfxEnableControlContainer()
functions should be called in InitInstance() method prior using any
OLE controls.
To access the control in runtime, import its type library first:
#import "actskin4.ocx" no_implementation raw_interfaces_only
raw_native_types
using ACTIVESKINLib;
Now you can query the Skin's control interface from the form:
CComQIPtr<ISkin> pSkin; // A smart pointer to the Skin component
pSkin = GetDlgItem(IDC_SKIN)->GetControlUnknown(); // Gets the ISkin
interface of the IDC_SKIN control
Now you can apply the skin, stored in resources, or load it from the
file and manipulate the skin in other ways.
Note: never use "Project->Add To Project->Components and Controls..."
menu item. The class wrappers created by this wizard can't be used
with ActiveSkin.
===================== END OF QUOTE ==============================