Runtime Error 429 "ActiveX Component can't create object"

  • Follow


Hi all,

My VB6 exe as a service is running flawless on my dev computer w. XP Pro.

I have created a PDW install and installed it on a WindowsEmbedded (XP) 
system.

There is no Form, so the only reference I have to any .ocx is:
Public WithEvents mComm As MSComm

Private Sub Class_Initialize()
    Set mComm = CreateObject("MSCOMMLIB.MSCOMM")
End Sub

Private Sub Class_Terminate()
  Set mComm = Nothing
End Sub

Private Sub mComm_OnComm()
    Comm1_OnComm
End Sub

All dll's, tlb's and mscomm32.ocx are registered and in SharedDLLs.

What else could cause this error?

/Henning


0
Reply Henning 6/28/2010 11:48:39 PM


"Henning" <computer_hero@coldmail.com> wrote in message 
news:i0bcco$176$1@news.eternal-september.org...
> Hi all,
>
> My VB6 exe as a service is running flawless on my dev computer w. XP Pro.
>
> I have created a PDW install and installed it on a WindowsEmbedded (XP) 
> system.
>
> There is no Form, so the only reference I have to any .ocx is:
> Public WithEvents mComm As MSComm
>
> Private Sub Class_Initialize()
>    Set mComm = CreateObject("MSCOMMLIB.MSCOMM")
> End Sub
>
> Private Sub Class_Terminate()
>  Set mComm = Nothing
> End Sub
>
> Private Sub mComm_OnComm()
>    Comm1_OnComm
> End Sub
>
> All dll's, tlb's and mscomm32.ocx are registered and in SharedDLLs.
>
> What else could cause this error?


The best thing I can think of to tell you is that you're using a control in 
a way controls are not designed to be used.  Controls are designed to be 
sited on a form or inside some other container.  Doing what you're doing can 
lead to unexpected and probably undesirable behavior. I'm not saying this is 
the cause of the problem you're encountering, I'm just saying it could be. 
What I'd suggest you do is look for a DLL, which is designed to be 
instantiated the way you're doing. I think Dick Grier has a free one (you 
might want to google for posts made by him).  Chances are, he'll post 
because he usually does with questions regarding the MSCOMM control or 
serial communications in general.

-- 
Mike

 

0
Reply MikeD 6/30/2010 12:14:40 AM


"MikeD" <nobody@nowhere.edu> skrev i meddelandet 
news:%23pLP%23k%23FLHA.4316@TK2MSFTNGP06.phx.gbl...
>
>
> "Henning" <computer_hero@coldmail.com> wrote in message 
> news:i0bcco$176$1@news.eternal-september.org...
>> Hi all,
>>
>> My VB6 exe as a service is running flawless on my dev computer w. XP Pro.
>>
>> I have created a PDW install and installed it on a WindowsEmbedded (XP) 
>> system.
>>
>> There is no Form, so the only reference I have to any .ocx is:
>> Public WithEvents mComm As MSComm
>>
>> Private Sub Class_Initialize()
>>    Set mComm = CreateObject("MSCOMMLIB.MSCOMM")
>> End Sub
>>
>> Private Sub Class_Terminate()
>>  Set mComm = Nothing
>> End Sub
>>
>> Private Sub mComm_OnComm()
>>    Comm1_OnComm
>> End Sub
>>
>> All dll's, tlb's and mscomm32.ocx are registered and in SharedDLLs.
>>
>> What else could cause this error?
>
>
> The best thing I can think of to tell you is that you're using a control 
> in a way controls are not designed to be used.  Controls are designed to 
> be sited on a form or inside some other container.  Doing what you're 
> doing can lead to unexpected and probably undesirable behavior. I'm not 
> saying this is the cause of the problem you're encountering, I'm just 
> saying it could be. What I'd suggest you do is look for a DLL, which is 
> designed to be instantiated the way you're doing. I think Dick Grier has a 
> free one (you might want to google for posts made by him).  Chances are, 
> he'll post because he usually does with questions regarding the MSCOMM 
> control or serial communications in general.
>
> -- 
> Mike
>
>

From what I understand his mComm is using mscomm32.ocx the same way as I...

I've been reading that it could be a licensing issue. The installer doesn't 
see mscomm32.ocx as part of the app, so I had to add and register it 
manually. When placing the control on a form it does include it. I'll see if 
that could be the cause.
If not, the API way could be worth testing.

Thanx for the tip.

/Henning


0
Reply Henning 6/30/2010 2:05:39 AM

"Henning" <computer_hero@coldmail.com> wrote in message 
news:i0bcco$176$1@news.eternal-september.org...
: Hi all,
:
: My VB6 exe as a service is running flawless on my dev computer w. XP Pro.
:
: I have created a PDW install and installed it on a WindowsEmbedded (XP)
: system.
:
: There is no Form, so the only reference I have to any .ocx is:
: Public WithEvents mComm As MSComm
:
: Private Sub Class_Initialize()
:    Set mComm = CreateObject("MSCOMMLIB.MSCOMM")
: End Sub

