IWE 11 Activex Control Initialization

  • Thread starter Thread starter KennethK
  • Start date Start date
K

KennethK

Guest
I have an ATL project that contains 2 UI controls a several object for use in a web page through JavaScript. My problem is in initializing the child windows which require a valid parent window handle. Using the MFC Test Container project, supplied in the samples, the WM_CREATE message is sent and I initialize the control and it child windows. However when I place the control on a web page through JavaScript using this code:

var viewdiv = document.createElement('div');
viewdiv.id = "docviewdiv";
viewdiv.className = "docview";
document.body.appendChild(viewdiv);
var oView = document.createElement("object");
oView.id = "oDocView";
oView.style.display = "block";
oView.style.position = "fixed";
oView.style.top = "0";
oView.style.left = "0";
oView.style.width = "100%";
oView.style.height = "100%";
oView.style.visibility = "visible";
oView.classid = "clsid:9CC028E5-0AD9-42EF-BECA-8857816ACDCE";



The control has a Show method which is called immediately after the controls creation. When I debug the control I find that that when the Show method is called, the control is not yet fully initialized. The WM_CREATE message is not sent before the Show method is called. My guess is that as an Activex container, IE 11 initializes Activex controls differently than the MFC Test Container. Where would be the proper place to place initialization code for controls used in JavaScript.


Kenney

Continue reading...
 
Back
Top