Hello,
Is it possible to increase number of undo levels in VB IDE like most normal programs can?
By search through options, tools etc. I can' t find this option.
Maybe registry, some "ini file" or what?
Thanks, nime.
Printable View
Hello,
Is it possible to increase number of undo levels in VB IDE like most normal programs can?
By search through options, tools etc. I can' t find this option.
Maybe registry, some "ini file" or what?
Thanks, nime.
No there isn't but you can use Source Safe Control that you will find in Add-Ins|Add-in Manager.
One comment: SourceSafe needs to be installed, as I recall it is part of installation but it doesn't get selected by default.
When I open my projects IDE asks me "do you want to... ... source safe". That could mean that it is installed by default?
I allways say no.
Please in few short words: what is Source safe and why is useful regarding of undos?
I allways backup my projects by hand. Well, almost allways :)
Source Safe is a good version control (aka "code backup") system, which lets you easily compare code files to previous versions (which could be used for undo's, but not easily), lets you have multiple people work on the same project at the same time, and much more. It does sound like you've got it installed already.
In terms of the amount of undo's that the IDE gives, I've never seen a limit - except for the last point that you saved the project.
So it is... it seems that with my coding style I don't have the need for undo that many times in a row.
Neither do I for that matter... :) I just like exploring options.
Of course, I also don't need powerful undos every day.
Maybe it is not needed for coding 1000 files, and then "those one" will come, when you realize that you need it but you haven't this option...
Thanks for describing situation and explanations to all.
nime.
Yes we can. :bigyello:
I just extended the available undo steps from 20 to 23.
Probably to what it was originally intended.
Or that's an other M$ joke a-la:
Quote:
640 K ought to be enough for anybody.
Anyway let's take it as a challenge and debug that bug. :afrog:
Wow I can't believe it that *** ba*** at Microf*** harded that value.
So were's
The long part
#1 go into VBA6.dll.EbGetRedoText and follow next call after call EbMode - I'll name that IsUndo
1a inside IsUndo follow first two conditional Branches 'Jnz'
1b you'll get to some location where there is push 1;pop eax; jmp back
1c from there about 9 command below there is <83FB 14> cmp ebx,14; <0F87 xx> ja [far above]
->patch that 0x14 (20 as Decimal) to what you like
Code:0009D9B1 83FB 14 CMP EBX, 14
0009D9B4 0F87 43C1FCFF JA 00069AFD
0009D9BA 8B4D 0C MOV ECX, [EBP+C]
#2 Now the allocation part - without that patch the previous will just crash at more that 20 entries...
2a well right at IsUndo there is some MOV EAX, [...] at +14 UndoObject +18 RedoObject at some objects I set a hardware breakpoint on write to get to the location that set's these values.
Alternatively you can search for Command 'ADD EDI, 19' which seem to be pretty unique to located the same function I got in with the hwbp on write. hardware breakpoint on write. Search for const '0DEB9' should also lead you to there. I just labeled that function 'Store Undo'.
2b find references to Store Undo. Here there are 5. Check them all for their parameters. That last has as Arg5 some 'PUSH 14' that the second patch target.
Change that 14 to the same value you patch in at patch #1.Code:0012B304 6A 14 PUSH 14
0012B306 50 PUSH EAX
0012B307 6A 00 PUSH 0
That's it.
Tools: Ollydbg or X64dbg or IDA.
If you're lucky and got also version 6.0.9782 of vba6.dll you may also just use some hexeditor slam in the offset from above and hope the bytes there are same and so suitable for the two patches.
...and the short one
https://player.vimeo.com/video/256087873
:eek: This f** Vimeo tells me i'm a :spam:spammer:spam: - well anyway I think you'll get it even without the video.
So here's a Dup2 Patch that will do these two patches:
http://www.mediafire.com/file/s99dob...s_to_128_1.zip
Best would be if you could make an add-in that tries to patch VBA6.dll in memory (and probably notifies on failure).
That would be very useful IMHO.
cheers,
</wqw>
Sorry: why can't download the file "VB6-ide_fix_undos_to_128.zip"? Is it a broken link?
Hmm seem that the attachment system here on this board is broken.
-> It somehow tries to show the attached zip as an image. But in the end there is nothing than a blank screen shown
-> Reuploading the file also silently fails without any error, I also rename the file before uploading but it's the same
-> there is no delete option for your attachments, I have not tested if that auto delete unlinked attachments after one hour works. I my eye such a clean up is nice, but just relaying on that is somehow ******. I want delete button so I can keep order - now. I don't wanna wait one hour until old crap get's maybe deleted.
Well in the end I uploaded it at mediafire and posted the link here. >So also guesses may access it.
I guess that is not possible. Normally such plug in interfaces can only access certain functions/areas.
I've not checked the specs yet but I've doubts that an addin / plugin can gain complete control about undo & redo.
What is possible to encapsulated this patch as some in-memory-patch. So as soon as plugin main is executed it seek in VBA6.dll.text for the required patch pattern to apply these two patches.
Thats more effort and gives more room about what can go wrong.
I like the static way. There is a patched VBA6.dll and the original VBA6.dll.bak for reference and backup.
But yes there is that addin that'll enable the scrolling with mouse wheel that function seems to go beyond the scope a 'normal' add-in. Someday I may have closer look to this.
This links leads to a page where you can read:Quote:
So here's a Dup2 Patch that will do these two patches:
http://www.mediafire.com/file/s99dob...s_to_128_1.zip
Quote:
"Dangerous File Blocked
The file you attempted to download was determined to be dangerous. For your protection, MediaFire does not enable distribution of dangerous files.
Still have questions, or think we've made a mistake? Please contact support for further assistance."
cwk2,
very useful instructions - thanks much.
Environment: VB6 Enterprise German with SP6 installed on Win10 (v.1709) and vba6.dll v.6.0.9782.
I did a short, sucessful test and would like to share my experience.
As usual, in IDE I was able to do 20 undos only (=Hex14).
Open vba6.dll with a good hex-editor (certainly after you made a backup copy of vba6.dll).
Search for hex-sequence "83FB140F8743C1FCFF8B4D0C". For me, it starts at offset 0009D9A5.
Change "14" to "80" for example.
At this point and in contrary to your suggested changes of part 2, there was nothing more to do for me.
In IDE, I was able to do 128 undos (no crashes).
In spite, when these were applied a MessageBox appears before any input in the IDE (Translated: Warning. Process cannot be reverted. Are you sure?).
However, I could find your hex-sequence "6A14506A00" at offset "0012B2F6".
Zphere
Can you re-post the file? The VBForums attachment is broken (it's not the forums, all the other threads with attachments work... not sure what happened here, maybe the name? sometimes normal looking names cause weird problems here) and MediaFire blocked it as malware.
Have followed the instructions and can confirm it works. I've made it available to download with the links below as the forum does not allow DLL files and only 500kb zip files.
To make the changes I used a hex editor called HxD:
Run it as administrator, open the vba6.dll file, search for 83FB140F8743C1FCFF8B4D0C (remember to change the datatype to hex values on the search screen) and change the 14 to 80, then save it.
Actually, the forum doesn't just not allow compiled code. We also don't approve of linking to compiled code unless the source is included (and then only over in Utilities) or if it is posted on GitHub. The reasons for this are a bit complicated, and would likely start a fire. Essentially, we can't say anything one way or another about compiled code, and don't want the links on the site in case there is something bad in them.
If you can post the source, we'd be happy to see it, just not with compiled code.
Thanks to this information, I've been able to completely remove the Undo/Redo limitations in the IDE. While your patch is limited to 127 operations, a very simple tweak on the first section patching to CMP EBX, 0 and JB instead of JA will allow the IDE to always perform undos and redos. From my testing this appears to be stable, I've filled the IDE up to 50k lines in a single module and was able to undo and redo without issues.
So again, very nice find!
Anyone who wishes to get ahold of my patch may do so through the ModernVB release thread, as it is now officially a feature of my modpack:
http://www.vbforums.com/showthread.p...29#post5471629
Which reminds me that the in-memory patching for your add-in is much more preferred than modifying executables on disk.
If I might guess at least 95% of potential users are not willing to take this risk if only imaginary as backups are trivial to make. (The other 5% are using french editions and are failing anyway:-))
cheers,
</wqw>
The only reason it wouldn't work is if you're not running the SP6. Since VB is no longer in development and that's effectively the final version and a free update to boot, there's no reason to be running anything else.
And if somehow you're not, you can just download the SP6 setup file for your language and use the binaries from that.
I've been working on this feature for my addin, but not by using assembly. I added two custom buttons undo/redo to replace the feature.
I'm using the splice method posted by Trick (TrickAdvancedTools) to hook the API EbGetRedoText and EbGetUndoText and gather codemodule changes/differences.
These API's fire off when there is a possible code change, from typing on the keyboard, or clicking/selecting with the mouse.
Addin module code:
Callback standard module:Code:Dim hVba As Long
If mIsHookInit = True Then
InitializeHooks = True
Exit Function
End If
hVba = apiGetModuleHandle(StrPtr("vba6.dll"))
If hVba = 0 Then
Exit Function
End If
pfnEbGetUndoText = apiGetProcAddress(hVba, "EbGetUndoText")
If pfnEbGetUndoText = 0 Then Exit Function
If HookFunction(pfnEbGetUndoText, AddressOf EbGetUndoText_user) = False Then
Exit Function
End If
The array could be stored when the application closes, and reloaded on the next session.Code:Public pfnEbGetRedoText As Long
Public pfnEbGetUndoText As Long
Public Function EbGetRedoText_user(ByVal pVBProjectNative As Long) As Long
On Error GoTo error_handler
PauseHook pfnEbGetRedoText
' spliced before the Redotext trigger event
AddCurrentModuleText
EbGetRedoText_user = CallByPointer(pfnEbGetRedoText, vbLong, pVBProjectNative)
' spliced after the Redotext event!
ResumeHook pfnEbGetRedoText
Exit Function
error_handler:
End Function
Has anyone ever tried this approach?
hi~ ALL
where can download path file ????
There is a working prototype on our Github VBForumsCommunity. The number of undos is set to 1000. No assembly required, in pure VB.