Solved

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

Posted on 2014-04-09
2
995 Views
1 Endorsement
Last Modified: 2014-04-10
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
Comment
Question by:deatc
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 300 total points
ID: 39990389
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
 
LVL 86

Assisted Solution

by:jkr
jkr earned 200 total points
ID: 39990477
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Authentication of Web Services 3 89
MS Access 03, TransferText, decimal places 8 78
No module found pypyodbc, 3 33
checkbox to hide entire section 10 43
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question