Error 429 - ActiveX component can't create object
I don't have this problem on my machine, but when testing the installation on another machine (well Virtual PC) i get the error:
Error 429 - ActiveX component can't create object
I know what this error means, but I don't know why I am getting it.
I have the following code in my MDIForm Load, which refers to a dll (vbsystraytools.dll) and after checking on Virtual PC, this dll is in the system32 folder and I assume it's registered (not quite sure how to check this).
BTW: lngSysTray is a registry value for the option of minimising to the system tray
Code:
'Declarations
Public WithEvents mobjSysTray As vbSysTrayTools.SysTray
'Form_Load
Set mobjSysTray = New vbSysTrayTools.SysTray
Set mobjSysTray.ImageList = imgMO
With mobjSysTray
.Icon = 1
.Menu.Add "Show", "SHOW"
.Menu.Add "Hide", "HIDE"
.EnableMenu = True
End With
If lngSysTray = 1 Then
mobjSysTray.Visible = True
Else
mobjSysTray.Visible = False
End If
Re: Error 429 - ActiveX component can't create object
It means it cant create either the mobjSysTray object or some other object that you may have coded. Can you step through the code and find the offending line?
Re: Error 429 - ActiveX component can't create object
Not really because I don't get this error when running it in the IDE.
Just a thought, but the dll file is located in a different place on my work PC, i.e. not in the system32 folder as it is on the virtul HD. Would this make any difference?
I would guess not, but just in case ;)
Re: Error 429 - ActiveX component can't create object
Quote:
Originally Posted by aikidokid
I assume it's registered (not quite sure how to check this).
Did you install it? or run RegSvr32 on it?
If you didn't do either, it isn't installed - so run RegSvr32 (open a command prompt, then type RegSvr32 followed by the full path and filename).
Note that it is safe to re-register something that is already registered (it just confirms the registry entries etc), so you can do it anyway.
Re: Error 429 - ActiveX component can't create object
Just a note. On virtual pc, I will simply drop a dll or ocx I want to test in the same folder as the project. Register it as si_the_geek recommends, then unregister when done testing.
Re: Error 429 - ActiveX component can't create object
ok will give it a go, but shouldn't have the installation package have registered it?
Re: Error 429 - ActiveX component can't create object
If it was part of an installation package you ran, it should have been registered - unless you somehow added it as "do not register".
Do you have error handlers in your program? If so, simply add a call to the Erl function in your message (eg: MsgBox "Error " & err.number & " on line " & Erl ": " & err.description ), and number your lines - which you can do with a single click with MZTools (link in my signature).
You should then be able to tell exactly where the error is, and thus hopefully be able to tell exactly what is causing the problem.
Re: Error 429 - ActiveX component can't create object
Post the line where you include this file in your installation script.
Re: Error 429 - ActiveX component can't create object
Quote:
Originally Posted by randem
Post the line where you include this file in your installation script.
Code:
Source: C:\Documents and Settings\Andrew\My Documents\VB6\MO\Inno\Copy dll files\vbsystraytools.dll; DestDir: {sys}; Flags: regserver restartreplace sharedfile;
Quote:
Originally Posted by si_the_geek
MZTools (link in my signature).
Aready got it thanks ;)
Quote:
Originally Posted by si_the_geek
You should then be able to tell exactly where the error is, and thus hopefully be able to tell exactly what is causing the problem.
OK, added lines, recompiled and run the setup on Virtual PC.
The error is on this line
Code:
Set mobjSysTray = New vbSysTrayTools.SysTray
which refers to the vbSysTrayTools.dll.
The dll file is registered and resides in the system32 folder.
I do have the original project that was compiled into this dll file. Would it be better to just compile the project in with my project?
Re: Error 429 - ActiveX component can't create object
That line from your script looks fine to me - hopefully someone who uses Inno Setup will be able to confirm.
I'm not sure what the problem is, and it may actually be within the DLL itself. To find the actual cause, I'd recommend adding similar error handling to the DLL, and seeing if that is the case (even if it isn't, the error handling could well be useful later).
Adding the project within yours may not help, but then again it might - so it would be a valid way to go.
Re: Error 429 - ActiveX component can't create object
Quote:
Originally Posted by si_the_geek
That line from your script looks fine to me - hopefully someone who uses Inno Setup will be able to confirm.
It installs the dll file in the System32 folder and it is registered.
Quote:
Originally Posted by si_the_geek
I'm not sure what the problem is, and it may actually be within the DLL itself. To find the actual cause, I'd recommend adding similar error handling to the DLL, and seeing if that is the case (even if it isn't, the error handling could well be useful later).
I have run the dll code in the vbSysTrayTools.vbp and added my exe and it works just fine.
I have registered the dll on my PC and the dll works as expected when using VB6 and running my project.
How do you mean adding error handling to the dll. It has 4 classes and 2 modules. Where would I begin :confused:
Quote:
Originally Posted by si_the_geek
Adding the project within yours may not help, but then again it might - so it would be a valid way to go.
I have tried this but got stuck at the first hurdle :cry:
See my question here. Post #11
Re: Error 429 - ActiveX component can't create object
Quote:
Originally Posted by aikidokid
How do you mean adding error handling to the dll. It has 4 classes and 2 modules. Where would I begin :confused:
Like for any error handling - simply add an error handler to each sub/function. As you have MZTools, it'll just be one click per routine. :)
It will probably work if you simply remove the DLL (AKA project) name, and just use the Class name, eg: ".. As SysTray"
Re: Error 429 - ActiveX component can't create object
Thanks once again si :D
By removing the DLL name it has solved the problem when I install on Virtual PC, so I am hoping this is it.
It doesn't answer why it wouldn't work with the actual dll file though!
I will add the error handling to the included project, just in case.
:lol: I have always written out all of my error handling. I really should look into the help that is available to me. I have had MZTools for years :rolleyes:
Edit: can't rate you again yet!
Re: Error 429 - ActiveX component can't create object
There's no need to write it out! Just go into MZTools options, select the "Error Handler" tab and enter a template like this (but altered to suit your own method/style!):
Code:
On Error GoTo ErrorHandler:
{PROCEDURE_BODY}
ErrorHandler: '** Error handler **
If Err.Number <> 0 Then
Call MyErrorHandlingSub("{PROCEDURE_NAME}")
End If
'tidy up:
'(tidy-up code for the routine here [close files, etc])
(the bits inside {} are things MZTools will fill-in for you, there's a list above the edit area)
Once you have the template, it is just one click to add it (including the bits filled in as apt) around the code of whatever routine you are in. Nice! :D