Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

error code 0x80040200

$
0
0

I have a legacy MFC C++ application that was compiled on XP with Visual Studio 9 on XP.

The application works on XP and has an installation package.

When I install it on Windows 7 everything works except one OCX designed to provide someDCOM capabilities - it fails with an error message indicating that there is an invalid class string. This does not happen on XP.

Having seen this error before I tried to register the OCX in question and that did indeed fail with the error message "xxx.OCX" was loaded but the call to DllRegisterServer failed with error code 0x80040200

The installation package did not report any errors and when I tried to register the OCX manually I was logged on as the administrator.

As the Windows 7 PC is not a development machine I have little debugging capabilities on it and I would not know how to set about debugging the regsvr32failure anyway, but if I run code that utilizes the OCX in question I see that the OCX is instantiated and only fails when it attempts to connect with my main application using something like:

pOe = new COleException;

m_IMyInterface.CreateDispatch(_T("MyApp.Document"), pOe);

The MyApp.Document application seems to be fine and updates the registry forMyApp.Documentso that it should be available for creation by CreateDispatch and although this works on XP it fails on Windows 7 – however I do not see why that should cause the OCX to fail to register.

Although the ocx fails to register it seems to be available as an ocx because it instantiates and only fails when attempting to create an instance of the main application.

All applications dll etc. reside on the same PC.

Any thoughts on how best to tackle this?

Thank you.

 


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>