Link to home
Start Free TrialLog in
Avatar of rspahitz
rspahitzFlag for United States of America

asked on

VBW files

While reviewing a question on Source Safe and vbw files (https://www.experts-exchange.com/questions/20137928/How-to-save-all-windows-positions-in-VB6-using-VSS6.html) I realized that VB is not playing nicely.

My questions is simply: How do you tell VB to update the vbw file?

I know that if you create a new project, it creates one for you.  If you delete the file, it recreates it for you.

However, once it's created, it doesn't always persist windows settings.

For example, if you open a new project, then save and close it, you can reopen it, open the form object and code windows, remove the project and open, and the form object window does not open.  VB also does not ask if you want to save anything, but the location of the code window is saved!

Any thoughts?

Avatar of PaulHews
PaulHews
Flag of Canada image

I think if you close VB the vbw is updated with the last positions of those windows.
Also seems to work if you load another project.
Avatar of rspahitz

ASKER

Well, it seems to save the code window, but not the form object window.  I know I can modify the vbw to force it to stay open, but it certainly should do that automatically.

(BTW I'm still on SP3 so if it works on yours, that might be part of it.)
hmm.  Never noticed that.
Avatar of DanRollins
On VC, I usually get "...blah blah...could not open all of the windows..."  when I start up.  I wonder if it is related to the same thing (the file extension is dsw for the workspace and dsp for the projects).
-- Dan


<offtopic>For some unknown reason, I have an sudden urge to support Oracle 9i?  any Ideas why?</offtopic>
LOL!  I was just in Expert section seeing if anyone added a Q about it.
back on-topic...

It appears that the vbw is always updated when the project is removed or closed, but it only saves the code windows that were open.  All form object windows are set to closed regardless of their previous state.

--
Now, if you add Source Safe into the mix, I suppose that a get-latest/check-out would retrieve whatever was stored in the VSS DB, and would store back (on check-in) a version with all form object windows closed since it takes whatever was stored in the vbw...which seems to never include the form object windows.

Now, to override that, you'd probably have to manually change the vbw, check it into VSS, then never check it in!  Argggh!  (Manual mods to components should not be required.  I wonder how .net handles it...?)

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
em, that's what I'm starting to think.  The vbw really has no relevance to the project other than holding onto the location and state (open/closed) of your code windows.

Still, it would be nice to know how to get it to store the real state including the form state, which seems to always get lost.
by form state, do you mean the Maximized state?
No, form state, as in open or closed, which is a setting of the vbw.  If I edit it by hand, I can remove the last "C" and the form opens when the project loads.  However, if I simply close the project, VB seems to always put a "C" there.
if you edit the file manually and you don't want a form to be opened the next time you open your project, simply delete the lines from the VBW. Maybe there is a non-visible character somewhere around the C.
Well, the point was that I want the VB environment to keep my settings and it doesn't seem to.

Test:
1) Create a project with form1 and save it.
2) Open form1 and the corresponding code window
3) Remove the project
4) Re-open the project

Do you see both windows still open?  On my system, only the code window is open.  Why doesn't VB remember both?  It remembers the window location, but forgets that it was open!
I only see the code window too! As I have said earlier, I often (not to say always) set my VBW as Read-only. This way I always have a clean IDE.
I'll keep this open a few more days to see if anyone else comments.

So far, I like the idea of setting the vbw to read-only after configuring it the way you like it...and don't bother adding it to Source Safe.
The idea of omitting from sourcesafe and setting to read-only seemed like the best choice.  I still don't know why VB won't store my form-open status.