Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Query whether OCX is already registered
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter  
View profile  
 More options Sep 2 2004, 9:40 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Peter" <pete...@myrealbox.com>
Date: Thu, 2 Sep 2004 15:40:36 +0200
Local: Thurs, Sep 2 2004 9:40 am
Subject: Query whether OCX is already registered
Dear All
I have a VB program that uses the Richtx32.ocx.
As I don't like to distribute a setup program with my VB program and WinXP
seems to have Richtx32.ocx already included I thought that I just query
whether this ocx is already registered and if not I register it via VB code.
I have already found out how I can register a ocx via VB code but I don't
know how to query whether it is already registered or not.
Does anybody know how this can be done?
Can the same application that uses a certain ocx first query whether it is
registered or not or will the while application never start if it is not
registered?

Thanks for any help on this
Regards
Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gaurav - http://www.gauravcreation s.com  
View profile  
 More options Sep 2 2004, 10:05 am
Newsgroups: microsoft.public.vb.general.discussion
From: Gaurav - http://www.gauravcreations.com <gauravcreati...@hotmail.com>
Date: Thu, 2 Sep 2004 07:05:05 -0700
Local: Thurs, Sep 2 2004 10:05 am
Subject: RE: Query whether OCX is already registered
even if you register any ocx again it won't make a difference..
nyways in the case of richtx32.ocx or any ocx distributed with the OS, it's
already registered...

if richtx32.ocx is not there your program will throw an exception..nd your
querying for it's registered status won't make a difference cos the ocx is
anyways needed...

to be on the safe side it's better to include it with your
application....it's true that winXP may have it, but it's also possible that
some other application using richtx32.ocx removes it upon it's uninstall

--
Gaurav Creations


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Butler  
View profile  
 More options Sep 2 2004, 10:11 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Bob Butler" <tiredo...@nospam.com>
Date: Thu, 2 Sep 2004 07:11:30 -0700
Local: Thurs, Sep 2 2004 10:11 am
Subject: Re: Query whether OCX is already registered
"Peter" <pete...@myrealbox.com> wrote in message

news:1094132436.886647@zwei

> Dear All
> I have a VB program that uses the Richtx32.ocx.
> As I don't like to distribute a setup program with my VB program and
> WinXP seems to have Richtx32.ocx already included I thought that I
> just query whether this ocx is already registered and if not I
> register it via VB code. I have already found out how I can register
> a ocx via VB code but I don't know how to query whether it is already
> registered or not. Does anybody know how this can be done?
> Can the same application that uses a certain ocx first query whether
> it is registered or not or will the while application never start if
> it is not registered?

If it is there, and is at least the version you need, re-registering it
would not hurt.  If it is not there, or is an older version, then you will
need to install and register your version.  No matter what the situation is
you don't need to know if it is already registered.

--
Reply to the group so all can participate
VB.Net... just say "No"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Halter  
View profile  
 More options Sep 2 2004, 10:33 am
Newsgroups: microsoft.public.vb.general.discussion
From: Ken Halter <Ken_Halter@Use_Sparingly_Hotmail.com>
Date: Thu, 02 Sep 2004 07:33:44 -0700
Local: Thurs, Sep 2 2004 10:33 am
Subject: Re: Query whether OCX is already registered

Peter wrote:
> Dear All
> I have a VB program that uses the Richtx32.ocx.
> As I don't like to distribute a setup program with my VB program and WinXP

No one really likes it <g>. The problem is, not all operating systems
even have the VB runtimes. If your target OS is limited exclusively to
Win2k or XP, you can sometimes get away without a package if you use
only MS controls.

> seems to have Richtx32.ocx already included I thought that I just query
> whether this ocx is already registered and if not I register it via VB code.
> I have already found out how I can register a ocx via VB code but I don't
> know how to query whether it is already registered or not.
> Does anybody know how this can be done?
> Can the same application that uses a certain ocx first query whether it is
> registered or not or will the while application never start if it is not
> registered?

As others pointed out, re-registering a control doesn't hurt anything. I
don't recall which one but I used to have at least one application that
added a call to Regsvr32 to reregister a certain ocx everytime the
computer was booted.

Also, if you start your app from Sub Main, you can setup an error trap
that can detect the missing OCX and report it to the user or just go
ahead and attempt to register it.

Sub Main will run before any forms are loaded so the app won't bomb
immediately like it would if your startup object was Form1 (for example)
and that contained an OCX that wasn't registered.

