|
-
January 11th, 2002, 02:16 PM
#1
Reading contents of a document file
Hai,
I have the following code (in C++) to open and read a word document(.doc file). But, the getLine method always returns junk characters. Why does this happen. The same code works for .txt files. Is there something else that I need to do when reading the MS Word files?
char buf[80];
ifstream stream;
stream.open("C:\\test1.doc");
while(stream.getline(buf,80) != NULL)
{
MessageBoxNULL,buf,"",MB_OK);
}
Thanks in advance,
GPS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|