OCX on IE File-> New -> Window Problem
-
I just create the text ocx( called testocx.ocx) to load some object. and load into IE. here is the source for html. when i click button button it will show message said "OK" but when I new window (in IE File->New-> Window), "Error, cannot get dispatch object" message will be shown. We have the same problem for our company core program. I put the OCX source(AddObj method) for refrence. maybe someone can point what is problem. OCX source******************************* BOOL CTestocxCtrl::AddObj(LPDISPATCH inserObj) { CInsertObj * CCmdTarget pObj = ( CInsertObj *)CCmdTarget::FromIDispatch( inserObj); if (!pObj){ AfxMessageBox("Error, cannot get dispatch object"); } else{ AfxMessageBox("OK"); } return TRUE; } test.html********************************* <!-- function button1_onclick() { var obj = new ActiveXObject("testocx.InsertObj"); DTestocx1.AddObj(obj); } //-->