Home All Groups Group Topic Archive Search About
Author
30 Jul 2010 11:45 PM
BeeJ
So all this VB6 development has left junk all through my registry.
OK so I don't know what I am doing.
I like to create ActiveX EXEs etc and find the clutter of non-existent
references in Project\References.
And I cannot unRegester 'cause I screwed up and deleted a project that
contained that registered reference.

1) how can I minimize it as I do development?

2) how can I clean out the registry safely?  Me no want to edit.
   Reg Clean Apps?
    a) for free?  links please.
    b) best Reg Cleaner at lowest price. links please.

Running WinXP(latest) and Vista(latest).

I am a retired individual who really enjoys the programming challenge
but needs lots of input.

MesNews rocks!  In through news.aioe.org

Author
31 Jul 2010 2:37 AM
ralph
On Fri, 30 Jul 2010 16:45:05 -0700, BeeJ <nospam@nowhere.com> wrote:

>So all this VB6 development has left junk all through my registry.
>OK so I don't know what I am doing.
>I like to create ActiveX EXEs etc and find the clutter of non-existent
>references in Project\References.
>And I cannot unRegester 'cause I screwed up and deleted a project that
>contained that registered reference.
>
>1) how can I minimize it as I do development?
>

Like everything else in programming there is no one answer.
Here is one:
a) Get into the habit of always compiling a product (.exe,
ActiveX.exe, ActiveX.Dll) into the project folder.
Also create a folder off of the project folder called ".cmp" (name
doesn't matter). This is your "compatibility" folder.

b) Once an ActiveX product's 'interface' is relatively stable copy it
into the compatibility folder, and change the extension to .cmp.
This will serve as your "binary compability" component.

c) If you need to test your product in an alternate location on the
same box, always move it, don't copy it, to its new location. When
done delete it, or change its name. (I often just use .xxx. You can do
this with a simple bat file "copy *.exe *.xxx".

d) I often use a simple .bat file to move files.
If you move a component using the Explorer the registration will
follow it.
If you move a component using a .bat or .vbs file, you will need to
re-register it (or it may be re-registered by running a RegCleaner.
Also easy to include in script.

[I create a .bat/vbs file everytime I make a new project. I have them
boilerplated - ie, I just copy one in and change the names.
Been playing with PowerShell lately. Fun but not really necessary.]

e) This has the advantage of insuring you have one and only one true
copy of a product on the developement box. If you have multiple copies
of a Dll laying around - trouble is brewing. <g>
So this first step is simply keeping copies to a minimum.

Clean up is done by regular application of a Registry Cleaner.
below

>2) how can I clean out the registry safely?  Me no want to edit.
>   Reg Clean Apps?
>    a) for free?  links please.
>    b) best Reg Cleaner at lowest price. links please.
>

There are a few free ones on the web. All have a few nuances and
hiccup over something, but in general all work well for your main goal
- and that is check each "GUID" and "AppID/ProgID" entry that provides
a file location and check to see if that file exists and it does in
fact support that item.

But like I said just about all will have an issue with something. For
example, the original RegClean that came with Win9x/2k seemed to get
confused with some Office versions - requiring one to re-register some
components. (Others may care to expand.) But worked well otherwise.

Currently I've been using a utility that comes with ZoneAlarm. In the
past I've used PC Mechanic (Wal-Mart < $30) which is also handly for
managing other Windows configuration issues.
Personally I'd stay away from Norton (oops Symantec) and McAfee
utilities unless you are already using their suites anyway. IMHO they
are slow and bloated. But based on sales that is apparently a minority
opinion. <g>

A few friends really like TweakNow and the price is certainly right
(free).
http://www.tweaknow.com/

hth
-ralph

