Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Breakpoint Pin
Mark Salsbery2-May-07 4:54
Mark Salsbery2-May-07 4:54 
QuestionProlog code and recursive func. call mechanism in stack with VC++ Pin
sawerr25-Apr-07 20:54
sawerr25-Apr-07 20:54 
AnswerRe: Prolog code and recursive func. call mechanism in stack with VC++ Pin
Stephen Hewitt25-Apr-07 21:58
Stephen Hewitt25-Apr-07 21:58 
QuestionHow can i write/read object into/from file? Pin
$uresh $hanmugam25-Apr-07 20:53
$uresh $hanmugam25-Apr-07 20:53 
AnswerRe: How can i write/read object into/from file? Pin
toxcct25-Apr-07 20:59
toxcct25-Apr-07 20:59 
GeneralRe: How can i write/read object into/from file? Pin
$uresh $hanmugam26-Apr-07 2:38
$uresh $hanmugam26-Apr-07 2:38 
AnswerRe: How can i write/read object into/from file? Pin
GuyM25-Apr-07 21:00
GuyM25-Apr-07 21:00 
GeneralRe: How can i write/read object into/from file? Pin
$uresh $hanmugam26-Apr-07 2:36
$uresh $hanmugam26-Apr-07 2:36 
now i'm know some more concepts in the serialization after reading MSDN Document but i got some error in my following code snippet..........

1 void COBjSerializationDlg:: OnBnClickedDbw()<br />
2 {<br />
3 CString sIp,sDb,sPwd,sConn,sPort,sUn;<br />
4 sIp="192.168.2.17";<br />
5 sPort="5432";<br />
6 sPwd="fasp";<br />
7 try<br />
8 {<br />
9 sConn = "DRIVER={PostgreSQL ANSI};SERVER=" + sIp + ";port=" + sPort +<br />
";DATABASE=" + sPwd + ";UID=" + sPwd + ";PWD=" + sPwd + ";";<br />
10 db.OpenEx(sConn);<br />
11 }<br />
12 catch(CDBException *e)<br />
13 {<br />
14 MessageBox("Database Connection Refused."+e->m_strError,"DataBase<br />
15 Connection Error",MB_OK|MB_ICONERROR);<br />
16 e->Delete();<br />
17 }<br />
<br />
18 CRecordset rs(&db);<br />
<br />
19 rs.Open(AFX_DB_USE_DEFAULT_TYPE, "select name from master;");<br />
20 CFile file1;<br />
21 file1.Open("hexa.bin",CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);<br />
22 CArchive ar1(&file1,CArchive:: store);<br />
23 if(ar1.IsStoring())<br />
24 {<br />
25 CObject:: Serialize(ar1);<br />
26 ar1 << &rs;<br />
27 }<br />
28 ar1.Flush();<br />
29 ar1.Close();<br />
30 file1.Close();<br />
31 rs.Close();<br />
32 db.Close();<br />
33 }<br />
<br />
<br />
<br />
34 void COBjSerializationDlg:: OnBnClickedDbr()<br />
35 {<br />
36 CRecordset *set = new CRecordset();<br />
37 CFile file2;<br />
38 file2.Open("hexa.bin", CFile::modeRead| CFile::typeBinary);<br />
39 CArchive ar2(&file2,CArchive:: load);<br />
40 if(ar2.IsLoading())<br />
41 {<br />
42 CObject:: Serialize(ar2);<br />
43 ar2 >> set;<br />
44 }<br />
45 set.MoveFirst();<br />
46 int j;<br />
47 j = 0;<br />
48 CString s;<br />
49 while(set.IsEOF())<br />
50 {<br />
51 s = "";<br />
52 set.GetFieldValue (j,s);<br />
53 AfxMessageBox(s);<br />
54 set.MoveNext();<br />
55 }<br />
56 ar2.Flush();<br />
57 ar2.Close();<br />
58 set.Close();<br />
59 file2.Close();<br />
60 delete set;<br />
61 }


error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'CRecordset *__w64 ' (or there is no acceptable conversion)

will be thrown during the compilation of the above code at LINE.NO:43

please help me.....what i did wrong in my snippet....
GeneralRe: How can i write/read object into/from file? Pin
GuyM26-Apr-07 4:24
GuyM26-Apr-07 4:24 
AnswerRe: How can i write/read object into/from file? Pin
Mark Salsbery26-Apr-07 8:10
Mark Salsbery26-Apr-07 8:10 
GeneralRe: How can i write/read object into/from file? Pin
$uresh $hanmugam26-Apr-07 22:00
$uresh $hanmugam26-Apr-07 22:00 
QuestionC++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 20:51
professionalJoan M25-Apr-07 20:51 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
GuyM25-Apr-07 21:04
GuyM25-Apr-07 21:04 
GeneralRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 21:38
professionalJoan M25-Apr-07 21:38 
GeneralRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 22:05
professionalJoan M25-Apr-07 22:05 
QuestionRe: C++2005: how to deploy an app into another os without VC installed? Pin
GuyM25-Apr-07 22:07
GuyM25-Apr-07 22:07 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 22:43
professionalJoan M25-Apr-07 22:43 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
GuyM25-Apr-07 22:46
GuyM25-Apr-07 22:46 
GeneralRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 22:48
professionalJoan M25-Apr-07 22:48 
QuestionRe: C++2005: how to deploy an app into another os without VC installed? Pin
GuyM25-Apr-07 22:57
GuyM25-Apr-07 22:57 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 23:03
professionalJoan M25-Apr-07 23:03 
QuestionRe: C++2005: how to deploy an app into another os without VC installed? Pin
GuyM25-Apr-07 23:16
GuyM25-Apr-07 23:16 
QuestionRe: C++2005: how to deploy an app into another os without VC installed? Pin
Joan M25-Apr-07 23:27
professionalJoan M25-Apr-07 23:27 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
Programm3r25-Apr-07 23:43
Programm3r25-Apr-07 23:43 
AnswerRe: C++2005: how to deploy an app into another os without VC installed? Pin
cp987626-Apr-07 0:08
cp987626-Apr-07 0:08 

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.