CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 67
  1. #46
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Hex Viewer / Editor

    Quote Originally Posted by GremlinSA
    I adjusted the code like that.. But still 1 small problem ... Integer max = 32767... Scroll_Pos.Max * 16 = a limit of 524K..

    So if you open a file of 600K you can only view the first 524K..

    Any Luck on finding why the color goes funny.. (try taking the hexD.visible = True / False out )

    Grem...
    Oh! That's what you meant...(I guess there's still a bit of language barrier ). And yes that's correct if you are using the file size directly (or \ 16) as the Max. I haven't gone into your code to see how it is implemented.

    If you use a multiplier, how would you scroll one line at a time?

    A quick fix might be to use two buttons or labels. Put them on a frame, and use a variable for the value, which is scaled to the space between the buttons to place a "slider", which could be a label also.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  2. #47
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Quote Originally Posted by WizBang
    Oh! That's what you meant...(I guess there's still a bit of language barrier ). And yes that's correct if you are using the file size directly (or \ 16) as the Max. I haven't gone into your code to see how it is implemented.

    If you use a multiplier, how would you scroll one line at a time?

    A quick fix might be to use two buttons or labels. Put them on a frame, and use a variable for the value, which is scaled to the space between the buttons to place a "slider", which could be a label also.
    At the moment 1 line = 16 or 32 bytes... Hence the *2 for the scroller.. (smallchange is set at: 1 for 16, 2 for 32 byte width..) using the scaled multipliers as proposed a file bigger than 512K will shift 16 lines.. and something as big as 1gig will move 4096 lines.. but only on the scroller.. the normal Page down & up, Up & down arrow will nove one page or line as usual...

    I dont fancy creating a user Control just for the scroller..

    I'm going to try this out tonight...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #48
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Hex Viewer / Editor

    Well, I guess I wouldn't go through too much for it either. Perhaps just put two buttons on the form for up and down, then use a slider control for the scroller, since it appears to be using a Long.

    <EDIT>
    On second thought, maybe use one from PSC:
    http://planetsourcecode.com/vb/scrip...44553&lngWId=1
    Last edited by WizBang; February 3rd, 2006 at 05:46 PM.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  4. #49
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Quote Originally Posted by WizBang
    Well, I guess I wouldn't go through too much for it either. Perhaps just put two buttons on the form for up and down, then use a slider control for the scroller, since it appears to be using a Long.

    <EDIT>
    On second thought, maybe use one from PSC:
    http://planetsourcecode.com/vb/scrip...44553&lngWId=1
    Had a look at this (after writing up the code for the std scroller..) and it's not too bad.. but it's not quite like the Std scroller.. It doesn't have Smallchange or Largechange and the center bar doesn't resize with max changes...

    But i got the std scroller to work nicely.. tested and all, Largest file i have is a 350M file, and it works fine.

    some thing to note.. I may have figured out the Color problem. RTB does not have a Foreground color, or a default text color, and by setting the last to grey, when i blank the RTB text i think the color remains. From all that you've told me, i think this is the problem. So, i added a bit of code to set the color to Black when it loads data from the file...

    Onther niggly fixed. When at Pos 0 and you press left it jumps to pos 16 or 32 depending on your view size.. Same fixed with right...

    i realy hope this is right now

    -------- EDIT ----------
    Update on later post.. (173 Downloads)
    Last edited by GremlinSA; December 14th, 2006 at 03:20 PM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #50
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Hex Viewer / Editor

    Quote Originally Posted by GremlinSA
    Had a look at this (after writing up the code for the std scroller..) and it's not too bad.. but it's not quite like the Std scroller.. It doesn't have Smallchange or Largechange and the center bar doesn't resize with max changes...
    I see. I haven't looked at it, though a search turns up a bunch of different ones.
    i realy hope this is right now
    I'll be sure to let you know...

    ...But has there ever been a publicly distributed app that didn't need a tweak?
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  6. #51
    Join Date
    Nov 2003
    Location
    Australia
    Posts
    137

    Re: Hex Viewer / Editor

    Hi, I was hoping to get some advice on Hex Editors.
    I noticed there is a lot of commercial and free choices.
    This thread caught my attention, as I am a VB6 programmer.

    Do either of you use a editor under windows xp?

    Many years ago I use to read hex on old mainframe machines, it was a very tedious exercise then, I assume the new tools are more efficient when reading and translating hex data.
    TT

  7. #52
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Okay after some time sorting out the Large-file issue (2gig file limit)..
    I've updated the application to enable it to edit files larger than 2gig..

    i hope you enjoy this update...

    Gremmy...


    -------- Edit -------

    Updated Proggy on later post (2 downloads)
    Last edited by GremlinSA; December 15th, 2006 at 04:08 PM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  8. #53
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Hex Viewer / Editor

    I'd like to enjoy it, too.
    What is this ntzlist.ocx the project keeps complaining about? Can you add this to the package or where can I get it?

  9. #54
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Hmm oops ...

    NTZlist was a module that i was testing out...

    this project now does not include the NTZlist...

    Sorry


    Gremmy....

    ----- Edit -----

    No need for a extra post for this...

    The API's can now handle files larger than 2 gig, but the app needs a big adjustment to handle files larger than 2 gig, I'm very busy on this now, hope to have a updated proggy project soon...
    Last edited by WizBang; December 16th, 2006 at 08:31 AM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  10. #55
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Ahhh much better...

    The app now handles any filesize upto 922,000gig..

    I've tested it with a 4gig file without problems...

    Some of the Hex value calculations take a bit of time so i've added the Hourglass Mousepointer, so that you know if the app is busy..

    Also add to this one is commandline file opening..

    So you can now use Open file with .... option on the file popup menu...

    Enjoy..


    Gremmy....

    --- Edit ---

    Error in the Zip .. new file in later post
    Last edited by GremlinSA; December 19th, 2006 at 11:42 AM. Reason: Removed Attachement..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  11. #56
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Hex Viewer / Editor

    Hm. When I click Open->File I et an error in the line
    Code:
        API_OpenFile Tmp_File, File_Num, File_Len
    The argument File_Len is marked and "Type ByRef not allowed" (something like that translated from my german error messages.)

    Am I doing something wrong?

  12. #57
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Hmm thats a bit wierd...

    that line of code should only be executed when you pass a command string...

    CLicking File - Open should skip that line and open the selected file using
    Code:
        API_OpenFile CD.FileName, File_Num, File_Len
    ..

    I'd need a little more info to figure out whats happening (OS, VB service packs, Exact events that led to error...)

    Gremmy
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  13. #58
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Hex Viewer / Editor

    I put a breakpoint in Mnu_F_Open_Click().
    The error occurs before the breakpoint is reached, but comes up after I click the menu 'Open'; so I think it is when the procedure is compiled before actual execution. It also occurs when I compile the exe.

    I didn't have time to search long, but File_Len is a public long and API_Open_FIle seems to expect a Currency type ByRef, maybe this being the reason.

    Since I have a german VB6, I have only SP5 (I didn't dare install german SP6 because of the weird messageboxes).

  14. #59
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Hex Viewer / Editor

    Hmmm silly me ... I updated the public function and forgot to add it to the Zip..

    Here is a updated Zip file...

    Sorry....

    Gremmy....

    ---- Edit ----

    Newer file on later Post..
    Last edited by GremlinSA; December 20th, 2006 at 01:03 PM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  15. #60
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Hex Viewer / Editor

    Maybe I'm too stupid, but I still can't open a file.
    When I click 'Open' I can select a file and then the hourglass cursor is shown infinitely and the handle of the scrollbar is blinking. Nothing else happens.

Page 4 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured