|
Would anyone know a quick (and easy!) way to patch the source so the field is always in overwrite mode, and disabling the ability to switch mode using by pressing the 'Insert' key?
TIA.
|
|
|
|
|
If you look for m_editMode make sure that EDIT_INSERT is never set for it. (alternatively--I haven't tested this--but you could do a m_editMode &= ~EDIT_INSERT; at the start of OnChar.
|
|
|
|
|
During runtime while there is data in the control, I resize the control by shrinking the width so that the horizontal scroll bar must be shown. Then if I expand the width so that the horizontal scroll bar no longer is needed, the control will draw the data incorrectly. The text will be offset to the left so that the first few digits of the address field are cutoff and there usually is an ugly black rectangle on the right of the control next to the vertical scroll bar.
It seems this is related to the cursor position. If the cursor if place on the left margin, then when I shrink the width the horizontal scrollbar tab will always be in the 0 position and I don't have this problem. But if I place the cursor on the right margin and shrink the control, the horizontal scrollbar tab will be in the middle so the cursor stays in view. Then when I expand the control back out, all the text is shifted to the left.
Other than that, the control works great.
|
|
|
|
|
HexEditor 1.1 featuring some bug fixes is now available. I've submitted the updates to codeproject.com, but I don't know if they're going to refresh this page soon, so you can find them here:
http://www.softerra.com/products/hexeditor.php[^]
The changes include:
- Some bug fixes (as mentioned);
- ASCII representation of binary data now depends on current keyboard layout.
Eugene
-- modified at 2:23 Wednesday 21st December, 2005
|
|
|
|
|
Simple way of making this work in VB (partly):
Change the SCODE return value of SetData to HRESULT in the ODL and function definition.
I haven't got it fully working with the data yet (my variant becomes "empty")
PS, is there any reason there cursor keys don't work when not selecting anything?
|
|
|
|
|
Simply wondering if you got it to work with VB6..!
TIA.
|
|
|
|
|
I beleive that changing type from SCODE to HRESULT won't help, because VB is a scripting language and so it has some problems with pointer to VARIANT in the SetData method.
Eugene
|
|
|
|
|
Hi Eugene,
is there any chance that you can provide us a vb6-compatible version of your control? It would be great, because i didn't found any other (working) control. Or do you know a vb6-compatible control?
Thank you for any help.
best regards,
Oliver
|
|
|
|
|
hex editor control owns, cept for two bugs..
A) Will not work with bcb6, it is absolutely un-editible in bcb6 for some reason, though the code does compile. Like even if i compile the sample hex editor that you made, it wont be editible, it wont even show the first '0000' when you hit 'new'. wont load files either. wont display anything, wont let you edit anything. just blank whiteness.
B) Im not sure what this bug is. It is kinda weird, and the way i found it was kinda weird. If you select text like highlighted for copy,paste, drag cursor up while selecting text, constantly keep left click held while dragging up, and keep hitting a key like 'a' to erase all the text since everything is selected and gets replaced with 'a', if you keep doing that, after about 2 seconds an access violation will raise. Has somthing to do with the caretpos..
Other then these two bugs the OCX seems to work very well and has all features i need, but i cannot get these 2 bugs out of the way and it makes me want to sta myself in the head with a rusty flathead screwdriver so please fix =(
-JojoII
Thou shalt fear the rhythm of my algorithm.
|
|
|
|
|
|
I download the OCX and the demo. The HexEditorDemo.exe can run and work well.
I have compiled and built the demo successfully. It can run. But when load a file or New a file, it can not work. No errors warning. Nothing happend.
why?
thank you!Your code is very good!
|
|
|
|
|
I am having the same problem. The demo .exe works properly, but if I recompile the demo from source in C++Builder 6, it will not work. I have the same problem in my own program - I can call About() and the dialog will be shown, no problem, but calling SetData() seems to do nothing. Any help?
|
|
|
|
|
Hey man,
that's exactly the piece of code I needed. Thanx alot. My skillness in C++ is not sufficient to refund u, but I'll offer u a drink for sure when u come in Italy. Thanx again
|
|
|
|
|
I had use it as a subclass of Cwnd,it can work. But I don't know haw to resize the control when the View's size changed! Thinks!
|
|
|
|
|
Just resize your CWnd object when size of CView has changed... I can't see any problems here.
Eugene
|
|
|
|
|
|
Thanks! The link will be corrected
Eugene
|
|
|
|
|
It seems that the control doesn't work in Visual Basic 6.0. For SetData() method the compiler says "Unknown Automation type"
|
|
|
|
|
Unfortunately, you can't use the SetData() method in script languages. But, since you have the source code of the control, you can declare and implement another method that sets data but has compatible types for its parameters.
Eugene
|
|
|
|
|
Your control is definitely an improvement over several others that I have seen; however, there are some issues. You consistently (and incorrectly) use m_allowChangeSize. This feature does not work the way you shipped the control. You used the || operator instead of the && operator. Here are the following changes to correct this (Note: some line numbers are different since I made other changes as well).
Line 760: if ( (m_editMode & EDIT_INSERT) && m_allowChangeSize )
Line 778 if ( (m_editMode & EDIT_INSERT) && m_allowChangeSize )
Line 1056: if ( (m_editMode & EDIT_INSERT) && m_allowChangeSize )
Line 1252: pCmdUI->Enable(!IsSelectionEmpty() && ((m_editMode & EDIT_INSERT) && m_allowChangeSize));
Line 1793: if ( (m_editMode & EDIT_INSERT) && m_allowChangeSize )
Line 1777: if ( (m_editMode & EDIT_INSERT) && m_allowChangeSize )
Line 191: m_editMode = EDIT_BYTES /*| EDIT_INSERT */;
Line 831: case VK_INSERT:
if(m_allowChangeSize) <-- Insert this
Some other suggestions for furure updates (I changed most of these myself, so I have the code):
1. Different colors for address, data, and ascii
2. Allow ascii to be shown even when data is not in bytes
3. Chanaged values could also be another color
4. Coloring of a sentinel (one specific value that will be colored a certain color)
5. Address size (by this I mean, don't always assume that the user wants the address of bytes, in my case I wanted the address of WORD size registers.)
6. Boundschecker found a few errors and leaks, nothing major though
Thats it for now! Keep up the good work, most of the code is pretty well written.
|
|
|
|
|
Has anyone gotten this to work in a C# Form. I've been able to place it on the Form and gotten a "private AxHEXEDITLib.AxHexEdit ctlHexEditor;" although it's made the SetData method as:
public virtual System.Int32 SetData ( System.Object pData , System.Int32 dwStartAddr )
How do I pass a Byte [] to this function?
|
|
|
|
|
I'm also trying to use it from C#.
I cannot seem to get the SetData function to work.
Anyone had successfull experience with this control in C#. (especially SetData)
Any help is welcome.
TIA,
Dennis
|
|
|
|
|
|
Thanks for the link Eugene.
I wish I could use the control in C#, but I guess I'll have to look for another way to do it.
Dennis
|
|
|
|
|
OK, please let us know if you succeed.
Eugene
|
|
|
|