-ralph
Author
31 Jul 2010 3:10 PM
BeeJ
ralph expressed precisely :
Show quoteHide quote
> On Fri, 30 Jul 2010 16:45:05 -0700, BeeJ <nospam@nowhere.com> wrote:
>
>> So all this VB6 development has left junk all through my registry.
>> OK so I don't know what I am doing.
>> I like to create ActiveX EXEs etc and find the clutter of non-existent
>> references in Project\References.
>> And I cannot unRegester 'cause I screwed up and deleted a project that
>> contained that registered reference.
>>
>> 1) how can I minimize it as I do development?
>>
>
> Like everything else in programming there is no one answer.
> Here is one:
> a) Get into the habit of always compiling a product (.exe,
> ActiveX.exe, ActiveX.Dll) into the project folder.
> Also create a folder off of the project folder called ".cmp" (name
> doesn't matter). This is your "compatibility" folder.
>
> b) Once an ActiveX product's 'interface' is relatively stable copy it
> into the compatibility folder, and change the extension to .cmp.
> This will serve as your "binary compability" component.
>
> c) If you need to test your product in an alternate location on the
> same box, always move it, don't copy it, to its new location. When
> done delete it, or change its name. (I often just use .xxx. You can do
> this with a simple bat file "copy *.exe *.xxx".
>
> d) I often use a simple .bat file to move files.
> If you move a component using the Explorer the registration will
> follow it.
> If you move a component using a .bat or .vbs file, you will need to
> re-register it (or it may be re-registered by running a RegCleaner.
> Also easy to include in script.
>
> [I create a .bat/vbs file everytime I make a new project. I have them
> boilerplated - ie, I just copy one in and change the names.
> Been playing with PowerShell lately. Fun but not really necessary.]
>
> e) This has the advantage of insuring you have one and only one true
> copy of a product on the developement box. If you have multiple copies
> of a Dll laying around - trouble is brewing. <g>
> So this first step is simply keeping copies to a minimum.
>
> Clean up is done by regular application of a Registry Cleaner.
> below
>
>> 2) how can I clean out the registry safely?  Me no want to edit.
>>   Reg Clean Apps?
>>    a) for free?  links please.
>>    b) best Reg Cleaner at lowest price. links please.
>>
>
> There are a few free ones on the web. All have a few nuances and
> hiccup over something, but in general all work well for your main goal
> - and that is check each "GUID" and "AppID/ProgID" entry that provides
> a file location and check to see if that file exists and it does in
> fact support that item.
>
> But like I said just about all will have an issue with something. For
> example, the original RegClean that came with Win9x/2k seemed to get
> confused with some Office versions - requiring one to re-register some
> components. (Others may care to expand.) But worked well otherwise.
>
> Currently I've been using a utility that comes with ZoneAlarm. In the
> past I've used PC Mechanic (Wal-Mart < $30) which is also handly for
> managing other Windows configuration issues.
> Personally I'd stay away from Norton (oops Symantec) and McAfee
> utilities unless you are already using their suites anyway. IMHO they
> are slow and bloated. But based on sales that is apparently a minority
> opinion. <g>
>
> A few friends really like TweakNow and the price is certainly right
> (free).
> http://www.tweaknow.com/
>
> hth
> -ralph
>
> -ralph

Thanks for the insightful advice.  I do not mind paying a little for
something that is excellent.
I will try to retrain myself as you suggest.
I never knew that moving with W E would register.  That has probably
got me in trouble before.
That must be the pay version of Zone Alarm.  I tried the free version
but it created more work than I could stand.  Most of the time I never
knew if I should or should not allow a process access.  I kept getting
those little popups whenever i just looked at the screen (seems like).
I stay away from Norton.  We had MacAfee virus scanner "take home" from
work but now I am retired and do not have access.  Now I use Avast for
that.  Sorry for the rambling.

The bottom line is to reduce the possibility of conflicts.  i.e. a
different ActiveX EXE or .DLL running from the IDE vs running from the
Main App EXE and reducing the clutter in Project\References.
Author
31 Jul 2010 4:20 PM
Mayayana
| The bottom line is to reduce the possibility of conflicts.  i.e. a
| different ActiveX EXE or .DLL running from the IDE vs running from the
| Main App EXE and reducing the clutter in Project\References.
|

  It's unfortunate that there's no option to wait
on registration in the IDE. It's very difficult to
avoid at least a few false listings, and they're
tedious to clean out by hand.

   I just tried the TweakNow that Ralph linked.
