Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Video For Windows capSetCallbackOnFrame Question Pin
9ine11-Apr-06 5:46
9ine11-Apr-06 5:46 
GeneralRe: Video For Windows capSetCallbackOnFrame Question Pin
YaronNir15-Apr-06 20:55
YaronNir15-Apr-06 20:55 
QuestionProblem with DT_WORDBREAK Pin
QuickDeveloper11-Apr-06 4:33
QuickDeveloper11-Apr-06 4:33 
AnswerRe: Problem with DT_WORDBREAK Pin
-Dy11-Apr-06 5:35
-Dy11-Apr-06 5:35 
QuestionRead in, write out RTF Pin
DanYELL11-Apr-06 4:17
DanYELL11-Apr-06 4:17 
AnswerRe: Read in, write out RTF Pin
David Crow11-Apr-06 5:09
David Crow11-Apr-06 5:09 
AnswerRe: Read in, write out RTF Pin
Trollslayer11-Apr-06 5:21
mentorTrollslayer11-Apr-06 5:21 
GeneralRe: Read in, write out RTF Pin
DanYELL11-Apr-06 12:59
DanYELL11-Apr-06 12:59 
I think your right that CFile is the solution. I sincerely appreciate
your feedback. My only remaining question is, how can I efficiency
read the entire file into a CString or something other than a buffer.
I have:

char buf[50001];

CFile cfFile ("C:\\Gille.RTF", CFile::modeNoTruncate | CFile::modeRead);

cfFile.Read(buf, 50000);

// open

CFile f;
CFileException e;
char* pFileName = "c:\\Gille2.rtf";
if( !f.Open( pFileName, CFile::modeCreate | CFile::modeWrite, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}

f.Write(buf, 50000);

The

char buf[50001];

is really bad. I had char buf[501]; and that wasnt big enough for a
1-page file. So I made it bigger. Is there a way to read in exactly
enough and to make the buffer the exact size? Also, what happens if
I read in a 10-page RTF file? How big can a buffer get?

Please, any response you can give me will be greatly appreciated.

Sincerely,
Danielle Brina (an overworked graduate student)
GeneralRe: Read in, write out RTF Pin
DanYELL11-Apr-06 13:37
DanYELL11-Apr-06 13:37 
GeneralRe: Read in, write out RTF Pin
dabs11-Apr-06 14:15
dabs11-Apr-06 14:15 
GeneralRe: Read in, write out RTF Pin
Trollslayer11-Apr-06 22:51
mentorTrollslayer11-Apr-06 22:51 
QuestionIdea about => fun(CString str, ...) Pin
Andy Rama11-Apr-06 3:43
Andy Rama11-Apr-06 3:43 
AnswerRe: Idea about => fun(CString str, ...) Pin
toxcct11-Apr-06 3:49
toxcct11-Apr-06 3:49 
AnswerRe: Idea about => fun(CString str, ...) Pin
David Crow11-Apr-06 3:52
David Crow11-Apr-06 3:52 
GeneralRe: Idea about => fun(CString str, ...) Pin
Andy Rama11-Apr-06 22:31
Andy Rama11-Apr-06 22:31 
QuestionHow to Impersonate a Remote Machine. Pin
kiran janaswamy11-Apr-06 3:39
kiran janaswamy11-Apr-06 3:39 
QuestionRe: How to Impersonate a Remote Machine. Pin
David Crow11-Apr-06 3:54
David Crow11-Apr-06 3:54 
QuestionCEdit -> show messages in all languages. Pin
Suyash11-Apr-06 3:30
Suyash11-Apr-06 3:30 
AnswerRe: CEdit -> show messages in all languages. Pin
jayart11-Apr-06 6:06
jayart11-Apr-06 6:06 
GeneralRe: CEdit -> show messages in all languages. Pin
Suyash12-Apr-06 1:13
Suyash12-Apr-06 1:13 
Questiondisable/grey out date time picker Pin
viperlogic11-Apr-06 3:23
viperlogic11-Apr-06 3:23 
AnswerRe: disable/grey out date time picker Pin
-Dy11-Apr-06 3:38
-Dy11-Apr-06 3:38 
AnswerRe: disable/grey out date time picker Pin
RickyC11-Apr-06 3:38
RickyC11-Apr-06 3:38 
GeneralRe: disable/grey out date time picker Pin
viperlogic11-Apr-06 4:20
viperlogic11-Apr-06 4:20 
GeneralRe: disable/grey out date time picker Pin
toxcct11-Apr-06 4:26
toxcct11-Apr-06 4:26 

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.