> Thanks for any help on this
> Regards
> Peter

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ralph  
View profile  
 More options Sep 2 2004, 10:38 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Ralph" <nt_consultin...@hotmail.com>
Date: Thu, 2 Sep 2004 09:38:38 -0500
Local: Thurs, Sep 2 2004 10:38 am
Subject: Re: Query whether OCX is already registered

"Peter" <pete...@myrealbox.com> wrote in message

news:1094132436.886647@zwei...

There are several ways you can verify the existence of a control. You could
look for the component \%windir%\System32\RichTx32.ocx. You could open the
Registry and look for RichTextLib.RichTextBox. You could perhaps "install"
and register the component if was missing and then relaunch your
application, or some other sort of mechanism. This latter exercise would
require that a copy of the .ocx is available.

Frankly, IMHO, this is a silly way to approach the problem. Whether you
"like" to provide a 'setup' with your VB application has little relevance
(none actually). If you are going to utilize OLE/COM technologies then use
the tools provided to insure a reliable install. "DLL Hell" is easy enough
to descend into without going out of your way to manufacture alternative
opportunities.

Learn how to create and use a 'setup' program. Period. Why re-invent the
wheel?

You can use M$'s P&D (free) which is included with VB6, which is for what
appears to be a simple setup.

M$'s Visual Installer (free) which is perhaps the better product for XP.
http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx

An excellent 3rd party product, Inno Setup.
 http://www.jrsoftware.org/isinfo.php

Or if you want to spend some money -Wise:
http://www.wise.com/wps.asp

Or, a couple of dozen of others. Just do a Google search.

-ralph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fred  
View profile  
 More options Sep 2 2004, 10:48 am
Newsgroups: microsoft.public.vb.general.discussion
From: Fred <nob...@nowhere.com>
Date: Thu, 02 Sep 2004 16:48:53 +0200
Local: Thurs, Sep 2 2004 10:48 am
Subject: Re: Query whether OCX is already registered
On Thu, 2 Sep 2004 15:40:36 +0200, "Peter" <pete...@myrealbox.com>
wrote:

>As I don't like to distribute a setup program with my VB program and WinXP
>seems to have Richtx32.ocx already included I thought that I just query
>whether this ocx is already registered and if not I register it via VB code.

Two solutions I know of: Either try to load the OCX and see if it
generates an error (but it could load but be an older version than
your program expects...), or do it the more thorough way by querying
the Registry with the OCX's CLSID (that long, 128-byte hexa number
that uniquely identifies an OCX.)

Here's what you could put in your project's Sub Main() to check before
loading any form:

'If TestReg("word.prog") = False then...
Function TestReg (ByVal sProgID As String) As Boolean
  On Error GoTo Trap
  Dim oMyObject As Object
  Set oMyObject = CreateObject(sProgID)
  TestReg = True
Trap:
End Function

More infos for the second method:

http://www.mvps.org/emorcillo/vb6/com/index.shtml
http://www.experts-exchange.com/Programming/Programming_Languages/Vis...
http://vbaccelerator.com/home/VB/Utilities/ActiveX_Documenter/article...

Fred.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Norman Yuan  
View profile  
 More options Sep 2 2004, 11:07 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Norman Yuan" <nob...@nowhere.no>
Date: Thu, 2 Sep 2004 08:07:14 -0700
Local: Thurs, Sep 2 2004 11:07 am
Subject: Re: Query whether OCX is already registered
My immediate reaction to the question was the same as the other two posts:
why bother, just register it, it wouldn't hurt if it was there already. But
on the second thought, the issue is not that simple.

If the OCX/DLL is your custom file, fine, you can register it as you want,
you may register a newer version to replace older one, you can also to the
opposite, register an older version to replace a buggy new version (due to
some reason, anyway). As long as your app works.

But if the OCX/DLL is most likely included in Windows originally, things
could turn ugly. Consider following situation:

1. The target Windows machine has newest OCX/DLL (Richtx32.ocx, in your
case), which comes with Windows, or installed by other app(s)., being placed
in, say, C:\WINNT\System32
2. You developed an app that uses the same OCX/DLL.
3. Your app's installation went ahead to register the OCX/DLL in C:\your
app. Now all apps that use the OCX/DLL get it in this location.
4. User decided to remove your app later on. Every thing is removed,
including the OCX/DLL.
5. Other apps that use the OCX/DLL now are  broken.

