Solved

Error 429 - ActiveX Component Can't Create Object - Registry Error

Posted on 2014-07-17
24
1,350 Views
Last Modified: 2014-07-21
I am getting an error 429 when MS Access is trying to create the interface (?) to the DLL.  This problem only happens on a Windows 2012 R2 box when I use the new Installshield Limited Edition using Visual Studio 2013.  If I run this setup on a Windows 2008 R2 box, it works.  Both boxes are 64bit and the code is built using the "any processor" option.

I used "PROCMON" to determine what was happening.  It indicated that the DLL could not be found.  I searched the registry to see if there were any hints and when I found the GUID in the HKEY_Classes_Root\wow6432node\typelib section of the registry I get an error trying to open the key.

If I build the same code using VS2008 the setup, that used to come with VS, works fine on both boxes.  

I have attached a word doc containing screen shots of the code and the issue in the registry.  It also contains a screen shot of the settings for Installshield.  Please note, I tried this using 5 different version of Schema with no changes in the results.
Bad-Registry-Entry.docx
0
Comment
Question by:mkacos
  • 12
  • 12
24 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
I would closely inspect the registry key in installshield installation. The known cause of this message is hex null character somewhere in the key name.

The best would be to inspect the resulting msi file with Orca, to see the end result.

Another way is to use the same procmon to monitor registry writings during the installation.
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I am not familiar with Orca.  Can you be more specific?

I checked the GUID for nulls and did not find any, I also ran procmon and have attached the log (renamed extension) file. The GUID for the DLL is d562742c-0181-4ac4-9892-092bc5715a5a.  I did not see anything unusual in the log file but I am not an expert at this.

I did notice the Product Code in Installshield is different {9080330C-5C05-428A-A138-E42F91315068} than the DLL.  Should this be the same as the DLL?  I have read through what little documentation that is supplied with Installshield and it does not really indicate that as being the case.
2014-07-17-LOGFILE.LOG
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
Let's start from beginning. You said that you receive error 429, "activex component can't create object". Do you know what object is that? If you don't, debug your VBA code and find out.

Once you know the object, let's try to do the same from vbscript: open notepad and create file with the following line:

set myobject=createobject("<the name of the object>")

substitute your object. Save the file as runme.vbs, and run. Will you receive the same error message?
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I am a little confused about your post.  The object is contained within a DLL that is referenced in the VBA code in Access. Here is the code that fails:
DIM ITCCode as ITCClass.ITCCom
Set ITCCode = NEW ITCClass.ITCCom  <---This is where the error happens.

I did what you requested and received the error "ActiveX component can't create object: 'ITCCODE" which I would have expected because (albeit I do not know VB script very well) the DLL is not referenced.  

How do I reference the DLL in VBS?
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
ok, the object then is called ITCClass.ITCCom . So try this vbs:

set myobject=createobject("ITCClass.ITCCom")
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
...in vbs you don't reference, "createobject" takes care of that.

Open command line and run this:

regsvr32 <full path to your dll>

then try vbs again, see if the error is gone.
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I did just that and got the same error as above.
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I tried these:
C:\Windows\SysWOW64>regsvr32 "C:\Program Files (x86)\ITC\ITC\itcclass.dll"
C:\Windows\SysWOW64>regsvr32 "C:\Program Files (x86)\ITC\ITC\itcclass.tlb"
C:\Windows\system32>regsvr32 "C:\Program Files (x86)\ITC\ITC\itcclass.tlb"

"The module "blah blah" was loaded but the entry-point DllRegisterServer was not found." was what was received for the DLL

The module "blah blah" may not compatible with the version of Windows that you're running.  Check if the module is compatable with an x86 (32 bit) or x64 (64-bit) version of regsvr32.exe was what was received for the TLB file.  

I tried it with the version of regsvr32 in the sysWOW64 folder and the one in the system32 folder.  Same result either way.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
If the dll fails to register correctly, it's 100% fault of the developer of this dll. You have two choices:

1. contact the developer; don't mention the installation or Access, because they will blame those. Mention only the fact that regsvr32 ran successfully, but then createobject fails. This is ironclad proof that the dll is wrong.

2.  run process monitor, monitor file and registry activity, find out what's missing, and recreate it by hand in the registry. If it works, put the fix in the installation.

Of course, #2 is quite sophisticated undertaking, especially since you said you have limited experience with COM; so it makes sense only if the developer does not cooperate.

To do #2, modify vbscript:

msgbox "ready to createobject"
set a = createobject("ITCClass.ITCCom")