It seems to work OK, providing a list of what
it finds before deleting anything. But the program
is ridiculously bloated. 17MB on disk! For a program
that should probably be less than 100 KB. I can't
imagine what's in that EXE.
Author
31 Jul 2010 4:32 PM
Mayayana
| But the program
| is ridiculously bloated. 17MB on disk! For a program
| that should probably be less than 100 KB. I can't
| imagine what's in that EXE.
|

  That got me to thinking. Turns out it's a Delphi
program with crap like this compiled into it:

http://www.tmssoftware.com/site/advglowbutton.asp

  A few KB of functionality and 17 MB of fluff....almost
as bad as .Net.
Author
31 Jul 2010 11:47 PM
Kevin Provance
"Mayayana" <mayayana@invalid.nospam> wrote in message
news:i31j40$gct$1@news.eternal-september.org...
:  That got me to thinking. Turns out it's a Delphi
: program with crap like this compiled into it:
:
: http://www.tmssoftware.com/site/advglowbutton.asp
:
:  A few KB of functionality and 17 MB of fluff....almost
: as bad as .Net.

So much for standard UI look and feel, eh?

What's with with MSFT's RegClean?  I still use it (on XP) and it does the
job.  It event creates a backup reg file which I typically go through to see
what was removed.  If there is something I don't like, I put it back.
Author
1 Aug 2010 4:26 AM
Mayayana
| So much for standard UI look and feel, eh?

  Apparently TweakNow is supposed to look like
MS Office 2007. I don't know why people get so
faddish about every little GUI change that MS makes.
The layout looks clean and functional to me, but
it's actually reminiscent of a webpage -- a bit
cheap looking -- the kind of thing one would design
as an HTA or online AJAX software.

   I don't mind if they want to get "webby", but I get
irritated that people feel free to crowd my system with
such useless stuff, adding a lot of unnecessary 3rd-party
controls.

| What's with with MSFT's RegClean?  I still use it (on XP) and it does the
| job.  It event creates a backup reg file which I typically go through to
see
| what was removed.  If there is something I don't like, I put it back.
|

   Ralph says (above) that it can be problematic with MS
Office. I used to use it years ago, but generally I don't
bother with Reg. Cleaners. I figure that most bad settings
are things that are never accessed and are therefore harmless.
Author
1 Aug 2010 1:51 PM
MikeD
"Mayayana" <mayayana@invalid.nospam> wrote in message
news:i32sui$1re$1@news.eternal-september.org...

>   Ralph says (above) that it can be problematic with MS
> Office. I used to use it years ago, but generally I don't
> bother with Reg. Cleaners. I figure that most bad settings
> are things that are never accessed and are therefore harmless.


Other than bloating the Registry, which can marginally slow down Windows in
general. However, I don't think nearly as much as it used to.

--
Mike
Author
1 Aug 2010 5:23 PM
Mayayana
| > are things that are never accessed and are therefore harmless.
|
|
| Other than bloating the Registry, which can marginally slow down Windows
in
| general. However, I don't think nearly as much as it used to.
|

   I'd be surprised if there's any effect. If I open
Regmon and then open IE I see about 8,000
Registry calls in about 1 second. Oddly, the vast
majority of what happens in the Registry seems to
be Windows -- or MS software -- that just keeps
repeating the same calls over and over again.
Author
1 Aug 2010 8:43 PM
MikeD
Show quote Hide quote
"Mayayana" <mayayana@invalid.nospam> wrote in message
news:i34aej$9d6$1@news.eternal-september.org...
> | > are things that are never accessed and are therefore harmless.
> |
> |
> | Other than bloating the Registry, which can marginally slow down Windows
> in
> | general. However, I don't think nearly as much as it used to.
> |
>
>   I'd be surprised if there's any effect. If I open
> Regmon and then open IE I see about 8,000
> Registry calls in about 1 second. Oddly, the vast
> majority of what happens in the Registry seems to
> be Windows -- or MS software -- that just keeps
> repeating the same calls over and over again.

