Click to See Complete Forum and Search --> : Urgent:Reading doc files


cira
September 10th, 2002, 04:41 AM
My project involves developing a text and picture viewer for files of types doc,html,gif,jpg,bmp etc.Is there any provision for reading doc files and displaying the contents on to a RichEditCtrl or atleast to another text file ? I was not successful with CFile class.The result was a totally junk value after fwrite into a text file.

part of the sample code is as follows:

CFile fs;

char buff[100];

fs.Open("D:\\a.doc",CFile::modeRead);

UINT cbyte=fs.Read(buff,100);

fs.Open("D:\\b.txt",CFile::modeCreate|CFile::modeWrite);

fs.Write(buff,cbyte);