When an app stops in debugging mode and I make changes to the code
Is there a way to save the code with the changes, without stop the app?
Although the VB6 IDE does not provide this natively, an add-in for the IDE called MZTools has been around for ages which adds this feature.
Personally I've used MZTools 3.0 for many years, and this works really well.
This is what its help system says:
Shortcut To Save File At Debug-Time
The Shortcut To Save File At Debug-Time feature allows you to define a keyboard shortcut (Options
window, Shortcuts tab) to save the selected file at debug-time. The
Visual Basic IDE does not allow to save files at debug-time, but often
it is useful to save the modifications that you have made to the
source code at debug-time.
Remarks:
This feature is not available in the VBA version of MZ-Tools. This
feature only works at debug-time. Since Visual Basic disables buttons
or menus of add-ins at debug-time, the only way to save a file at
those times is through a keyboard shortcut. The file must be
previously saved at design-time, that is, MZ-Tools does not prompt for
a name to save the file (it shows an error message instead).
This is the options window for how I have it configured locally:
Note that originally MZTools was free in version 3 and later they switched to a paid version; if I hadn't gotten v3 originally however it would be well worth paying for, not only for this feature.
The short answer is you can't.
If you make the project before the crash, maybe this piece of code can be found in a ".tmp" file. But searching in .tmps is often a waste of time.
I particularly always force myself to stop the debug and save my progress.
And I always use this setting which forces me to remember to save:
I asked Textmate to load something much too large for it and then forced the application to quit. Now, when I reopen TextMate, it keeps trying to load that file and consequently can't open.
How do I reset the state of Textmate, so that it won't try to open this file?
Am not sure of the older versions but latest version of Mate has an option skip restoring of old files on reopen by holding the Shift button.
You can enable that feature in preferences under At startup
When you hold Shift you'll get an alert like this, which will help you skip reopening of large files.
I hope you already found this solution on your own.
What happens in VSC15 is a filename[stale].cpp is created and stepped through instead of the main edited file. This wouldn't be a problem except it not longer allows me to see any of the values of any variable when I mouse over or watch it making live debugging significantly less useful for me.
What used to happen is you'd be stepping through and the yellow cursor would just be some amount of lines off of where it actually was based on the compiled version of the file. I could still see all values so long as they were in memory.
Is there any way to get this functionality back? As it stands now I need to completely restart the app every time I make a change (frequently) if I want to still see any valuable debugging info.
Edit and Continue is also arguably not a solution.. Wish it were.
You should be able to get the behavior you're looking for (make changes to your source but not use Edit and Continue) by disabling the debugger option Debug > Options > Enable Native Edit and Continue.
Having this option disabled won't bring up the "Edits were made that could be applied..." dialog, but will instead silently ignore your edit and not go into any stale code.
I've answered your linked question, so I hope Edit and Continue is a solution :)
-Ramkumar,
Visual Studio Debugger
When running P4Merge, the comparison method is always initially set to 'Recognize line ending and white space differences' (aka all changes). I want to use 'Ignore line ending and white space length differences', but I have to manually re-set this every time the tool runs.
I have changed the setting:
with the toolbar button
in the preferences dialog
on the File menu
and it never sticks. In fact, the preferences dialog entry is reset every time I go back to the menu, without even closing the program. I have changed the setting before using the Exit command from the File menu and before closing the window, and also before saving a merge.
In the past I was able to save my setting and have it be remembered, unfortunately I don't have any recollection of the software version involved. I was using P4Merge as standalone and none of the rest of the Perforce suite was installed.
I can update with any other supporting information that might prove relevant.
[Edit: It's the radio button setting in the preferences dialog that ignores changes and resets every time it's viewed, not the File submenu.]
If you are in Unix/Linux, I would blow away the .p4merge directory in your home directory, which stores all your preferences. In Windows, I'm sure there is a similar directory in your home folder. Sometimes things can get out of sorts in that directory, and cleaning it out could help. After doing so, try saving your preferences again (do it via Edit -> Preferences to change the defaults) and restarting p4merge.
If that doesn't work, it could be a buggy version.
It looks like this issue was fixed in 2013.3. I ran into this issue, updated to the latest version of P4, and the problem was resolved.
I still have to use the VB6 IDE.
Unfortunately every time I start the IDE one of the buttons of the toolbar disappears. Almost always it's the Run button which goes first. Sometimes also items from the menu bar or the context menus are missing.
I have to reset the toolbars almost every time I start the IDE (Which is quite often during a typical work day). Recently I bought an IDE plugin which modifies the menu bar and requires a restart after every reset of the menu bar. (Otherwise it would crash)
I could live with just the resetting, but the restart is really annoying.
Is there something I can do?
To solve this problem:
Unload all add-ins.
Right-click on a toolbar and select the Customize... menu.
For each toolbar click the Reset... button (6 times in total).
Reload the add-ins.
For me action 3 was enough.
cf. MZTools faq (thanks to Andrea Bonafini), but these steps are originally from MSDN
It sounds like you recently bought a bad add-in. Can you get your money back? Every time I've had problems with disappearing controls in the IDE it has been due to a bad add-in. You can find out which one it is by disabling them, one by one, each time using the IDE for a while, then re-enable it and disable the next one, until the problem stops.
I still use one problematic add-in. It exhibits behavior similar to yours in that it makes the run button disappear. I avoid the problem by only loading the add-in when I need it, use it (it formats code), then I immediately unload it. If you don't use the functionality of the add-in that often, this could be an acceptable workaround.
Yea, i have this same problem with one of the add-in. But if you reset it. Shut the IDE down and open it back up again without doing anything, the IDE shouuld be able to retain the previous clean setup.
It's just guest, but:
Each graphical element on IDE (like button) is kind of resource (i.e. GDI handle).
Maybe your VB app doesn't manage these resources good enough and after sometime VB IDE cannot redraw elements like buttons (run is used often).
Also, maybe some IDE add-in is in conflict with some other add-in/application and breaks something -- I have this problem with Clip-X and MZ-Tools.
I had a similar problem when I was setting up the IDE to use for the first time, though it may not be helpful if you've been using the same IDE for a while. When I first started using the IDE, I would modify the toolbars and then close the IDE. When prompted if I wanted to save the open file I always said No, since the file was just a dummy file I was using to open the IDE with. Turns out the IDE was saving the toolbar preferences with that file, so they never got saved.
Try opening a file, customizing the UI, saving the file, then closing without modifying the code. This was the solution for me.
I've tracked down the problem and as suggested it was an add-in.
The problem went away as soon as I disabled the Visual Basic 6 Resource Editor.
How to restore your VB6 IDE without reinstalling:
Run Regedit
Find the entry for Visual Basic 6.0
Export your settings in case things
go wrong
Delete the 'UI' setting
Run VB and you will have your popup
menus back
The 'Find' button disappeared from my VB6 toolbar forcing me to select the Edit menu to use Find. I had two add-ins enabled: vbCodePrint and ResourceEditor; so I did away with both of them, turned VB6 off and back on, then put both add-ins back in and my button returned.
If you're still using the VB6 IDE, and I do amongst others, then this problem is not likely to have gone away. I use VB6 in Windows 10, and the problem is still there. But it doesn't affect me anymore.
I have had this problem a few years into using VB5 and VB6. Today, if I start VB6 directly, it may work fine the first time, but buttons will go missing the second time -- ALWAYS.
My solution, which I developed from day one:
Do whatever needs to be done to restore all your buttons. Save the Visual Basic 6.0 registry settings to a file, as suggested previously, and only keep the UI entry. Sometimes, you have to exit VB6 for it to post changes to the registry. So if this doesn't work the first time, try exiting before saving the settings.
I use my own program to launch VB6, which automatically copies my VB6 registry backup back into the registry -- by calling "RegEdit.exe /S D:\VB\IDE_Fix.reg" -- before I launch the IDE . This works every single time, and requires no action on my part.
If you read this, that means you are a programmer. You can make this work by yourself.
Mike
Reinstall,clean registry and update with SPacks etc....