So, the issue become: you must make sure the OCX/DLL is not uninstalled if
it is shared. But even the uninstallation program is made that it does not
remove the OCX/DLL, after uninstalling your app, you would left a single
file (the OCX/DLL) in C:\Your app folder. More often than not, the user of
that computer would think, "Gee, I just removed the App, why it not got
cleaned up?", He then delete the "C\Your app" folder manually. Now your know
what would happen.

Also, you may register an older version of the same OCX/DLL, while other app
require the newer version (classical DLL hell issue).

So, I'd suggest to take extra caution to those OCX/DLL that may included in
different version of Windows. However, I personally haven't had chance to
deal this kind thing in my projects.

"Peter" <pete...@myrealbox.com> wrote in message

news:1094132436.886647@zwei...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ralph  
View profile  
 More options Sep 2 2004, 11:26 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Ralph" <nt_consultin...@address.com>
Date: Thu, 2 Sep 2004 10:26:17 -0500
Local: Thurs, Sep 2 2004 11:26 am
Subject: Re: Query whether OCX is already registered

"Norman Yuan" <nob...@nowhere.no> wrote in message

news:ORt0B6PkEHA.548@TK2MSFTNGP11.phx.gbl...

Or if a Vorgon warship was passing by and just happened to be scanning the
user's computer while the registration was happening and the CLSID
translated to an extremely unpopular insult and the user's computer is
suddenly vaporized by a shocked and startled watch commander...

Or, just follow the rules. If there is a chance a needed component for your
application may not already be installed - include a setup program to
install it.

-ralph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Burn  
View profile  
 More options Sep 2 2004, 11:35 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Steven Burn" <p...@noyb.com>
Date: Thu, 2 Sep 2004 16:35:08 +0100
Local: Thurs, Sep 2 2004 11:35 am
Subject: Re: Query whether OCX is already registered
"Ralph" <nt_consultin...@address.com> wrote in message

news:O$gOTGQkEHA.1996@TK2MSFTNGP09.phx.gbl...

> Or if a Vorgon warship was passing by and just happened to be scanning the
> user's computer while the registration was happening and the CLSID
> translated to an extremely unpopular insult and the user's computer is
> suddenly vaporized by a shocked and startled watch commander...

Those Vorgon's really are cheeky git's y'know. Had the ordasity to ask me if
I'd buy em a pint the other day.....

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Burn  
View profile  
 More options Sep 2 2004, 11:36 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Steven Burn" <p...@noyb.com>
Date: Thu, 2 Sep 2004 16:36:15 +0100
Local: Thurs, Sep 2 2004 11:36 am
Subject: Re: Query whether OCX is already registered
You could've considerably shortened this to;

"If it's your own OCX/DLL, run the reg anyway, if not, use an installer to
determine whether to install/reg/replace it"

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Norman Yuan" <nob...@nowhere.no> wrote in message

news:ORt0B6PkEHA.548@TK2MSFTNGP11.phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Baur  
View profile  
 More options Sep 2 2004, 11:39 am
Newsgroups: microsoft.public.vb.general.discussion
From: Tim Baur <trbo20@disregard_yahoo.com>
Date: Thu, 02 Sep 2004 08:39:22 -0700
Local: Thurs, Sep 2 2004 11:39 am
Subject: Re: Query whether OCX is already registered
That happened to me once when my class was just about to spit out

"What's 6 * 7?"

"Ralph" <nt_consultin...@address.com> wrote in
news:O$gOTGQkEHA.1996@TK2MSFTNGP09.phx.gbl:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter  
View profile  
 More options Sep 2 2004, 3:27 pm
Newsgroups: microsoft.public.vb.general.discussion
From: "Peter" <->
Date: Thu, 2 Sep 2004 21:27:28 +0200
Local: Thurs, Sep 2 2004 3:27 pm
Subject: Re: Query whether OCX is already registered

Hi

Thank you all very much for your inputs.
I think I have learnd a lot.

One more question to you:
What Windows Version should have Richtx32.ocx included? Does MS specifies
this somewhere?
Should Win98 and upwards already include it and should it be automatically
registered if there is a standard windows installation on the PC?

Regards
Peter

"Peter" <pete...@myrealbox.com> schrieb im Newsbeitrag
news:1094132436.886647@zwei...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ralph  
View profile  
 More options Sep 2 2004, 4:09 pm
Newsgroups: microsoft.public.vb.general.discussion
From: "Ralph" <nt_consultin...@address.com>
Date: Thu, 2 Sep 2004 15:09:31 -0500
Local: Thurs, Sep 2 2004 4:09 pm
Subject: Re: Query whether OCX is already registered

Ha. You don't give up do you? <g>

