tags:

views:

147

answers:

1

So this is the case, I am using the http://www.codeplex.com/C4FDevKit, I want to use the PreviewHandlerHost control in my desktop application I successfully been able to do it and test it on XP 32, 64 bits and Vista 32, 64 bits

the issue only appeared on XP x64, This is the exception message

Unable to cast COM object of type 'System.__________ComObject' interface type 'MyApplication.IPreviewHandler'. This failed because the QueryInterface call on the COM component for the interface with IID '{8895B1C6-B41F-4C1C-A562-0D564250836F}' failed due to the following error: class not registered (Exception from HRESULT: 0x80040154 (REGDB_______E___CLASSNOTREG)).

Please any help is appreciated. And the file I was trying to preview was a Microsoft Word Document.

+2  A: 

Go into the Project Properties for your desktop application, click the "Compile" tab and click "Advanced Compile Options...". Change "Target CPU" to x86, click OK, save, recompile and try again.

I've just hit this one myself - see COMException "Class not registered" on 64-bit Windows for more info.

Theo Gray
Thanks it worked
Amr Elsehemy