I\'m receiving the following error on a Windows XP Pro SP2 x64 machine running IIS6:
System.Runtime.InteropServices.COMException:
Retrieving the COM class f
Make sure that your application pool is either 32 bit (or supports 32 bit apps) or your COM control supports 64 bit apps. Most likely, your native COM library is 32bit and your pool runs a 64 bit worker by default, which is unable to load 32bit COM dll.
if running under IIS, is it really using "UserX", or is it using "Guest", "ASP.NET", or "IWAM_USER" or similar other account. Also, if its being invoked from IIS, you might need to check permissions... not just at the file level, but at the machine's COM configuration level.
Last time I had to deal with this, I would do
START -> RUN -> DCOMCNFG
or just bring up component services.
Then expand Component Services -> Computers -> My Computer -> DCOM Config and then scroll down to the COM object you are trying to use. Right click on it and there are multiple abs... Identity is the one that it will be launched as.. you can override this to put in a specific user to "bypass" the assumed "default". For TESTING ONLY, I would set it up with a less restrictive account (power user, not necessarily an admin, but try that last), and see if that helps.
In addition, on the Security tab, there are options for who can Launch/Activate and who can "Access" it. you might need to make sure your account is valid within that.