• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1067
  • Last Modified:

Cannot Create Simple 32-Bit COM Component on 64-Bit Windows

Hi.  I have an ATL/MFC COM simple object written in Visual C++ 6.0.  This COM object has a single method, Test(), that simply calls the MFC MessageBox() method to display a "hello world" message.

I am trying to use this COM object on 64-bit Windows 7.  I put the file for this COM object, TestLibrary.dll, into the SysWOW64 folder and ran as an administrator the command "regsvr32 C:\Windows\SysWOW64\TestLibrary.dll", which resulted in the following message: "DllRegisterServer in C:\Windows\SysWOW64\TestLibrary.dll succeeded."   When I try to create the COM object, for example in Microsoft Excel, however, I get the following error message: "Run-time error '429': ActiveX component can't create object."  Do you have any ideas as to why I cannot create the COM object on 64-bit Windows?  It works flawlessly on 32-bit Windows.

Thank you.
1
deatc
Asked:
deatc
2 Solutions
 
Jacques Bourgeois (James Burger)Commented:
If you are using the 64-bit version of Excel, you will have problems communicating with many 32-bit dlls. This is why Office usually installs the 32-bit version by default, even on 64-bit computer.

This is not a problem with Office, this is a normal problem with 64 bit applications, that use values that are too big for 32-bit dlls and applications.
0
 
jkrCommented:
There is a little caveat with 'regsvr32.exe' on Win64 - the you need to specify the FULL path when calling it to register 32bit DLLs, i.e.

C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\TestLibrary.dll

Open in new window


BTW, 'C:\Windows\SysWOW64\regsvr32.exe' might not be the accurate full path to that executable, this is a 32 bit laptop 'm posting from and I can't verify this therefore, but  am sure you'll find out the right one :o)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now