Runtime initialization of ActiveX Control

Hi,
 
I am facing some problem in working with activeX controls. The problem is the following.
 
I am writing control  (in VC 6.0) which i want to sell to other developers. The developer uses VB/VC and includes my control in his form. He sets the properties of the control and runs the form. I want to do some specialized processing in my control as the form is run. I want to keep it transparent to the developer. This processing should not happen at the design time.
 
I tried InitInstance() and the constructor of my control but both the functions are called at the design time, when you place the control in the form. Thus i cannot use them.
 
Daksh...
dkhattar112499Asked:
Who is Participating?
 
chensuConnect With a Mentor Commented:
You can call COleControl::AmbientUserMode to determine if the container is in user mode or design mode. But you need to place your initialization code into COleControl::OnCreate.
0
 
naveenkohliCommented:
If you are using ATL to construct the control, then you can do your initilalization in FinalConstruct function.
0
All Courses

From novice to tech pro — start learning today.