Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDrawState (CDC) problem Pin
YaronNir22-Apr-04 2:13
YaronNir22-Apr-04 2:13 
GeneralRe: DrawState (CDC) problem Pin
YoSilver22-Apr-04 3:13
YoSilver22-Apr-04 3:13 
GeneralRe: DrawState (CDC) problem Pin
YaronNir22-Apr-04 4:50
YaronNir22-Apr-04 4:50 
GeneralRe: DrawState (CDC) problem Pin
YoSilver26-Apr-04 10:02
YoSilver26-Apr-04 10:02 
QuestionHow to make CDateTimeCtrl not editable, without arrows ? Pin
vgrigor22-Apr-04 2:11
vgrigor22-Apr-04 2:11 
AnswerRe: How to make CDateTimeCtrl not editable, without arrows ? Pin
ravjak22-Apr-04 4:32
ravjak22-Apr-04 4:32 
Generalserial comm in w2k Pin
фил22-Apr-04 1:56
фил22-Apr-04 1:56 
GeneralProblem with CStdioFile Pin
Stojan7822-Apr-04 1:36
Stojan7822-Apr-04 1:36 
Hello all

I'm pretty new on C++ and I have a problem. The thing is that I want to write a CString to a CStdioFile and be able to read the string from the file. All I have done so far is a little testprogram, just to se if it worked. It did not! Problem: I get a lot of junk text in my file and when I read from the file. Here is the code, I would be very greatful if anyone could help me a bit.

CStdioFile file;
CString filnamn = "Temp.txt";
CFileException fileException;
char buf1[] = "Hej hej\n";
char buf2[] = "Jag heter henrik\n";
CString rad = "";
CString rad1 = "Hej hej";
CString rad2 = "Jag heter henrik";

if (!file.Open(filnamn, CFile::modeCreate | CFile::modeReadWrite, &fileException))
{
TRACE("Can't open file %s, error = %u\n",
filnamn, fileException.m_cause);
}

file.WriteString(rad1 + '\n');
file.WriteString(rad2 + '\n');
file.ReadString(rad);
printf(rad, "%s");
file.Close();
GeneralRe: Problem with CStdioFile Pin
Steve S22-Apr-04 1:53
Steve S22-Apr-04 1:53 
GeneralRe: Problem with CStdioFile Pin
jmkhael22-Apr-04 1:53
jmkhael22-Apr-04 1:53 
GeneralRe: Problem with CStdioFile Pin
RChin22-Apr-04 1:53
RChin22-Apr-04 1:53 
GeneralRe: Problem with CStdioFile Pin
Stojan7822-Apr-04 2:11
Stojan7822-Apr-04 2:11 
Generalgraphics in c/c++ Pin
kcal22-Apr-04 1:36
kcal22-Apr-04 1:36 
GeneralRe: graphics in c/c++ Pin
Ian Darling22-Apr-04 2:06
Ian Darling22-Apr-04 2:06 
GeneralChange Style subsequent on CSlideCtrl Pin
AnTri22-Apr-04 1:13
AnTri22-Apr-04 1:13 
GeneralProblem of setting size and position of scrollbar's thumb Pin
bg2sc22-Apr-04 1:06
bg2sc22-Apr-04 1:06 
QuestionHow do i detect user inactivity ? Pin
rallister22-Apr-04 1:02
rallister22-Apr-04 1:02 
AnswerRe: How do i detect user inactivity ? Pin
jmkhael22-Apr-04 1:10
jmkhael22-Apr-04 1:10 
GeneralRe: How do i detect user inactivity ? Pin
rallister22-Apr-04 1:18
rallister22-Apr-04 1:18 
GeneralRe: How do i detect user inactivity ? Pin
jmkhael22-Apr-04 1:48
jmkhael22-Apr-04 1:48 
AnswerRe: How do i detect user inactivity ? Pin
David Crow22-Apr-04 2:19
David Crow22-Apr-04 2:19 
AnswerRe: How do i detect user inactivity ? Pin
hasansheik22-Apr-04 3:21
hasansheik22-Apr-04 3:21 
GeneralRe: How do i detect user inactivity ? Pin
V.22-Apr-04 3:28
professionalV.22-Apr-04 3:28 
AnswerRe: How do i detect user inactivity ? Pin
peterchen22-Apr-04 4:25
peterchen22-Apr-04 4:25 
AnswerRe: How do i detect user inactivity ? Pin
Rick York22-Apr-04 10:12
mveRick York22-Apr-04 10:12 

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.