run vbscript; when you see the message, run process monitor, and immediately click "OK" in the message, once the error is on the screen, immediately stop process monitor. You can filter only for process wscript, to make it easier. Then inspect the trace and find out what has failed.

The positive side is that if you manage to resolve #2, you will have all reasons to change "but I am not an expert at this" to "and I am quite an expert at this." :-)
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
try

C:\Windows\system32>regsvr32 "C:\Program Files (x86)\ITC\ITC\itcclass.dll"

(not .tlb)
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
This is a .NET DLL so the TLB is what registers not the DLL. Not sure why this is the case and he DLL will not register on a 32 bit machine either, the TLB does.

I am the developer.  What could be wrong with the code?  It only fails on a 64 bit machine and it is being built with the target CPU = "Any CPU".
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
If this is .net dll, then it has to be registered by regasm, with the option /codebase.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:mkacos
Comment Utility
Let's take a step back for a minute.  In VS2008 using the old packaging (setup) it works fine on a 32 bit and 64 bit machine.  It does not work on VS2013 with Installshield.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
What was the value of the property "Register" of the primary output in vs2008 s&d project?
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
vsdrpCOM
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
vsdrpCOM means that all registry information has been extracted from the dll by Visual Studio and then Installer created those registry keys by itself.

So in order to find out why it's not working now on Windows 2012, there are two possibilities: either something is wrong with the dll itself, or with the installation.

That's why I suggested that you register it bypassing the installation. Since this is .net dll, this should be done by regasm. If you find that once it's registered by regasm, it works, but when it's registered by the installation, it does not, it will mean that the fault is in the installation. Then, the next step will be to compare registry keys created by both, and find the difference. If however you find that it does not work even when registered by regasm, then it will mean that something is wrong with the dll itself.

I would experiment with creating a trivial project in visual studio - create COM class with one public method, create the installation, install, then try to createobject and call the method from vbscript.
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I got this message when I tried to regasm:

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on
the same computer. The /codebase switch is intended to be used only with signed
assemblies. Please give your assembly a strong name and re-register it.
Types registered successfully

I am going to correct this but do you think this is the cause?
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I cannot sign the assembly.  There is a 3rd party COM object/interface that errors during the build when I try to sign the assembly I am building.  It is older code that I do not have access to and is no longer supported and it does not have a strong name.

However, I tried  regasm with the /codebase switch and it works even though I get that warning.

Based on what you are saying, are you recommending I bypass the install and do this with a batch file?  How can I resolve this?
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
The warning is only a warning, it still should work (and does).

> Based on what you are saying, are you recommending I bypass the install and do this with a batch file?  How can I resolve this?

No, as I said, the next step is to inspect the difference between the registry entries created by installshield and registry entries created by regasm. Something will be different, and depending on what is is, it will have to be addressed.

There are two ways to inspect. One is looking into the MSI using capable tool such as Orca (which requires being familiar with the structure of MSI); another is to inspect registry entries in the system created by each method (which requires being familiar with COM-related registry information, so you know where to look). The third is to upload you installation (renamed from .msi to .txt) for us to take a look.

Does your limited installshield offer any other way to register COM? such as, in VS2008 besides vsdrpCOM you had vsdrpSelfReg. Is there an equivalent in Installshield?
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
I cannot find an option to change the method of registering a COM file in the limited edition, of course most of the options are not available.  However I am still looking.  It sure would be nice if the folks at Installshield would answer my support question.

I did add a custom step to run regasm  /codebase which is NOT a long term solution however it did work.  

I am not familiar with MSIs.  I can get around in the registry and understand it but I do not know com-related registry information.  

I have attached the setup renamed to *.txt.
setup---Copy.txt
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
Comment Utility
In your MSI, COM information is very seriously missing. Try to re-add the file to the installation in visual studio and rebuild, but before that mark the assembly itself as "register for com interop" and "com visible".

Note that custom action with hardcoded path will fail if it's installed in different location.
0
 
LVL 1

Author Closing Comment

by:mkacos
Comment Utility
Very, Very helpful.  Thanks
0
 
LVL 1

Author Comment

by:mkacos
Comment Utility
It worked.  Thanks for being helpful.

FYI: I knew the custom action was not going to work every time I did it as a test.  I have removed it from the project.  Again, thanks.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
As a final note - I think, the reason why your installation, even with pretty much all COM registration missing, still worked on some machines, is most likely because it was already installed on those machines, such as by the previous version. Always test installations only on clean machines. The easiest way is to have several v.m.'s with different operating systems, freshly installed, and to have a snapshot of each made immediately after the installation. Then you can always reset the v.m. to that clean state with one click, and test.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now