I tried doing something similiar with the Winsock control once.  It was a 
complete disaster.  I bit the bullet and used a dummy form and the control. 
This was before I understood the API  <eg>

-- 
Customer Hatred Knows No Bounds at MSFT
Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

Bawwk!  Paulie want a dingleball, bawwk! 

0
Reply Kevin 6/30/2010 2:34:57 AM

On Tue, 29 Jun 2010 01:48:39 +0200, "Henning"
<computer_hero@coldmail.com> wrote:
  
>    Set mComm = CreateObject("MSCOMMLIB.MSCOMM")

See the Serial Port Communications page at my web site.
http://www.granite.ab.ca/access/serialport.htm
for alternatives.  The first is VB6 code.    

Also MS has been setting the killbit recenlty for lots of older
versions of their supplied controls due to security concerns.  And who
knows if more vulnerabilities will be found.  To my way of thinking
removing as much external dependenceis as possible is a good thing.

Tony
-- 
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files 
  updated see http://www.autofeupdater.com/
0
Reply Tony 6/30/2010 4:27:42 AM

On 29/06/2010 00:48, Henning wrote:

> My VB6 exe as a service is running flawless on my dev computer w. XP Pro.

> There is no Form, so the only reference I have to any .ocx is:
> Public WithEvents mComm As MSComm

The MSComm control /really/ doesn't like not having a Form to lounge 
around on.

You /can/ use a Form in a VB6-written Service, just so long as your 
Error handling is /absolutely/ air-tight.  If you can do everything in 
your power to prevent a dialog popping up and stalling the entire 
process, then you can happily use a loaded but /non-visible/ Form!
We've had several of these running in production for over a decade, now. 
  (Not constantly, of course; they're on Windows boxes).   ;-)

HTH,
    Phill  W.
0
Reply Phill 6/30/2010 11:59:02 AM

Tony Toews presented the following explanation :
> removing as much external dependenceis as possible is a good thing.

That's been my Guiding Principle for years!  Amen...

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Reply Karl 6/30/2010 4:51:51 PM

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> skrev i meddelandet 
news:i0fbi7$ph1$1@south.jnrs.ja.net...
> On 29/06/2010 00:48, Henning wrote:
>
>> My VB6 exe as a service is running flawless on my dev computer w. XP Pro.
>
>> There is no Form, so the only reference I have to any .ocx is:
>> Public WithEvents mComm As MSComm
>
> The MSComm control /really/ doesn't like not having a Form to lounge 
> around on.
>
> You /can/ use a Form in a VB6-written Service, just so long as your Error 
> handling is /absolutely/ air-tight.  If you can do everything in your 
> power to prevent a dialog popping up and stalling the entire process, then 
> you can happily use a loaded but /non-visible/ Form!
> We've had several of these running in production for over a decade, now. 
> (Not constantly, of course; they're on Windows boxes).   ;-)
>
> HTH,
>    Phill  W.

Hi all,
As expected there was a licensing issue. Solved it by exporting following 
keys from dev. comp., then copying the .reg files to the target comp. I 
guess this is what is done when installing an app with MSComm on a Form, 
haven't tried that but...

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]
[HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSCOMMLib.MSComm]
@="Microsoft Communications Control, version 6.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSCOMMLib.MSComm\CLSID]
@="{648A5600-2C6E-101B-82B6-000000000014}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSCOMMLib.MSComm\CurVer]
@="MSCOMMLib.MSComm.1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSCOMMLib.MSComm.1]
@="Microsoft Communications Control, version 6.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSCOMMLib.MSComm.1\CLSID]
@="{648A5600-2C6E-101B-82B6-000000000014}"

[HKEY_CLASSES_ROOT\MSCOMMLib.MSComm]
@="Microsoft Communications Control, version 6.0"

[HKEY_CLASSES_ROOT\MSCOMMLib.MSComm\CLSID]
@="{648A5600-2C6E-101B-82B6-000000000014}"

[HKEY_CLASSES_ROOT\MSCOMMLib.MSComm\CurVer]
@="MSCOMMLib.MSComm.1"

[HKEY_CLASSES_ROOT\MSCOMMLib.MSComm.1]
@="Microsoft Communications Control, version 6.0"

[HKEY_CLASSES_ROOT\MSCOMMLib.MSComm.1\CLSID]
@="{648A5600-2C6E-101B-82B6-000000000014}"

Now things are working ok. :))

/Henning


0
Reply Henning 6/30/2010 11:09:32 PM

7 Replies
2409 Views

(page loaded in 0.189 seconds)


Reply: