VB6 Best Practices

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Darrel
Posts: 9
Joined: Fri Aug 11, 2006 9:09 am
Location: Hagerstown, MD
Contact:

VB6 Best Practices

Post by Darrel » Wed Oct 25, 2006 7:54 am

We have Vault 3.5.0 (4741) and are using it with VB6. We have been running into issues when trying to work with forms. Specifically being able to merge form files Since there is a .frx file associated with each form that cannot be merged and appears to change constantly.

Are there any best practices that you can recommend when modifying form files? We do not currently use the source control as part of the IDE we are using the Vault client.

Additionally, is there any way to have vault check out a file exclusively once it has been edited by a user?

Thanks
Darrel

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Wed Oct 25, 2006 8:22 am

You can add the extension to the list of mergeable files in the repository options in the Admin tool. If the file is a binary file, Vault will not be able to perform a merge on it.

The general rule with an IDE is that once it is integrated with Vault, you will perform all your manipulative functions from within the IDE. If you bounce between Vault and an IDE, the files could end up being mismanaged. The IDE places some limitations on Vault. It's more of a personal preference for most people which direction they wish to go.

I'm not sure I understand what you mean by checking out a file exclusively once edited. Do you mean when another user has it checked out already? If another user has checked it out, you will not be able to force it to allow you to exclusively check it out. The other user would have to check it in first. If you have checked it out, but not exclusively, and want to change it to exclusive, you would have to check it in and check it out again with the exclusive lock.

Darrel
Posts: 9
Joined: Fri Aug 11, 2006 9:09 am
Location: Hagerstown, MD
Contact:

Post by Darrel » Wed Oct 25, 2006 8:49 am

Beth wrote:You can add the extension to the list of mergeable files in the repository options in the Admin tool. If the file is a binary file, Vault will not be able to perform a merge on it.
The .frx is a binary file.
Beth wrote:The general rule with an IDE is that once it is integrated with Vault, you will perform all your manipulative functions from within the IDE. If you bounce between Vault and an IDE, the files could end up being mismanaged. The IDE places some limitations on Vault. It's more of a personal preference for most people which direction they wish to go.
We like to work in the CVS style where we edit/merge/commit since we generally are not working on the same area of code in a single file very much. That is why we don't integrate with the ide, even for our .net work. And this brought me to my last question
Beth wrote:I'm not sure I understand what you mean by checking out a file exclusively once edited. Do you mean when another user has it checked out already? If another user has checked it out, you will not be able to force it to allow you to exclusively check it out. The other user would have to check it in first. If you have checked it out, but not exclusively, and want to change it to exclusive, you would have to check it in and check it out again with the exclusive lock.
When someone edits a file we can see that it has been edited in the Vault client. Because of the problems with merging the .frm and .frx files we need to only perform overwrites of these file types (no merging). Therefore it would be nice if when someone started editing that filetype Vault would automatically check out the file exclusively for that user so that others wouldn't accidentally start editing a form that someone else is already working on. But we don't want to use check-out/edit/check-in on other file types like .bas and .cls.

I was also hoping to get some input from other users and how they like to work. Is this the appropriate place to ask for other user's input?

Thanks
Darrel

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Looking for user input

Post by Beth » Wed Oct 25, 2006 9:38 am

In the Vault Admin tool, under repository options, you can set that repository to require exclusive locks.

Yes, this is the perfect place to get user input. If you don't get replies after a while, you can always create a new thread with the subject saying something about "Needing User Input on ....<whatever subject here>...." and others might notice it more.

davidt
Posts: 44
Joined: Thu Aug 12, 2004 7:43 am

Post by davidt » Wed Oct 25, 2006 4:53 pm

Hi, Darrel,

We've been using Vault, and SourceSafe before that, with VB6 for about five years.

Unfortunately, edit/merge/commit doesn't work well with any binary files, and VB6 ties .frx files to .frm files pretty closely. It's just going to be a little painful to use a source control model other than what VB6's designers intended.

I would say your best bet to minimize pain would be:

1) Restrict edit/merge/commit to when you are only changing code, not changing form layout

2) Check out the .frm and .frx files exclusively when you need to change form layout
David Thompson
JELD-WEN, inc.

Darrel
Posts: 9
Joined: Fri Aug 11, 2006 9:09 am
Location: Hagerstown, MD
Contact:

Followup

Post by Darrel » Mon Feb 05, 2007 8:53 am

I thought I would post a followup to VB6 form issues. After using Vault with VB6 we established some internal procedures for dealing with VB6 forms. Simply stated, we never merge them.

When a developer starts working on any form we check it out exclusively and when we check the form back in we always check in the .frm and .frx and always choose to ovewrite the file. As long as everyone remembers to check out the form they are working on everything works well, but as with all human ventures sometimes we make mistakes and forget to check out a form and have been forced to redo some changes. This is why an automatic exclusive checkout by file type would have been very helpful.

Even with these precautions occasionally a .frx file will get out of sync with the .frm file. When this happens VB will choke when trying to load the project. If this happens it is important to not save your project just exit it. We have always been able to fix this problem by just reverting to the previous version of the .frx file and the project has loaded just fine.

The final caveat when working with VB6 is to remember to reload your project after getting the latest version of files. VB6 loads all project files into the IDE at the beginning of the session unlike .net which has only the open files loaded and will read any files opened from disk. This applies not just to .frm files but to all VB6 files including .cls and .bas. This means that even though you don't have a file opened in the IDE and you perform a get latest on that file. If you have not restarted your project you will be editing the old file and will overwrite the changes you just downloaded into your project without realizing it.

I hope this helps someone.
Darrel

Locked