But that's my point. The Registry is not what you could call an optimized,
well-indexed, database. So, the more it's bloated, the more time-consuming
it is to access anything in it. And as you pointed out, many programs and
Windows itself access the Registry 10s of thousands of times (can't really
put any kind of meaningful number to that because it depends on many, many
factors).

There used to be tools whose sole purpose was to clean and optimize the
Registry.  They claimed to re-organized the Registry files (there used to be
2 files, but I think now there's 3).  I suspect all they really did was
defrag the files, but that's just a guess because Windows' own defragger
wouldn't touch these particular files (and still doesn't AFAIK). But again,
I think this was mostly an issue with Win9x and perhaps Win2000 and became
much less an issue with XP. One thing's for sure and that's that you don't
see Registry *optimizers* touted like you used to, so that can really only
mean it's not the issue it once used to be.

--
Mike
Author
31 Jul 2010 4:38 PM
MikeD
"BeeJ" <nospam@live.com> wrote in message
news:i31ecd$g76$1@speranza.aioe.org...

Please try to remember to trim your quotes to just what's relevant to what
you're writing.  Makes life much easier on everybody.


> I never knew that moving with W E would register.  That has probably got
> me in trouble before.

It DOESN'T register them. And if you recompile before setting binary
compatibility (or have to break binary compatibility because you've changed
the public interface), that's what causes all the orphaned entries in the
Registry.  Same thing can happen if you simply delete files. Easiest rule,
IMO, to remember is to just always unregister before moving or deleting. If
you're careful about always doing that, you won't end up with junk in the
Registry. I always merge the following into the Registry to make this
easier:

**dllfile.reg**
--
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\dllfile\shell]

[HKEY_CLASSES_ROOT\dllfile\shell\Register]

[HKEY_CLASSES_ROOT\dllfile\shell\Register\command]
@="\"c:\\windows\\system32\\regsvr32.exe\" \"%1\""

[HKEY_CLASSES_ROOT\dllfile\shell\Unregister]

[HKEY_CLASSES_ROOT\dllfile\shell\Unregister\command]
@="\"c:\\windows\\system32\\regsvr32.exe\" /u \"%1\""
--


**ocxfile.reg**
--
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ocxfile\shell]

[HKEY_CLASSES_ROOT\ocxfile\shell\Register]

[HKEY_CLASSES_ROOT\ocxfile\shell\Register\command]
@="\"c:\\windows\\system32\\regsvr32.exe\" \"%1\""

[HKEY_CLASSES_ROOT\ocxfile\shell\Unregister]

[HKEY_CLASSES_ROOT\ocxfile\shell\Unregister\command]
@="\"c:\\windows\\system32\\regsvr32.exe\" /u \"%1\""
--

Copy and paste into separate files the text between the pairs of "--"
characters.  Make changes to the Windows path if necessary.  You can use
Notepad for this.  Save the files with whatever name you want, but give them
each a .reg extension.  Double click each file to merge it into the Registry
(must be an Administrator; under Vista, I think you must run these from an
elevated command prompt window or have UAC off; under Win7, depends on how
high a level you've set UAC).  Now, you can right-click any DLL or OCX file
and have Register and Unregister menu commands.  One caveat of this is that
under Vista and Win7 and WinServer2008, it won't work if UAC is enabled. For
me that's not a problem because I turn UAC off.  And of course you must be a
member of the Administrators group even under XP/2000.

> The bottom line is to reduce the possibility of conflicts.  i.e. a
> different ActiveX EXE or .DLL running from the IDE vs running from the
> Main App EXE and reducing the clutter in Project\References.

It's actually very simple and is pretty much what Ralph outlined.  One thing
he said that I don't really understand why is compiling into the project
folder. There's nothing wrong with doing that if that's what you want to do,
but personally, I compile all my production-ready ActiveX components into a
"common" folder named "Distribution".  I also use a common Compatibility
folder too. For me, it's just more organized if they're all in these 2
common folders rather than scattered about in various folders. But there's
really no right or wrong here.  It's just whatever works best for you. And
just to be clear, the files in your Compatibility folder should NEVER be
registered. And unless there's a specific reason not to (for example, you
always want to retain compatibility against a specific version), you should
always copy (never move) your latest build to the Compatibility folder.

