How to open a PDF in VS2005
-
Hi, I am developing a Windows application using C# 3.0, in that I have to open a pdf document. Using the Adobe PDF Reader com component I am able to open the PDF document, then deployed the application and created the setup. When I install the application in Win XP it's working fine, but when I install the same in Windows 7 or Vista, Adobe PDF Reader com component is throwing error as "Com Class not registered". Even thought I run that exe file as "Run as Administrator", it's throwing the same error. Any one guide me how to solve this, how to make my application to work in all Windows OS? Please suggest me. Thanks in Advance
Know is Drop, Unknown is Ocean
-
Hi, I am developing a Windows application using C# 3.0, in that I have to open a pdf document. Using the Adobe PDF Reader com component I am able to open the PDF document, then deployed the application and created the setup. When I install the application in Win XP it's working fine, but when I install the same in Windows 7 or Vista, Adobe PDF Reader com component is throwing error as "Com Class not registered". Even thought I run that exe file as "Run as Administrator", it's throwing the same error. Any one guide me how to solve this, how to make my application to work in all Windows OS? Please suggest me. Thanks in Advance
Know is Drop, Unknown is Ocean
Do you get that error on both 32bit and 64bit versions of Win7/Vista, or on 64bit versions only? In the latter case, you could change the target of your application to x86.
-
Do you get that error on both 32bit and 64bit versions of Win7/Vista, or on 64bit versions only? In the latter case, you could change the target of your application to x86.
Thanks for your response. I am getting this error message in 64bit OS. Also while deploying my application I tried by setting the Target Platform as x86, but still it's throwing the same error.
Know is Drop, Unknown is Ocean
-
Thanks for your response. I am getting this error message in 64bit OS. Also while deploying my application I tried by setting the Target Platform as x86, but still it's throwing the same error.
Know is Drop, Unknown is Ocean
I suspect you're hitting an issue where there's a 32 bit version of the COM component registered, but not an appropriate 64 bit compatible version. One way round this, if you don't care about your application using 64 bit features (i.e. memory), is to use corflags.exe to set the CorFlags section in the PE executable. The command you need is
corflags exefilename.exe /32bit+
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Thanks for your response. I am getting this error message in 64bit OS. Also while deploying my application I tried by setting the Target Platform as x86, but still it's throwing the same error.
Know is Drop, Unknown is Ocean
How do you create that COM class? Is the registry path hard coded in full length? How did you create the reference to the component ("COM" from the "add reference" dialog, or a PIA)? Perhaps show a few lines of code leading to the line with the error.