Autosaving a project in VB6
I know it's a lot to ask, but is there any way (even with another program, which might be preferable) to make VB6 IDE save the project every X minutes? If this isn't possible, instead is there any way of "accessing" the project's data in memory with another program so that it can be backed up by that program without affecting the user's flow (so they don't even notice it happening, they just know it is going to happen regularly and keep their code safe)?
I think sendmessage might be too intrusive if the user is actively writing a program and if they're running their program (granted it doesn't need saving) the sendmessage might cause unexpected results.
This is part of a larger project I am considering working on, and if it all seems doable there'll be a few more questions coming from me in the near future as I work on it, and the eventual end design will be free for anyone to use and MAYBE open source if people don't give any good reasons for why it shouldn't be...I'm happy with it being open-source myself :-)
Re: Autosaving a project in VB6
smUX
Here's an off-the wall idea for you...
Have another app running in the background.
--It would sound a bell at the X minute interval to alert the programmer.
--It would then use CursorPos to move the mouse to the Save button on the IDE, and click it.
There are probably several issues here, and might not even work (I haven't tried it).
But, worth a shot?
Alt #1: Just have a modal MsgBox pop-up with the message--
Time to save, you knuckle-head.
Spoo
Re: Autosaving a project in VB6
I'm looking more for something that doesn't distract the programmer from his/her task rather than something that reminds them to save or interferes with their coding, although if I can't find a workable solution I'll probably have to stick with a reminder instead. I'm sure there's a way to access the memory and extract the data directly, just it's too much of a mammoth task for me to even think about trying :-)
Also, I am planning to set up this external program to save incremental changes so if you made a mistake in coding you could easily go back to an old version if required, or if it saved at the worst possible time you'd have an old backup to go back to.
Re: Autosaving a project in VB6
smUX
OK.. it was a rather blunt instrument of an idea.
What about this..
Have your "external" app simply read all of the files in the project.
I've done this with .FRM files - they're really just text files. I imagine
that all other types (.BAS, .FRX, .VBP, .VBW, etc) are likewise just
text files.
Then it could create a parallel set of files (with appropriate extensions),
perhaps in a separate subdirectory.
To carry this out to an extreme, and to facilitate your "go back to older version"
idea, just create multiple subdirectories, one for each version being saved.
Spoo
Re: Autosaving a project in VB6
Quote:
Have your "external" app simply read all of the files in the project.
I've done this with .FRM files - they're really just text files. I imagine
that all other types (.BAS, .FRX, .VBP, .VBW, etc) are likewise just
text files.
until you save the project files the above are not updated
there is built in provision, to autosave on running the project which will prevent losses on crashing the ide
menu > tools > options > enviroment > save changes
i believe it would be possible to do a timed save using a VB6 addin
Re: Autosaving a project in VB6
I was considering backing up the saved data files, although that still requires the user to be a regular file saver. I was also thinking about watching each file's last access time and only backing up if the times had changed.
Also, I would probably work on a differential incremental backup, so only the changes to the data is saved each time rather than having to save the whole thing each time and waste space...in theory that could amount to months and months of backups only taking up maybe double the space of the actual original file :)
Hopefully someone else has an idea of a way to "force" VB6 to save the program without user intervention or a way to access the data in memory, as that'll probably be the most efficient way to do it.
Quote:
Originally Posted by
westconn1
there is built in provision, to autosave on running the project which will prevent losses on crashing the ide
menu > tools > options > enviroment > save changes
That might be useful to point out to people, it'd ensure a little bit of extra security :)
Re: Autosaving a project in VB6
I'm not sure how good an idea the autosave would be. You can do a lot of work before you save, and some of it could be bad and damage the old/good code. If at any point you wanted to revert to the original you could close (without save) and reopen the project. Without save this won't be possible.
Re: Autosaving a project in VB6
Quote:
Originally Posted by
westconn1
until you save the project files the above are not updated
Picky, picky...
Of course, you are correct.
Spoo
Re: Autosaving a project in VB6
Quote:
Originally Posted by
baja_yu
I'm not sure how good an idea the autosave would be. You can do a lot of work before you save, and some of it could be bad and damage the old/good code. If at any point you wanted to revert to the original you could close (without save) and reopen the project. Without save this won't be possible.
Except what I am trying to accomplish is an *incremental* backup system where every time the files are backed up a copy of the PREVIOUS save is safely stored and only the changes are stored...if you ever want to go back to a previous version it'll be there readily available for you :P
Re: Autosaving a project in VB6
Quote:
Originally Posted by
baja_yu
I'm not sure how good an idea the autosave would be. You can do a lot of work before you save, and some of it could be bad and damage the old/good code. If at any point you wanted to revert to the original you could close (without save) and reopen the project. Without save this won't be possible.
I had a similar idea floating around in my mind..
What if the save occurs at "mid-sentence" when writing
a line of code. It would never be compilable.
There must be a reason why MS only gave the options that WC
referenced above, and left out an AutoSave on a timed basis.
Spoo
Re: Autosaving a project in VB6
It may not be compilable but at least it'll contain the bits of info you need to make it compilable. Also, in theory you could complete a partial line by looking at the differences in each line between two backups and calculating what the full line should be based on the differences...and you could just as easily save code manually that isn't compilable anyway, coders usually know what needs to be done to their own projects to fix the problem
Re: Autosaving a project in VB6
Quote:
Originally Posted by
smUX
Except what I am trying to accomplish is an *incremental* backup system where every time the files are backed up a copy of the PREVIOUS save is safely stored and only the changes are stored...if you ever want to go back to a previous version it'll be there readily available for you :P
What you are referring to is called revision control. It's what the now defunct SourceSafe was meant for, and what MS Team Foundation Server is used. Others include CVS and the popular Subversion.
Take a look here: http://en.wikipedia.org/wiki/Compari...ntrol_software
Re: Autosaving a project in VB6
smUX
Given the foregoing, I would guess that your principal
remaining option is the alternative you proposed in your
OP, that is, to access memory, as this is where changes
would reside prior to physically saving changes.
Sadly, that is way above my pay grade.
I imagine that it is doable, though.
Spoo
Re: Autosaving a project in VB6
Quote:
Originally Posted by
baja_yu
What you are referring to is called revision control. It's what the now defunct SourceSafe was meant for, and what MS Team Foundation Server is used. Others include CVS and the popular Subversion.
They look like the sort of thing I intended to work on, pretty much, but I like to do these things myself even if it never actually gets used...I like the practice and a challenge, and it's the way I learn new tricks...plus it'll do exactly what I want it to do :)
Quote:
Originally Posted by
Spoo
Given the foregoing, I would guess that your principal
remaining option is the alternative you proposed in your
OP, that is, to access memory, as this is where changes
would reside prior to physically saving changes.
Sadly, that is way above my pay grade.
I imagine that it is doable, though.
Above mine too, sadly...I have a basic idea of peeking memory and the basic idea of what needs to be done, just not how to do it exactly or how to find the required pointers to the section of memory to peek if I even knew how to do it in VB6...I used to be able to do it in old BASIC systems, which is how I know the basics of it :)
Re: Autosaving a project in VB6
There are a lot of them that are open source, but I doubt any were written in VB. Mostly C++. If you know it, you can peek at their code and see how they do stuff.
Re: Autosaving a project in VB6
Try:
Auto File Save Add-in for Visual Studio 6.0
it save your project every 5, 10, 15 minutes, etc.
Re: Autosaving a project in VB6
Quote:
Originally Posted by
smUX
but I like to do these things myself even if it never actually gets used...I like the practice and a challenge, and it's the way I learn new tricks...plus it'll do exactly what I want it to do :)
My kind of guy!
Quote:
Originally Posted by
smUX
Above mine too, sadly...I have a basic idea of peeking memory and the basic idea of what needs to be done, just not how to do it exactly or how to find the required pointers to the section of memory to peek if I even knew how to do it in VB6...I used to be able to do it in old BASIC systems, which is how I know the basics of it :)
All right -- game on.
I'm knee deep in another project, but am willing to join the fray.
Hope that'll be ok -- my off-and-on attendance, that is.
Spoo
Re: Autosaving a project in VB6
Quote:
Originally Posted by
C0der
Try:
Auto File Save Add-in for Visual Studio 6.0
it save your project every 5, 10, 15 minutes, etc.
That coupled with the incremental backup might be a good solution :)
Quote:
Originally Posted by
Spoo
All right -- game on.
I'm knee deep in another project, but am willing to join the fray.
Hope that'll be ok -- my off-and-on attendance, that is.
I tend to do coding projects on my own, my coding styles and sloppy methods don't always work well for other people, but if the code is open source (which it probably will be) then people can do what they want with it :)
Re: Autosaving a project in VB6
smUX
I wonder if this post might be a place to start.
In particular, MEMORY_BASIC_INFORMATION -- I just did a search on that.
Spoo
1 Attachment(s)
Re: Autosaving a project in VB6
Ok, if you think you can use it, here you have it.
Re: Autosaving a project in VB6
Quote:
Originally Posted by
Spoo
I wonder if
this post might be a place to start.
In particular, MEMORY_BASIC_INFORMATION -- I just did a search on that.
Looks like it could be useful...if I decide to work on it I'll try to make use of it. I'm thinking about making it so the person prefixes their code with 'startbackup and suffixes it with 'endbackup so it has something to search for...I'll work all that out when the time comes though :)