Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detect Ctrl key pressed Pin
Aamir Butt13-Jul-05 20:15
Aamir Butt13-Jul-05 20:15 
GeneralThanks, all! Pin
Ravi Bhavnani14-Jul-05 6:20
professionalRavi Bhavnani14-Jul-05 6:20 
GeneralWorker thread question Pin
Tom Wright13-Jul-05 12:26
Tom Wright13-Jul-05 12:26 
GeneralRe: Worker thread question Pin
Blake Miller13-Jul-05 13:00
Blake Miller13-Jul-05 13:00 
GeneralRe: Worker thread question Pin
Tom Wright14-Jul-05 5:24
Tom Wright14-Jul-05 5:24 
GeneralRe: Worker thread question Pin
Blake Miller14-Jul-05 6:18
Blake Miller14-Jul-05 6:18 
GeneralReading a .prn file Pin
bugDanny13-Jul-05 11:05
bugDanny13-Jul-05 11:05 
GeneralRe: Reading a .prn file Pin
normanS13-Jul-05 20:46
normanS13-Jul-05 20:46 
I did something 10 or 15 years ago, using Borland Turbo C++3, to clean up an OS-2 print file, so I could use it in DOS / Windows 3.1. The problem was that my OS-2 print-to-file contained tables, etc, which did not translate well to the Windows default character set.

As far as I remember, my approach was brute force, and it worked quite nicely! Basically, the flow was something like:

do while not EOF()<br />
   read character from file as a byte value<br />
   if character is a special character<br />
      // Deal with carriage returns, page feeds, etc<br />
      replace special character with standard character<br />
      // use a switch to deal with all the special cases<br />
   do something with character<br />
   // write to file or collect into a string or whatever<br />


Some points worth noting:
1. This is a lot easier (fewer strange characters) if you choose a really simple printer - install a Generic / Text only printer in Windows.
2. I decided how to deal with special characters by doing a simple print to a printer and the same print to a file, and comparing the print file with the paper copy. This was in DOS days, so I also had to take care of converting the PC line-drawing characters to "|", "-", "+", etc.
3. According to my flow above, it may be easiest (least change to your existing program) to create a temporary "cleaned" text file from the print file, then use the cleaned file as input to your file-to-database program.
GeneralRe: Reading a .prn file Pin
bugDanny14-Jul-05 9:06
bugDanny14-Jul-05 9:06 
GeneralRe: Reading a .prn file Pin
normanS14-Jul-05 20:10
normanS14-Jul-05 20:10 
Generalcolor pallete Pin
MSaty13-Jul-05 10:15
MSaty13-Jul-05 10:15 
GeneralRe: color pallete Pin
Christian Graus13-Jul-05 12:35
protectorChristian Graus13-Jul-05 12:35 
GeneralRe: color pallete Pin
MSaty14-Jul-05 23:08
MSaty14-Jul-05 23:08 
GeneralRe: color pallete Pin
Christian Graus17-Jul-05 12:57
protectorChristian Graus17-Jul-05 12:57 
GeneralGetting Threads of Process Pin
MaTTEvIL13-Jul-05 9:36
MaTTEvIL13-Jul-05 9:36 
GeneralRe: Getting Threads of Process Pin
David Crow13-Jul-05 16:46
David Crow13-Jul-05 16:46 
GeneralRe: Getting Threads of Process Pin
Toby Opferman13-Jul-05 19:32
Toby Opferman13-Jul-05 19:32 
GeneralRe: Getting Threads of Process Pin
Toby Opferman13-Jul-05 19:34
Toby Opferman13-Jul-05 19:34 
GeneralRe: Getting Threads of Process Pin
MaTTEvIL13-Jul-05 20:19
MaTTEvIL13-Jul-05 20:19 
GeneralRe: Getting Threads of Process Pin
Toby Opferman14-Jul-05 14:04
Toby Opferman14-Jul-05 14:04 
GeneralConfusion with Mutexes and Semaphores Pin
JohnnyG13-Jul-05 9:04
JohnnyG13-Jul-05 9:04 
GeneralRe: Confusion with Mutexes and Semaphores Pin
Joe Woodbury13-Jul-05 9:22
professionalJoe Woodbury13-Jul-05 9:22 
GeneralRe: Confusion with Mutexes and Semaphores Pin
JohnnyG13-Jul-05 9:31
JohnnyG13-Jul-05 9:31 
GeneralRe: Confusion with Mutexes and Semaphores Pin
Blake Miller13-Jul-05 10:02
Blake Miller13-Jul-05 10:02 
GeneralRe: Confusion with Mutexes and Semaphores Pin
JohnnyG13-Jul-05 10:06
JohnnyG13-Jul-05 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.