Home All Groups Group Topic Archive Search About
Author
23 Aug 2010 4:13 AM
BeeJ
How do I register ActiveX EXEs that I have moved from one PC to
another?
I do not want to have to recompile them every time.
I tried creating the .reg file that usually registers .dll but that
does not work.
I am on Vista.
If I double-click the .reg file it says it is doing it.
But then when I right-click on the ActiveX EXE i do not see a menu item
for the .reg.  yes, because one is for .ocx and the other for .dll but
i have none for .exe
Vista has a menu item to register the .exe but when I try that it opens
a dialog to select the main program that uses the ActiveX Exe.  I
select the main app and proceed, but then the main app executes.  The
ActiveX EXE is still not recognized.
When I run the main app in the IDE it complains about objects so I open
the References and see that all is ok.  i.e. all ActiveX EXE are there
and checked.
I start the IDE again and this time no message but my code errors out
when it encounters the ActiveX EXE stuff.
So how do I "register" the ActiveX EXE without recompiling them.
I am not far enough along to set up an installer yet.

Author
23 Aug 2010 6:31 AM
ralph
On Sun, 22 Aug 2010 21:13:04 -0700, BeeJ <nospam@live.com> wrote:

Show quoteHide quote
>How do I register ActiveX EXEs that I have moved from one PC to
>another?
>I do not want to have to recompile them every time.
>I tried creating the .reg file that usually registers .dll but that
>does not work.
>I am on Vista.
>If I double-click the .reg file it says it is doing it.
>But then when I right-click on the ActiveX EXE i do not see a menu item
>for the .reg.  yes, because one is for .ocx and the other for .dll but
>i have none for .exe
>Vista has a menu item to register the .exe but when I try that it opens
>a dialog to select the main program that uses the ActiveX Exe.  I
>select the main app and proceed, but then the main app executes.  The
>ActiveX EXE is still not recognized.
>When I run the main app in the IDE it complains about objects so I open
>the References and see that all is ok.  i.e. all ActiveX EXE are there
>and checked.
>I start the IDE again and this time no message but my code errors out
>when it encounters the ActiveX EXE stuff.
>So how do I "register" the ActiveX EXE without recompiling them.
>I am not far enough along to set up an installer yet.
>

ActiveX EXEs register themselves when the program is first run, or you
can also register and unregister them using the command line ...

[optional path]\ActivexFile.exe /regserver
[optional path]\ActivexFile.exe /unregserver

If you used an installer, it would do the same thing.

So run the ActiveX EXE then attempt to use it. If it isn't registering
then something else is wrong and we need more information. The exact
error/s would probably help.

Are your clients using early or late binding?

-ralph
Author
23 Aug 2010 2:06 PM
BeeJ
ralph wrote :
Show quoteHide quote
> On Sun, 22 Aug 2010 21:13:04 -0700, BeeJ <nospam@live.com> wrote:
>
>> How do I register ActiveX EXEs that I have moved from one PC to
>> another?
>> I do not want to have to recompile them every time.
>> I tried creating the .reg file that usually registers .dll but that
>> does not work.
>> I am on Vista.
>> If I double-click the .reg file it says it is doing it.
>> But then when I right-click on the ActiveX EXE i do not see a menu item
>> for the .reg.  yes, because one is for .ocx and the other for .dll but
>> i have none for .exe
>> Vista has a menu item to register the .exe but when I try that it opens
>> a dialog to select the main program that uses the ActiveX Exe.  I
>> select the main app and proceed, but then the main app executes.  The
>> ActiveX EXE is still not recognized.
>> When I run the main app in the IDE it complains about objects so I open
>> the References and see that all is ok.  i.e. all ActiveX EXE are there
>> and checked.
>> I start the IDE again and this time no message but my code errors out
>> when it encounters the ActiveX EXE stuff.
>> So how do I "register" the ActiveX EXE without recompiling them.
>> I am not far enough along to set up an installer yet.
>>
>
> ActiveX EXEs register themselves when the program is first run, or you
> can also register and unregister them using the command line ...
>
> [optional path]\ActivexFile.exe /regserver
> [optional path]\ActivexFile.exe /unregserver
>
> If you used an installer, it would do the same thing.
>
> So run the ActiveX EXE then attempt to use it. If it isn't registering
> then something else is wrong and we need more information. The exact
> error/s would probably help.
>
> Are your clients using early or late binding?
>
> -ralph

