Click here to Skip to main content
15,889,863 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
Fatbuddha 116-Dec-09 5:55
Fatbuddha 116-Dec-09 5:55 
AnswerRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
22491716-Dec-09 12:00
22491716-Dec-09 12:00 
GeneralRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
wangningyu20-Dec-09 5:00
wangningyu20-Dec-09 5:00 
QuestionC++ File system Pin
hrishiS16-Dec-09 1:13
hrishiS16-Dec-09 1:13 
AnswerRe: C++ File system Pin
CPallini16-Dec-09 1:53
mveCPallini16-Dec-09 1:53 
GeneralRe: C++ File system Pin
hrishiS16-Dec-09 2:16
hrishiS16-Dec-09 2:16 
GeneralRe: C++ File system Pin
CPallini16-Dec-09 2:36
mveCPallini16-Dec-09 2:36 
GeneralRe: C++ File system Pin
hrishiS16-Dec-09 2:48
hrishiS16-Dec-09 2:48 
thanks ,

that's the exact one i was looking for...In fact I dont have knowledge on serialization, But i have also reached t that point..Now I am having problem on reading...
just for ur information.....my incomplete code is given below
I have used class instead of struct


class tableSructureUnknown
{
};
class tableSructure1: public tableSructureUnknown
{    
public:
     int x;
     int y;
};
class tableSructure2: public tableSructureUnknown
{
public:
     int x2;
     int y2;
};


class listTable
{
public:
     int id;
     int size;
     char tName[20];
};

listTable ArrTableInfo[]=
{    
     {TFX_TABLE1,sizeof(tableSructure1), "first"},         
     {TFX_TABLE2,sizeof(tableSructure2),"Second"},         
     {TFX_UNKNOWN,0,"Unknown"}
};


FILE *ptr_myfile;
int writeToFileTable(int tableId,tableSructureUnknown *lpbaseTableClass)
{
     ptr_myfile=fopen("test.bin","w");
     if (!ptr_myfile)
     {
          printf("Unable to open file!");
          return 1;
     }
     for(int i = 0;   (ArrTableInfo[i].id != TFX_UNKNOWN) || (ArrTableInfo[i].id != tableId) ;i++)
     {
          fwrite(&ArrTableInfo[i], sizeof(listTable), 1, ptr_myfile);
          ptr_myfile=fopen("test.bin","w");
          if (!ptr_myfile)
          {
               printf("Unable to open file!");
               return 0;
          }                             
          fwrite(&lpbaseTableClass, ArrTableInfo[i].size , 1, ptr_myfile);
          break;
     }
     fclose(ptr_myfile);
     return 1;
}
tableSructureUnknown* ReadFromFileTable(int tableId)
{
     for(int i = 0;   (ArrTableInfo[i].id != TFX_UNKNOWN) || (ArrTableInfo[i].id != tableId) ;i++)
     {
     }
     tableSructureUnknown* temp     =     NULL;
     return temp;
}




int main(int argc, char* argv[])
{
tableSructure1 Mytable1;
Mytable1.x = 1;
Mytable1.y = 11;
tableSructureUnknown *lpbaseTableClass = &Mytable1;
writeToFileTable(TFX_TABLE1,lpbaseTableClass);

tableSructure2 Mytable2;
Mytable2.x2 = 2;
Mytable2.y2 = 22;
lpbaseTableClass = &Mytable2;
writeToFileTable(TFX_TABLE1,lpbaseTableClass);

-----------------------------
I am a beginner

QuestionCall a function from another class Pin
Paulraj G16-Dec-09 0:22
Paulraj G16-Dec-09 0:22 
AnswerRe: Call a function from another class Pin
Richard MacCutchan16-Dec-09 0:39
mveRichard MacCutchan16-Dec-09 0:39 
GeneralRe: Call a function from another class Pin
Paulraj G16-Dec-09 1:00
Paulraj G16-Dec-09 1:00 
GeneralRe: Call a function from another class Pin
WoutL16-Dec-09 1:18
WoutL16-Dec-09 1:18 
GeneralRe: Call a function from another class Pin
Paulraj G16-Dec-09 1:20
Paulraj G16-Dec-09 1:20 
GeneralRe: Call a function from another class Pin
Richard MacCutchan16-Dec-09 1:18
mveRichard MacCutchan16-Dec-09 1:18 
AnswerRe: Call a function from another class Pin
Nelek16-Dec-09 5:35
protectorNelek16-Dec-09 5:35 
QuestionChoosing of STL container Pin
hrishiS15-Dec-09 23:35
hrishiS15-Dec-09 23:35 
AnswerRe: Choosing of STL container Pin
Adam Roderick J16-Dec-09 0:05
Adam Roderick J16-Dec-09 0:05 
GeneralRe: Choosing of STL container Pin
hrishiS16-Dec-09 0:52
hrishiS16-Dec-09 0:52 
AnswerRe: Choosing of STL container Pin
Jonathan Davies16-Dec-09 0:06
Jonathan Davies16-Dec-09 0:06 
GeneralRe: Choosing of STL container Pin
hrishiS16-Dec-09 0:52
hrishiS16-Dec-09 0:52 
AnswerRe: Choosing of STL container Pin
CPallini16-Dec-09 0:08
mveCPallini16-Dec-09 0:08 
AnswerRe: Choosing of STL container Pin
KingsGambit16-Dec-09 1:00
KingsGambit16-Dec-09 1:00 
QuestionThreads and Sockets Pin
giancoitaly15-Dec-09 21:56
giancoitaly15-Dec-09 21:56 
AnswerRe: Threads and Sockets [modified] Pin
Adam Roderick J15-Dec-09 23:31
Adam Roderick J15-Dec-09 23:31 
QuestionIs it possible to change the dll versions Pin
pandit8415-Dec-09 21:30
pandit8415-Dec-09 21:30 

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.