Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Find HexEdit Control C++

Posted on 2007-11-15
3
Medium Priority
?
351 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

722 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