Solved

Find HexEdit Control C++

Posted on 2007-11-15
3
342 Views
Last Modified: 2013-12-04
Hello,

hope to get some help here. I am looking for a control (MFC) to view data in Hex format. Like a normal HexEditor will do. (Adress, Hex, ASCII).
The control i need must have following methods:

- Print (Printer/Paper) Text Formated as in the Control
- Save Data to textfile (Text Formated as in the Control).

Like I give of block of 128 Bytes to the Control. It shows me the 126 Bytes in 16 Byte rows.
Similar to : 000000 0x00 0x00 0x00 .... 0x00  0x00  .............
I want to receive the data as a string like formated above. Not the Byte array.

Freeware or Commercial. I have no problem to pay for those things.  I found some controls but none of the mcan print or save the data as viewed inside the control.

Thanks,

Ingo
0
Comment
Question by:Ocrana
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20295638
Well, it is a very specific requirement, there are some commercial controls like this:
http://www.filedudes.com/Hex_Editor_ActiveX_Control-download-27563.html
it prints and copies to clipboard but doesn't save. You won't find any exact match.

There are lots of open-source hex controls at www.codeproject.com, just search there for the keywords: hex editor
0
 
LVL 40

Accepted Solution

by:
evilrix earned 500 total points
ID: 20296785
Converting data bytes to hex isn't hard. Why not just write a converter and just display the output in your control of choice?
// Q&D example of hexing data
#include <iostream>
#include <sstream>
#include <iomanip>
 
char const DATA[] = "any old data";
 
int _tmain(int argc, _TCHAR* argv[])
{
	std::stringstream ss;
 
	for(char const * p = DATA; *p ; ++p)
	{
		ss << std::hex << static_cast<int>(*p);
	}
 
	std::cout << ss.str();
}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 20296804
I should point out that the point of the previous example was to show how to hex bytes not how to parse the aw data. My Q&D example will parse until I hits a NULL char. Obviously this won't work if your data contains NULLs. You should, of course, choose an appropriate 8-bit safe method for traversing your data. I kept it simple, on purpose, so as not to obfuscate the point I was making.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now