Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralReceiving Messsage from ActiveX Control Pin
Manoj Singh K.15-Oct-04 4:30
Manoj Singh K.15-Oct-04 4:30 
GeneralCOM: Get Interface from one process to another Pin
peterchen15-Oct-04 3:43
peterchen15-Oct-04 3:43 
GeneralRe: COM: Get Interface from one process to another Pin
mtzlplyk15-Oct-04 5:34
mtzlplyk15-Oct-04 5:34 
GeneralRe: COM: Get Interface from one process to another Pin
peterchen15-Oct-04 6:02
peterchen15-Oct-04 6:02 
QuestionWhere is wrong when I try to get the recordset? Pin
chocm15-Oct-04 3:42
chocm15-Oct-04 3:42 
AnswerRe: Where is wrong when I try to get the recordset? Pin
David Crow15-Oct-04 4:39
David Crow15-Oct-04 4:39 
AnswerRe: Where is wrong when I try to get the recordset? Pin
Andrzej Markowski15-Oct-04 18:33
Andrzej Markowski15-Oct-04 18:33 
GeneralProblem Parsing Pictures from Rich-Text (RTF) File Pin
Popeye Doyle Murray15-Oct-04 2:48
Popeye Doyle Murray15-Oct-04 2:48 
I am writing software that parses out an RTF file. One of the things I want to do is extract pictures and save them to a file. The following is taken directly from Microsoft's RTF FAQ (version 1.3):

---- From RTF FAQ ---

The picture in hexadecimal or binary format follows the picture-destination control words. The following example illustrates the destination format:
{\pict\wbitmap0\picw170\pich77\wbmbitspixel1\wbmplanes1\wbmwidthbytes22
\picwgoal505
\pichgoal221
\picscalex172
\picscaley172
49f2000000000273023d1101a030
3901000a000000000273023d98
0048000200000275
02040000200010275023e000000000
273023d000002b90002b90002
b90002b90002b9
0002b90002b90002b90002b90002b90002
b92222b90002b90002b90
002b90002b9
0002b90002b90002b90002b9000

---- End of Stuff from RTF FAQ ---

I am able to parse out all of the bytes (in this example, beginning 49f2...) and I convert them from their text representation to real bytes (i.e., the character sequence "49" is converted to 0x49), but what I get is not a readable picture.

Here is more detail: Suppose I have a bitmap file. I take the same picture and embed it in an RTF document. I can open up the document in Notepad and view the hexidecimal represeantion of the image. I have also written a program that can read a binary file such as a bitmap and convert it to the text equivalent of a hexidecimal as it would appear embedded in the RTF document. I then visually compare the hex I generated directly from the hex embeded in the RTF file.

The hex from the RTF file is the same as the hex I generate directly from the disk file... EXCEPT for the first several hundred bytes! Each source starts out different, but after a hundred byts or so, each is then the same, so I know my encode/decode should be working.

But why is the hexidecimal of the embedded picture not exactly the same as the hexidecmal of the disk file? According to the RTF FAQ, they should be. What can I do to extract the picture? Did Microsoft do something to encode the first series of bytes for a picture so that no one else can extract it?

I have found this problem with both bitmaps and GIF files. I am using MS Word 95 to generate the RTF files with pictures embedded.






GeneralRe: Problem Parsing Pictures from Rich-Text (RTF) File Pin
Henry miller15-Oct-04 7:01
Henry miller15-Oct-04 7:01 
GeneralRe: Problem Parsing Pictures from Rich-Text (RTF) File Pin
Joel Lucsy15-Oct-04 12:01
Joel Lucsy15-Oct-04 12:01 
GeneralParse Filenames for extracting Tags Pin
Summi15-Oct-04 2:42
Summi15-Oct-04 2:42 
GeneralRe: Parse Filenames for extracting Tags Pin
David Crow15-Oct-04 4:42
David Crow15-Oct-04 4:42 
GeneralRe: Parse Filenames for extracting Tags Pin
Maximilien15-Oct-04 5:01
Maximilien15-Oct-04 5:01 
GeneralRe: Parse Filenames for extracting Tags Pin
David Crow15-Oct-04 5:46
David Crow15-Oct-04 5:46 
GeneralRe: Parse Filenames for extracting Tags Pin
Maximilien15-Oct-04 6:47
Maximilien15-Oct-04 6:47 
GeneralRe: Parse Filenames for extracting Tags Pin
Summi19-Oct-04 2:36
Summi19-Oct-04 2:36 
GeneralMultiple Dialogs Pin
sweep12315-Oct-04 2:10
sweep12315-Oct-04 2:10 
GeneralRe: Multiple Dialogs Pin
Maximilien15-Oct-04 2:44
Maximilien15-Oct-04 2:44 
GeneralToggel button with menu open Pin
verma-rahul15-Oct-04 2:05
verma-rahul15-Oct-04 2:05 
GeneralRe: Toggel button with menu open Pin
jan larsen15-Oct-04 2:09
jan larsen15-Oct-04 2:09 
GeneralRe: Toggel button with menu open Pin
Ravi Bhavnani15-Oct-04 6:21
professionalRavi Bhavnani15-Oct-04 6:21 
Questionwhat are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
lavate malllik15-Oct-04 0:50
lavate malllik15-Oct-04 0:50 
AnswerRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
toxcct15-Oct-04 0:55
toxcct15-Oct-04 0:55 
AnswerRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
Phil J Pearson15-Oct-04 0:59
Phil J Pearson15-Oct-04 0:59 
GeneralRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
David Crow15-Oct-04 4:46
David Crow15-Oct-04 4:46 

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.