Brother!  How simple when you know what to do.  It never crossed my
mind since all past experience was dealing with .dll or way back .ocx
using regsvr32.
I ran all of them by double-clicking each in Windows Explorer (Vista)
and they all gave me my "Can't run stand-alone" messaged generated in
Sub Main.  Then I started my main app .EXE and it all played.  Also
tried in the IDE.  It had no problems with all references good and it
ran.
Thanks!
Author
23 Aug 2010 2:16 PM
BeeJ
I just woke up.
What does early vs late got to do with anything in this case?

I have been using early binding for all but one ActiveX EXE.
I have a debug ActiveX EXE that I send messages to to display while I
am running my main app.  This one uses late binding and is more
difficult to uses since no intellisense.
Sorry my brain is dusty this AM.
What I have all works well but one really wants to know - so where can
I find the real reason to use or not use early vs late binding.
Links please.
Thanks!
Author
23 Aug 2010 3:42 PM
ralph
On Mon, 23 Aug 2010 07:16:31 -0700, BeeJ <nospam@live.com> wrote:

>I just woke up.
>What does early vs late got to do with anything in this case?
>

Nothing really beyond are a particularily nasty little Gotcha that can
occasionally creep into VB Client/Server projects developed on one box
and migrated to another. It is rare, and I wouldn't even have asked
except you mentioned 'recompiling' as a possible solution. So ignore
me. <g>

>I have been using early binding for all but one ActiveX EXE.
>I have a debug ActiveX EXE that I send messages to to display while I
>am running my main app.  This one uses late binding and is more
>difficult to uses since no intellisense.
>Sorry my brain is dusty this AM.
>What I have all works well but one really wants to know - so where can
>I find the real reason to use or not use early vs late binding.
>Links please.
>Thanks!
>

"Using early binding and late binding in Automation"
http://support.microsoft.com/kb/245115

To make development easier you can combine the two methods. Use early
binding, then once tested, replace the references. In the two samples
given in the article you could have something like this ...

' Set reference to 'Microsoft Excel 8.0 Object Library'
' to a library that supports the minimum sub-set of calls.

#If True
    ' Declare the object as an early-bound object
  Dim oExcel As Excel.Application
#Else
    ' Declare the object as a late-bound object
  Dim oExcel As Object
#End If
....

Go back and change "#If" to False when you want to use late-binding.
Note you can also use a constant, variable, or project dialog define
for the value given to the "#If" directive.

-ralph
Author
23 Aug 2010 6:41 AM
Nobody
Bookmark this for future reference:

How To Register and Unregister an Out-of-Process COM Component (ActiveX EXE)
http://support.microsoft.com/kb/297279
Author
23 Aug 2010 10:50 AM
David Youngblood
Show quote Hide quote
"BeeJ" <nospam@live.com> wrote in message
news:i4ssgl$4uv$1@speranza.aioe.org...
> How do I register ActiveX EXEs that I have moved from one PC to another?
> I do not want to have to recompile them every time.
> I tried creating the .reg file that usually registers .dll but that does
> not work.
> I am on Vista.
> If I double-click the .reg file it says it is doing it.
> But then when I right-click on the ActiveX EXE i do not see a menu item
> for the .reg.  yes, because one is for .ocx and the other for .dll but i
> have none for .exe
> Vista has a menu item to register the .exe but when I try that it opens a
> dialog to select the main program that uses the ActiveX Exe.  I select the
> main app and proceed, but then the main app executes.  The ActiveX EXE is
> still not recognized.
> When I run the main app in the IDE it complains about objects so I open
> the References and see that all is ok.  i.e. all ActiveX EXE are there and
> checked.
> I start the IDE again and this time no message but my code errors out when
> it encounters the ActiveX EXE stuff.
> So how do I "register" the ActiveX EXE without recompiling them.
> I am not far enough along to set up an installer yet.


Which ever method you use, on Vista you must be an admin *and* elevated.

David