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 :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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
Last edited by Spoo; Mar 26th, 2010 at 03:16 PM.
Reason: add Alt #1
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.
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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.
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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.
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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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'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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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.
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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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.
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.
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
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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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.
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!
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.
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
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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
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
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.