Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: constant variable at run time Pin
Nader Elshehabi3-Sep-06 1:07
Nader Elshehabi3-Sep-06 1:07 
GeneralRe: constant variable at run time Pin
MayankT3-Sep-06 15:23
MayankT3-Sep-06 15:23 
GeneralRe: constant variable at run time Pin
Nader Elshehabi3-Sep-06 17:48
Nader Elshehabi3-Sep-06 17:48 
Questiontext buffer conversion Pin
FredrickNorge2-Sep-06 10:12
FredrickNorge2-Sep-06 10:12 
AnswerRe: text buffer conversion Pin
Waldermort2-Sep-06 11:27
Waldermort2-Sep-06 11:27 
GeneralRe: text buffer conversion Pin
FredrickNorge2-Sep-06 12:06
FredrickNorge2-Sep-06 12:06 
GeneralRe: text buffer conversion Pin
Waldermort2-Sep-06 12:13
Waldermort2-Sep-06 12:13 
GeneralRe: text buffer conversion Pin
FredrickNorge2-Sep-06 12:16
FredrickNorge2-Sep-06 12:16 
text is the final conversion, taken from bellow. m_pTextBuffer->InsertText(this, ptCursorPos.y, ptCursorPos.x, text, y, x, CE_ACTION_PASTE);

void OnScriptMission()
{
if (m_pTextBuffer == NULL)
return;

m_pTextBuffer->BeginUndoGroup();

FILE *buffer;
if ((buffer = _tfopen("text.txt",_T("rb") )) == NULL) {
return;
}

// obtain file size.
fseek(buffer , 0 , SEEK_END);
long lSize = ftell(buffer);
rewind(buffer);

//read in the contents of the input file
char *text = new char[lSize];
fread(text,1,lSize,buffer);



CPoint ptCursorPos = GetCursorPos();
ASSERT_VALIDTEXTPOS(ptCursorPos);
int x, y;
m_pTextBuffer->InsertText(this, ptCursorPos.y, ptCursorPos.x, text, y, x, CE_ACTION_PASTE);
ptCursorPos.x = x;
ptCursorPos.y = y;
ASSERT_VALIDTEXTPOS(ptCursorPos);
SetAnchor(ptCursorPos);
SetSelection(ptCursorPos, ptCursorPos);
SetCursorPos(ptCursorPos);
EnsureVisible(ptCursorPos);


m_pTextBuffer->FlushUndoGroup(this);

fclose(buffer);

}
GeneralRe: text buffer conversion Pin
Waldermort2-Sep-06 12:27
Waldermort2-Sep-06 12:27 
GeneralRe: text buffer conversion Pin
FredrickNorge2-Sep-06 12:33
FredrickNorge2-Sep-06 12:33 
GeneralRe: text buffer conversion Pin
FredrickNorge2-Sep-06 14:11
FredrickNorge2-Sep-06 14:11 
GeneralRe: text buffer conversion Pin
Waldermort2-Sep-06 19:36
Waldermort2-Sep-06 19:36 
QuestionEdit Box multiple lines Pin
Oliver1232-Sep-06 8:03
Oliver1232-Sep-06 8:03 
AnswerRe: Edit Box multiple lines Pin
Oliver1232-Sep-06 8:06
Oliver1232-Sep-06 8:06 
GeneralRe: Edit Box multiple lines Pin
James Brown2-Sep-06 8:09
James Brown2-Sep-06 8:09 
GeneralRe: Edit Box multiple lines Pin
Oliver1232-Sep-06 11:39
Oliver1232-Sep-06 11:39 
QuestionHide System Menu Close (X) button for MessageBox Pin
Pradeep.Reddy2-Sep-06 3:47
Pradeep.Reddy2-Sep-06 3:47 
AnswerRe: Hide System Menu Close (X) button for MessageBox Pin
Jun Du2-Sep-06 6:37
Jun Du2-Sep-06 6:37 
AnswerRe: Hide System Menu Close (X) button for MessageBox Pin
Cristian Amarie2-Sep-06 7:01
Cristian Amarie2-Sep-06 7:01 
GeneralRe: Hide System Menu Close (X) button for MessageBox Pin
Pradeep.Reddy3-Sep-06 17:59
Pradeep.Reddy3-Sep-06 17:59 
AnswerRe: Hide System Menu Close (X) button for MessageBox Pin
Waldermort2-Sep-06 7:57
Waldermort2-Sep-06 7:57 
QuestionMemory managment Pin
Waldermort2-Sep-06 3:44
Waldermort2-Sep-06 3:44 
AnswerRe: Memory managment Pin
PJ Arends2-Sep-06 5:31
professionalPJ Arends2-Sep-06 5:31 
GeneralRe: Memory managment Pin
Waldermort2-Sep-06 5:56
Waldermort2-Sep-06 5:56 
AnswerRe: Memory managment Pin
Cristian Amarie2-Sep-06 7:13
Cristian Amarie2-Sep-06 7:13 

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.