Solved

Format String For Printing MFC

Posted on 2007-11-15
2
512 Views
Last Modified: 2013-11-20
Hello,

I have a question that borrow me a few months now. I hope to find a solution here.

I have a string (String) that contains in all 3 Blocks. Means I have
Block1 like 00000000
Block2  Data like: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
block3  = thisisstringgggg
Every block is "spliited" by a space. So the complete string has:
"00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 thisisstringgggg"
The problem is now, that the string content is everyline different and contains differnt chars. So the String do not have the same pixeldimension each line.
How is it possible to format the string this way that if I print it to a printer or save to a text file will have the same dimension so it looks like one line and not like "zickzack".

00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 thisisstringgggg
00MMFF0F 00 MM FF 00 00 00 00 00 00 00 00 00 00 00 00 00 TTisisstringgggg
II0II000 00 00 00 00 00 00 II 00 00 00 00 00 00 00 00 00 iiisisstringgggg

Thanks,
Ingo
0
Comment
Question by:Ocrana
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20295959
the recommended way for these blocks that have to be aligned is to use a fixed-width font, like Courier New, so whichever is your printing method, use this kind of font.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 20296813
That looks suspiciously like the format of a Visual Studio memory window :)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert MFC::CString to UTF8 wchar_t* 10 206
unix example issues 18 90
Message not shown 5 50
draw a Christmas tree by using a nested loop? 26 62
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 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