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

C / C++ / MFC

 
GeneralRe: How to make a toolbar movable ONLY inside a window Pin
Sarvan AL7-Apr-06 0:38
Sarvan AL7-Apr-06 0:38 
AnswerRe: How to make a toolbar movable ONLY inside a window Pin
Nishad S7-Apr-06 1:12
Nishad S7-Apr-06 1:12 
QuestionSetting Focus in Multiple dialog Boxes Pin
vvbkumar6-Apr-06 23:06
vvbkumar6-Apr-06 23:06 
AnswerRe: Setting Focus in Multiple dialog Boxes Pin
Nibu babu thomas6-Apr-06 23:14
Nibu babu thomas6-Apr-06 23:14 
AnswerRe: Setting Focus in Multiple dialog Boxes Pin
Cedric Moonen6-Apr-06 23:18
Cedric Moonen6-Apr-06 23:18 
Questionwrite an object of user defined class into file. Pin
anilksingh6-Apr-06 23:02
anilksingh6-Apr-06 23:02 
AnswerRe: write an object of user defined class into file. Pin
Cedric Moonen6-Apr-06 23:07
Cedric Moonen6-Apr-06 23:07 
AnswerRe: write an object of user defined class into file. Pin
Sarvan AL7-Apr-06 0:04
Sarvan AL7-Apr-06 0:04 
Hi anilksingh,

I used to write objects of my class, in the C way, using "fwrite". Here is the code snippet:

Regards,
Sarvan AL

class Student<br />
{<br />
   int regno;<br />
   char name[30] ;<br />
public:<br />
Student() <br />
{ <br />
regno = 0; <br />
strcpy(name, "NULL") ;<br />
}  <br />
   Student(int rno, char *tname)<br />
   {<br />
      regno = rno ;<br />
      strcpy(name, tname) ;<br />
   }<br />
   void Display()<br />
   {<br />
cout<<"Regno: " << rno << endl ;<br />
cout<<"Name: " << name << endl ;<br />
   }<br />
} ;<br />
<br />
main()<br />
{<br />
FILE *fp = fopen("Test.dat", "wb") ;<br />
Student s1(1, "Robert"), s2(2, "Smith") ;<br />
<br />
fwrite(&s1, sizeof(Student), 1, fp) ;<br />
fwrite(&s2, sizeof(Student), 1, fp) ;<br />
<br />
fclose(fp) ;<br />
<br />
Student t ;<br />
<br />
fp = fopen("Test.dat", "rb") ;<br />
<br />
fread(&t, sizeof(Student), 1, fp) ;<br />
t.Dispaly() ;<br />
<br />
fread(&t, sizeof(Student), 1, fp) ;<br />
t.Dispaly() ;<br />
<br />
fclose(fp) ;<br />
<br />
}

Questionwrite and read an object of user defined class into file. Pin
anilksingh6-Apr-06 23:01
anilksingh6-Apr-06 23:01 
AnswerRe: write and read an object of user defined class into file. Pin
toxcct6-Apr-06 23:05
toxcct6-Apr-06 23:05 
QuestionAbout SetwindowLong Pin
BillTPE6-Apr-06 22:41
BillTPE6-Apr-06 22:41 
AnswerRe: About SetwindowLong Pin
Naveen6-Apr-06 23:06
Naveen6-Apr-06 23:06 
GeneralRe: About SetwindowLong Pin
BillTPE6-Apr-06 23:27
BillTPE6-Apr-06 23:27 
GeneralRe: About SetwindowLong Pin
Nibu babu thomas6-Apr-06 23:47
Nibu babu thomas6-Apr-06 23:47 
GeneralRe: About SetwindowLong Pin
BillTPE7-Apr-06 0:08
BillTPE7-Apr-06 0:08 
GeneralRe: About SetwindowLong Pin
David Crow7-Apr-06 3:08
David Crow7-Apr-06 3:08 
Questiondtpicker block me now! Pin
sting_lee6-Apr-06 22:14
sting_lee6-Apr-06 22:14 
QuestionHi&#65292;How to understand Visual C++ stack alignment? Pin
Best Kiluyar6-Apr-06 21:46
Best Kiluyar6-Apr-06 21:46 
AnswerRe: Hi&#65292;How to understand Visual C++ stack alignment? Pin
David Crow7-Apr-06 3:56
David Crow7-Apr-06 3:56 
QuestionProblem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
SivaramanDhamodharan6-Apr-06 21:25
SivaramanDhamodharan6-Apr-06 21:25 
AnswerRe: Problem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
Cedric Moonen6-Apr-06 21:31
Cedric Moonen6-Apr-06 21:31 
GeneralRe: Problem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
SivaramanDhamodharan6-Apr-06 21:42
SivaramanDhamodharan6-Apr-06 21:42 
GeneralRe: Problem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
Cedric Moonen6-Apr-06 21:47
Cedric Moonen6-Apr-06 21:47 
AnswerRe: Problem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
Naveen6-Apr-06 21:36
Naveen6-Apr-06 21:36 
GeneralRe: Problem when Invoking SendMessage() between two Windows Apps.. Please Help.. [ Code is Attched] Pin
SivaramanDhamodharan6-Apr-06 21:39
SivaramanDhamodharan6-Apr-06 21:39 

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.