The key point to remember is to manually unregister ActiveX files before
moving or deleting them.

--
Mike
Author
31 Jul 2010 6:31 PM
ralph
On Sat, 31 Jul 2010 12:38:18 -0400, "MikeD" <nob***@nowhere.edu>
wrote:


>
>It's actually very simple and is pretty much what Ralph outlined.  One thing
>he said that I don't really understand why is compiling into the project
>folder. There's nothing wrong with doing that if that's what you want to do,
>but personally, I compile all my production-ready ActiveX components into a
>"common" folder named "Distribution".  ...

I suggested compiling to the project folder simply because the OP
reported having problems and the most common reason for having
problems is having multiple copies scattered all over, registered or
not. Having one *place* firmly in mind helps to avoid that. But that
place could be anywhere. So no disagreement on that.

[Also a bit of supersition - VB5 used to have real problems compiling
to 'removeable locations'. If the location disappeared compiles failed
with memory violations. Old news - but some habits die hard. <g>]

Second I tend to develop my install and build packages along side my
projects using a Sandbox approach. Thus during later development if I
need to test a product in a specific environment I install it and not
copy. Overkill for a few components, but a handy habit for a suite.
Fewer surprises come delivery time.

>
>The key point to remember is to manually unregister ActiveX files before
>moving or deleting them.

By controlling copies, I let the RegCleaner sort it out. But the
result is the same, and there is certainly no harm in manually
insuring the correct registration. Wearing suspenders with a belt has
saved many a potential embarrassment. <g>

-ralph
Author
31 Jul 2010 7:08 PM
Nobody
"BeeJ" <nospam@nowhere.com> wrote in message
news:i2vo61$223$1@speranza.aioe.org...
> So all this VB6 development has left junk all through my registry.
> OK so I don't know what I am doing.
> I like to create ActiveX EXEs etc and find the clutter of non-existent
> references in Project\References.
> And I cannot unRegester 'cause I screwed up and deleted a project that
> contained that registered reference.
>
> 1) how can I minimize it as I do development?

One idea if you can't maintain binary compatibility for some reason is that
before you compile, you must unregister the previously compiled file if it's
present. This way you don't see multiple copies in Project\References. You
can make a simple Add-in to always do that, so you don't have to do anything
manually. You can use the following Add-in as a template, and it should take
you 5 minutes to change it. Search the source for
"gobjVBBuildEvents_EnterRunMode", then on the editor's list of events
dropdown list, select "BeginCompile" event. One of the parameters for that
event has a property called "BuildFileName". I am not sure if it has the
full path or not. So in that event, check if the file exits, then shell to
regsvr32 to unregister it. Other things that you need to do:

- Change the project name from "ImmClear", to something else like
"VBAutoUnreg", because this is the component name in the registry, and it
needs to be different.
- Change the project description to "VB Auto Unregister". This will be used
as the Add-in name.
- Delete "EnterRunMode" event code if you don't want the immediate window to
be cleared when you run a project. This is what the Add-in originally does.
- Compile after making your changes, and use the file name "VBAutoUnreg.dll"
- Copy "VBAutoUnreg.dll" to the same folder and change the file name to
"VBAutoUnreg.com".
- Turn on "Binary Compatibility" and select the ".com" file. This is your
binary compatibility copy.
- Follow the ReadMe.txt file instructions on how to make the Add-in appear
in VB.

http://www.lockdesign.co.uk/immclear.htm

One thing to remember is that when you run a project in the IDE, VB6 would
register a special DLL file(VB6DEBUG.DLL), and use it as a gateway for
whatever is trying to talk to the component. So the component user doesn't
even know it's talking to the VB IDE as the details are hidden and
unimportant to the user. When you stop the project or it ends, these
registry entries are removed. When you compile, VB would auto register the
component EXE/DLL/OCX file, so it's ready for use. It doesn't unregister it
at all, so this has to be done manually if needed, or be using the Add-in
above after the modifications.
Author
31 Jul 2010 8:18 PM
BeeJ
Thanks. I will take a look at this.