The DLL Help Database is useful for tracking down information concerning
versions and packages they are included with: Go to the database site and
enter the name of the component you are interested in.

http://support.microsoft.com/default.aspx?scid=/servicedesks/filevers...

Looking through the versions listed, no O/S is mentioned (except for the NT
4.O Option Pack), but it appears to be consistently installed with Office
Packages.

The MSDN does have a Platform site for each OS and there are published list
of included files, but with slightly different OEM builds, releases, service
packs, specific corporate images, vendor bundles, etc. I imagine the lists
are not 100% reliable, but likely close.

It still strikes me as a waste, to spend all that time, trying to determine
the existence of something, just to save not including a setup. Perhaps, you
are attempting to perform an xcopy install or deliver some form of sleath
product. In which case perhaps you are asking the wrong question.

-ralph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fred  
View profile  
 More options Sep 3 2004, 9:24 am
Newsgroups: microsoft.public.vb.general.discussion
From: Fred <nob...@nowhere.com>
Date: Fri, 03 Sep 2004 15:24:30 +0200
Local: Fri, Sep 3 2004 9:24 am
Subject: Re: Query whether OCX is already registered
On Thu, 2 Sep 2004 15:09:31 -0500, "Ralph"

<nt_consultin...@address.com> wrote:
>It still strikes me as a waste, to spend all that time, trying to determine
>the existence of something, just to save not including a setup. Perhaps, you
>are attempting to perform an xcopy install or deliver some form of sleath
>product. In which case perhaps you are asking the wrong question.

I guess the OP is mixing two problems: How to install a complete,
working VB app on all the different flavors of Windows, and how to
keep an installed application up to date. I'm back at looking at the
second issue, ie. implementing Symantec's LiveUpdate.

Fred.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter  
View profile  
 More options Sep 3 2004, 11:53 am
Newsgroups: microsoft.public.vb.general.discussion
From: "Peter" <->
Date: Fri, 3 Sep 2004 17:53:50 +0200
Local: Fri, Sep 3 2004 11:53 am
Subject: Re: Query whether OCX is already registered
Hi Ralph

Thanks again for your answer.
Well, I will tell you the truth: I hate programs that needs to be installed
first. I often had problems in the past when I have installed programs from
others: they changed some dlls/ocx and other existing sw was not working
correct anymore. You also need to take care to uninstall the software later
again. I have also seen that even the VB P&D generates some errors now and
then on different PCs especially if these PCs have different windows
versions insalled in different languages.I you ship out just an exe file you
don't need to take care on that.
And my strategy is always: better to have less functionalities in your
programs but don't use any activex that require a setup routine.

Maybe this can become a seperate thread to discuss in this newsgroup but for
the moment I can tell you something about my current project:

It's, of course a simple VB program that is just an exe without any setup
routine and I ship it to my customers around the world.
I ever thought that one of them will once report that the VB runtime is
missing but I never had this situation so far(over many years now).
In this case I would send him the link on the internet to download and
install the VB runtime, now after many years no customer ever reported that
the VB runtime is missing on his PC.
However, my problem starts now because I like to add unicode functionalities
to my program but the MS textbox does not support it.
I need to use a different control instead, I have seen that Richtx32 control
does what I want.
Because I like to continue my strategy to avoid any setup routine but extend
my simple exe for unicode support I have a problem: the Richtxt32.ocx must
be available on the customers PCs and it must be registered there.
I thought I add the following routines to my program at startup:
-check whether file richtx32.ocx is available on PC, if not report error
message that this file is needed and end program, otherwise continue.
-check whether richtx32 is registered(by trapping a runtime error), if not
register it(found already some winapi calls that can do this) and continue.
-load the form with the richtextbox

I will then watch how many customers will ask me for the file richtx32.ocx.
If every 2nd customer asks for it then I need to change my concept(I am
playing with some ideas to either put richtx32.ocx into the compiled exe or
generate it the veriy first time via VB code...), if there are just a few
customers then I let them download richtx32.ocx manually from a website and
store it in system32 folder. My program would then register it automatically
with the next start.

Of course if one would have an idea how to have unicode support with the
standard vb controls(I just need a textbox) , maybe via winapi calls then I
wouldn't need any external control at all...

Anyway, you can tell me tons of arguments to use a setup routine I will
always look for ways to aviod it  ;-)

Regards
Peter

"Ralph" <nt_consultin...@address.com> schrieb im Newsbeitrag
news:uh89ikSkEHA.536@TK2MSFTNGP11.phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »