Solved

Installing a VB6 App Has Screwed up My VB5 Development Environment

Posted on 2000-03-14
28
369 Views
Last Modified: 2008-03-10


I develop VB5 code on a W98 machine.

I have a VB5 application with many users.  After a recent update of the .exe some people began getting fatal errors when starting the program.  I think I've traced this to new .dll and .ocx files that were replaced on my machine when I installed an application that had been developed in VB6.

It's not practical to have all users change to the new supporting files so, I tried to retreat to my earlier configuration by uninstalling the VB6 application.  It had kept the files it replaced and, said it was putting them back and returning the system to it's original state.

After doing this I cannot get my application to run in the development environment.  Trying to resolve this I've done a fresh installation of VB5 on another computer which has a fresh W98 installation (completely uncontaminated by the VB6 app) and, copied the folder to that computer that contains all of the forms and modules for my application.

I had to reapply the RichTextBox control ( Project | Components | Apply ) which was missing upon initial load into the development environment.  Then, when I try to run it I get multiple errors pointing at the RichTextBox. Here's a typical example:  

                        code item  =  RichTxtBox.SelStart
                        error message  =  Method or Data Member Not Found

The help for this error is not helpful to me.  It seems to suggest a member of a collection is missing but, I can't relate to that.

There's an seeming endless number of these and a few other error messages.  As soon as I rem one out another pops up.  All relate to a rich text box. The environment is calling the rich text box a PictureBox.   Obviously a RichTextBox is not a PictureBox!

I don't really want to debug each of these endless errors one at a time since this code was working properly.  I prefer to understand how to get back to the (everything working properly) condition that existed before I installed the VB6 application that screwed everything up.  Obviously reinstalling the original VB5 condition doesn't achieve this.

This is a wonderful service and, the people here are great but, I've encountered differences of opinion in the past over whether the problem was solved. So, I now try to define what I consider a qualifying solution.  In this case I will consider the problem solved if I can return my system to the condition that existed before I installed the VB6 application

I will resist tests that require major or irreversible changes to my Windows installation.

Thanks for your help
houston
0
Comment
Question by:houston
  • 11
  • 7
  • 3
  • +3
28 Comments
 
LVL 1

Expert Comment

by:ndb
ID: 2616422
I hope you didn't saved your project after reassigning the richtextbox.
What you have to do is open the project without any form in designmodus.
So you end up with a gray screen.
When you now reassign the richtextbox everything should be fine.
0
 
LVL 1

Expert Comment

by:ndb
ID: 2616428
It is indeed so in VB that when you try to open a form in design mode and that control is not assigned, it gets replaced by a picturebox.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616440
Do you have that nasty VB6 app still? If so, look in the SETUP.LST file... It has all of the files that the app put on your system.

you can then do this:

   Delete all of the files that are listed in the SETUP.LST from your system, then uninstall and reinstall VB5...


What's happening is when VB5 is reinstalling itself, some of the system files on your system from the VB6 app are newer than the VB5 files from your CD so they are skipped during installation....




Cheers!®©
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616451
Oh... by the way... If you have a backup of your system before you installed the nasty VB6 APP, You could restore it...


Also, Don't do ANYTHING without backing your system up first!!!


Cheers!®©
0
 
LVL 15

Expert Comment

by:ameba
ID: 2616462
To avoid these problems in the future, upgrade to the last version of VB (VB6 SP3).
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616488
ameba, <G>
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2616550
This article summarizes the compatibility issues between VB 5 and 6

"INFO: Visual Basic 5.0 and 6.0 Compatibility Issues"

http://support.microsoft.com/support/kb/articles/Q217/0/17.ASP
0
 

Author Comment

by:houston
ID: 2616601
TO: ndb

>>>
I hope you didn't saved your project after reassigning the richtextbox. What you have to do is open the project without any form in designmodus. So you end up with a gray screen. When you now reassign the richtextbox everything should be fine.
<<<

I'm not sure I understand.  

When I try to load the program into the environment for the first time it complains that the richtx32.ocx cannot be loaded.  It then puts these errors in the form log:

Line 78: Class RichTextLib.RichTextBox of control rtbTemp was not a loaded control class.
Line 151: Class RichTextLib.RichTextBox of control rtxtDoc was not a loaded control class.
Line 85: The property name _ExtentX in rtbTemp is invalid.
Line 86: The property name _ExtentY in rtbTemp is invalid.
Line 87: The property name _Version in rtbTemp is invalid.
Line 88: The property name TextRTF in rtbTemp is invalid.
Line 157: The property name _ExtentX in rtxtDoc is invalid.
Line 158: The property name _ExtentY in rtxtDoc is invalid.
Line 159: The property name _Version in rtxtDoc is invalid.
Line 161: The property name ScrollBars in rtxtDoc is invalid.
Line 162: The property name TextRTF in rtxtDoc is invalid.

rtxtDoc & rtbTemp are the 2 rich text boxes in my program.

After the load completes the richtextbox is missing from the installed components.  So I add it back in.  After doing this, when I run the code it begins giving the diagnostic errors I explained in my message.

houston
0
 

Author Comment

by:houston
ID: 2616602
TO: ndb

>>>
I hope you didn't saved your project after reassigning the richtextbox. What you have to do is open the project without any form in designmodus. So you end up with a gray screen. When you now reassign the richtextbox everything should be fine.
<<<

I'm not sure I understand.  

When I try to load the program into the environment for the first time it complains that the richtx32.ocx cannot be loaded.  It then puts these errors in the form log:

Line 78: Class RichTextLib.RichTextBox of control rtbTemp was not a loaded control class.
Line 151: Class RichTextLib.RichTextBox of control rtxtDoc was not a loaded control class.
Line 85: The property name _ExtentX in rtbTemp is invalid.
Line 86: The property name _ExtentY in rtbTemp is invalid.
Line 87: The property name _Version in rtbTemp is invalid.
Line 88: The property name TextRTF in rtbTemp is invalid.
Line 157: The property name _ExtentX in rtxtDoc is invalid.
Line 158: The property name _ExtentY in rtxtDoc is invalid.
Line 159: The property name _Version in rtxtDoc is invalid.
Line 161: The property name ScrollBars in rtxtDoc is invalid.
Line 162: The property name TextRTF in rtxtDoc is invalid.

rtxtDoc & rtbTemp are the 2 rich text boxes in my program.

After the load completes the richtextbox is missing from the installed components.  So I add it back in.  After doing this, when I run the code it begins giving the diagnostic errors I explained in my message.

houston
0
 

Author Comment

by:houston
ID: 2616654
TO:  Erick37

Thanks but the article does not seem to relate to my problem.

The when BOTH VB5 & 6 are installed on the same system.

VB6 is not, and has never been installed on my system.  Only an application someone else developed in VB6.  Also, on the test machine I described nothing relating to VB6 has every been installed.

Also, article refers to the following specific problems:

  Following are the known compatibility issues between Visual Basic 5.0 and 6.0:

       o  Running the Visual Basic 5.0 Setup Wizard

       o  The using the Microsoft Windows CommonControls 5.0 (Comctl32.ocx)

       o Creating a Visual Basic Application Wizard project in the Visual Basic 6.0 Learning
       Edition

None of these are involved with my problem.

houston
0
 

Author Comment

by:houston
ID: 2616673
TO:  Erick37

Thanks but the article does not seem to relate to my problem.

The when BOTH VB5 & 6 are installed on the same system.

VB6 is not, and has never been installed on my system.  Only an application someone else developed in VB6.  Also, on the test machine I described nothing relating to VB6 has every been installed.

Also, article refers to the following specific problems:

  Following are the known compatibility issues between Visual Basic 5.0 and 6.0:

       o  Running the Visual Basic 5.0 Setup Wizard

       o  The using the Microsoft Windows CommonControls 5.0 (Comctl32.ocx)

       o Creating a Visual Basic Application Wizard project in the Visual Basic 6.0 Learning
       Edition

None of these are involved with my problem.

houston
0
 
LVL 15

Expert Comment

by:ameba
ID: 2616676
ndb was right
>I hope you didn't save your project after reassigning the richtextbox

You'll have to manually replace your pictureboxes with richtextboxes.
If you do it with version 2.0 (from VB5), I am not sure it will work on PCs with version 3.0 of rtfbox (from that VB6 installation)

Best bet is upgrade to VB6. (I am not MS employee :)
You'll still have to manually replace your pictureboxes with richtextboxes. Or use backup of your work (vb will upgrade your rtfboxes to version 3.0).
0
 

Author Comment

by:houston
ID: 2616701
TO:  mcrider

>>>
Delete all of the files that are listed in the SETUP.LST from your system, then uninstall and reinstall VB5...

What's happening is when VB5 is reinstalling itself, some of the system files on your system from the VB6 app are newer than the VB5 files from your CD so they are skipped during installation....
<<<

As I explained in my message, I have tested on a clean installation of VB5 (including service pack 3) on a clean W98 system that has never had any VB6 files on it.  It doesn't help.

houston
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616702
Again, hopefully you have a backup of your source before this problem occurred...

Are you going to be trying my suggestion??


Cheers!®©
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 14

Expert Comment

by:mcrider
ID: 2616710
Actually shared files do not get deleted when you uninstall...
0
 

Author Comment

by:houston
ID: 2616719
TO: ameba and mcrider

>>>
To avoid these problems in the future, upgrade to the last version of VB (VB6 SP3)

<G>

<<<

Wisecracks are not helpful.  

As I explained in my original post, this would require all users to upgrade to the VB6 fileset which creates a major problem for me.

houston
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616788
houston,

I never said anything about upgrading... and haven't "wisecracked"... :-(
0
 

Author Comment

by:houston
ID: 2616811
To:  mcrider

>>>
Again, hopefully you have a backup of your source before this problem occurred...
<<<

I usually keep 3 weeks worth of backup plus major releases.  I currently have backups of 3 stages of the source but all are after the day the VB6 application was installed.  It took about a month for the problem to surface.  The program worked on my machine because I have the newer files.  I only distributed updates so some users about a week ago causing the problem to surface and it took me the week to figure out what the problem was.  

 The only backups I have prior to the VB6 application are probably a hundred hours of coding back.

houston
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2616889
a month worth of coding!?! Ouch!

You said earlier, "I had to reapply the RichTextBox control".

Did you also delete it RichTextBox from the forms you're using them on, remove it from the project, save the project, and then add them again??

There is no problem loosing code if you do this... Any event's you have programmed in those controls will move to the declarations section until you add the controls back.  Just remember to name them the same as the RichTextBoxes you delete...



Cheers!®©
0
 
LVL 1

Expert Comment

by:ndb
ID: 2616950
That's what I meant with not opening the forms in design time.
If you didn't save that project, do what I told you before, and your pictureboxes won't be pictureboxes anymore but Rich Text boxes.
But you have to make sure you didn't open the forms in design time.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2617030
I'm not sure that houston has understood what happened exactly, and how to minimize the chance of having a major problem in the future, and maybe where they stand now with the current app, so let me try to recreate the scene of the tragedy.

When you installed the VB 6 app on your machine, it replaced the RichTextBox control with a newer version (with a different CLSID).  The next time that you opened your VB 5 application in VB 5, it couldn't load the RichTextBox control referenced by the old CLSID (or is it GUID?) because it had been moved to some backup directory, and the registry had been updated to point the RichTextBox class to the new CLSID.  

When VB couldn't load the control properly, you should have received several error/warning messages from VB as it tried to load each form that had this control on it.  If you chose to continue to load the project anyway, VB would have converted all of your RichTextBoxes to Pictureboxes and it would create .LOG files for each form with messages saying it couldn't load the RichTextBox control.  As soon as you tried to compile or run you'd start to get a million messages about invalid properties or methods, because a picturebox does not have the same properties/methods as a RichTextBox.

At this point, what you should have done is exit VB WITHOUT SAVING ANYTHING.  This will allow you to try to restore you're old RichTextBox control, and then open your app in VB again without any problems.  

Or, if you are unable to restore your system back, then you can manually edit the .VBP and .FRM files in a text editor, and change the old CLSID to the new CLSID, which will allow VB to load the control properly when it opens your project (and will keep it from replacing the RichTextBoxes with Pictureboxes).

OK, let's say that you made the mistake of saving your project after VB had replaced the RichTextboxes with Pictureboxes.  You could either go back to an earlier backed-up version of the source, or, bite the bullet and go through every form and delete the Picturebox and replace it with a RichTextbox - making sure to name it back to it's original name - so that all of the Event code you have will be put back in the proper place.

If you do this without restoring your system back to the pre VB 6 app installation, then you'll be using a new RichTextBox control version, and this new control may have to be installed and registered on each of your users machines.

If you have decided to restore you system back to the pre VB 6 app installation, it's not enough to get the right OCX/DLL, but you have to make sure that your registry entries for the CLSID of the RichTextBox class is equal to what was installed on the user's machines.  

You should probably go to a user's machine, run REGEDIT, search for RichTextbox and copy down the CLSID listed.  Then, go back to your development machine, after restoring it to the plain VB 5 state, and check your registry to ensure that you have the same CLSID for this class of control.  If you have any other registry entries for the RichTextbox with other CLSIDs then you might want to delete those items from your registry and re-register the RichTextbox control (I think that the program regsvr32 is used for this, or, you can open up a new project in VB, and add the RichTextBox as a reference - and if it isn't in the reference list, then click the browse button and go and find the OCX/DLL that it lives in - this will do the same as regsvr32).  They always say "be careful to backup your registry before doing any edits as making a wrong edit can hose  your whole system" so consider yourself warned, however, I've never had a problem.

Once your registry CLSIDs match the users, and once your registry CLSIDs match what is referenced in your .VBP and .FRM files,  you should be able to open your project and compile and send out updates of your EXE to users without any problems.
0
 

Author Comment

by:houston
ID: 2617048
To: ndb

I appreciate your help but, I'm sorry, I don't understand what "make sure you didn't open the forms in design time" means.

I don't know how to "open the project without any form in designmodus."  When I open the project it automatically loads the development environment and all the forms.

houston

0
 

Author Comment

by:houston
ID: 2617120
To: mdougan

Thanks you very much for your reply.  I think I understand enough I may be able to fix things.

However . . .

>>>
When you installed the VB 6 app on your machine, it replaced the RichTextBox control with a newer version (with a different CLSID).  The next time that you opened your VB 5 application in VB 5, it couldn't load the RichTextBox control referenced by the old CLSID (or is it GUID?) because it had been moved to some backup directory, and the registry had been updated to point the RichTextBox class to the new CLSID.  

When VB couldn't load the control properly, you should have received several error/warning messages from VB as it tried to load each form that had this control on it.  If you chose to continue to load the project anyway . . .
<<<

It gave me no warnings whatsoever, none-nada.  

The warnings only began weeks later, AFTER the problem surfaced and, I figured out the control files had been replaced and, traced it back to the VB6 app and uninstalled it.  That's when it started issuing all the error/warnings you list.

Had VB warned me something was wrong the first time I opened the application after the files had changed I wouldn't have proceeded.  But, even if I had, at that time I had at least 3 current backups to recover with.  Because I got NO warning when it changed all these references, the problem didn't surface until weeks later after malfunctioning copies of the application had been distributed and, all backups had been replaced with more current backups.

Thanks again.

I'll let you know how things go.

houston
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2617741
Ouch.  I've heard that some controls are supposed to automatically update your project to include the latest version of the control if it's available (in case you got an upgrade).  This sounds like what happened, but I'm concerned that it didn't give any warnings and yet replaced the controls with pictureboxes.  Did it ever generate .LOG files for the affected forms?  Are you sure nobody else opened the app and saved it?

It sounds like you took all due precautions, I'm wondering if it has anything to do with Windows 98, as I haven't heard of this happening on another platform... let me know how it goes!
0
 
LVL 15

Expert Comment

by:ameba
ID: 2617804
>Wisecracks are not helpful.
Sorry, I was not joking. The similar thing happened to me in the past. One office installed new MS network related software, upgraded many components on all PCs, and my VB4 software stopped working - some components were not compatible to their previous versions (e.g. MS Chart control).
I had to upgrade to VB5.
0
 

Author Comment

by:houston
ID: 2617814
To:  mdougan

It appears to be fixed.  Simply changing to the correct CLSID reference alone didn't do it.  I still got the same error messages/behavior.   But, as it turned out the VB6 app had not removed it's keys when it was uninstalled.  Though I had pointed to the correct (VB5) key, the VB6 keys (two of them??) were confusing it.  RegClean might have removed them but I removed both manually and then everything worked.

I can't thank you enough.

Lock the question and I'll give you the points.

houston
0
 

Author Comment

by:houston
ID: 2617823
To all:

Thanks for your efforts and I'll be posting a followon question tomorrow.

houston
0
 
LVL 18

Accepted Solution

by:
mdougan earned 200 total points
ID: 2618122
Great!  Thanks, here it is.

You should probably go to a user's machine, run REGEDIT, search for RichTextbox and copy down the CLSID listed.  Then, go back to your development machine, after restoring it to the plain VB 5 state, and check your registry to ensure that you have the same CLSID for this class of control.  If you have any other registry entries for the RichTextbox with other CLSIDs then you might want to delete those items from your registry and re-register the RichTextbox control (I think that the program regsvr32 is used for this, or, you can open up a new project in VB, and add the RichTextBox as a reference - and if it isn't in the reference list, then click the browse button and go and find the OCX/DLL that it lives in - this will do the same as regsvr32).  They always say "be careful to backup your registry before doing any edits as making a wrong edit can hose  your whole system" so consider yourself warned, however, I've never had a problem.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now