Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: any Idea for a Project? Pin
FarPointer13-Jul-06 8:58
FarPointer13-Jul-06 8:58 
GeneralRe: any Idea for a Project? Pin
Semion_N13-Jul-06 8:05
Semion_N13-Jul-06 8:05 
GeneralRe: any Idea for a Project? Pin
Semion_N13-Jul-06 9:02
Semion_N13-Jul-06 9:02 
QuestionGetKeyboardState(); Pin
Max++13-Jul-06 6:18
Max++13-Jul-06 6:18 
AnswerRe: GetKeyboardState(); Pin
Randor 13-Jul-06 6:31
professional Randor 13-Jul-06 6:31 
QuestionTutorial or Learning Tools. Pin
WREY13-Jul-06 6:03
WREY13-Jul-06 6:03 
AnswerRe: Tutorial or Learning Tools. Pin
David Crow13-Jul-06 7:45
David Crow13-Jul-06 7:45 
QuestionProblems of Updating contents in an Edit box in vc6 Pin
cppcook13-Jul-06 5:22
cppcook13-Jul-06 5:22 
Hi all,

I am writing a VC++6.0 application. I need to read from a text file and display the file content in an Edit Box. I use the following codes:

CEdit m_fileContent;
CFile pFile;
m_fileContent.SetWindowText(""); //clear
pFile.open(.....);
int length = pFile.GetLength();
CString* strContent = new CString("");
pFile.Read(strContent->GetBuffer(0),length);
m_fileContent.SetWindowText(strContent->GetBuffer(0)); //update file content
strContent->ReleaseBuffer(0);
delete strContent;
pFile.Close();

Now the problem is: When I first opened a file, it's fine. But When I opened a second file, if the length of the first file is longer than that of the second file, the content is not cleared. Any ideas? thanks,

Gavin
AnswerRe: Problems of Updating contents in an Edit box in vc6 Pin
Zac Howland13-Jul-06 5:30
Zac Howland13-Jul-06 5:30 
GeneralRe: Problems of Updating contents in an Edit box in vc6 Pin
cppcook13-Jul-06 7:15
cppcook13-Jul-06 7:15 
AnswerRe: Problems of Updating contents in an Edit box in vc6 Pin
David Crow13-Jul-06 5:41
David Crow13-Jul-06 5:41 
QuestionHow the application knows whether the machine is Laptop or Desktop????? Pin
nagamohan_p13-Jul-06 5:04
nagamohan_p13-Jul-06 5:04 
QuestionRe: How the application knows whether the machine is Laptop or Desktop????? Pin
David Crow13-Jul-06 5:34
David Crow13-Jul-06 5:34 
AnswerRe: How the application knows whether the machine is Laptop or Desktop????? Pin
Jun Du13-Jul-06 5:47
Jun Du13-Jul-06 5:47 
QuestionSound detection [modified] Pin
Ivan Cachicatari13-Jul-06 4:48
Ivan Cachicatari13-Jul-06 4:48 
Questioncode formatting style [modified] Pin
aafcls13-Jul-06 4:19
aafcls13-Jul-06 4:19 
AnswerRe: code formatting style Pin
Chris Losinger13-Jul-06 4:22
professionalChris Losinger13-Jul-06 4:22 
QuestionInheritance problem Pin
khb13-Jul-06 3:27
khb13-Jul-06 3:27 
AnswerRe: Inheritance problem Pin
Zac Howland13-Jul-06 4:21
Zac Howland13-Jul-06 4:21 
QuestionRe: Inheritance problem [modified] Pin
khb13-Jul-06 5:13
khb13-Jul-06 5:13 
AnswerRe: Inheritance problem Pin
Zac Howland13-Jul-06 5:18
Zac Howland13-Jul-06 5:18 
GeneralRe: Inheritance problem Pin
earl13-Jul-06 5:20
earl13-Jul-06 5:20 
GeneralRe: Inheritance problem Pin
Zac Howland13-Jul-06 5:25
Zac Howland13-Jul-06 5:25 
GeneralRe: Inheritance problem Pin
earl13-Jul-06 5:29
earl13-Jul-06 5:29 
GeneralRe: Inheritance problem Pin
Zac Howland13-Jul-06 5:33
Zac Howland13-Jul-06 5:33 

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.