visual c++ - "Fails to create Object" for ActiveX control in VC++ 6.0 -
below method being executed multiple time single object creation, , fails create activex control object. value of hresult shows hresult = -2,147,467,262
stdapi dllgetclassobject(refclsid rclsid, refiid riid, lpvoid* ppv) { hresult hres = _module.getclassobject(rclsid, riid, ppv); return hres; }
the same method being executed once activex control , object created : hresult = 0;
any probable reasons failure create object.
an activex control has persistent state, case control, must implement either ipersiststream or ipersiststreaminit. adding line "com_interface_entry(ipersiststreaminit)", under
"begin_com_map(mycontrol)-------- end_com_map()"
solved issue.
Comments
Post a Comment