Click here to Skip to main content
15,917,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RAM project Pin
David Crow30-Sep-03 6:37
David Crow30-Sep-03 6:37 
GeneralRe: RAM project Pin
IndrekSnt1-Oct-03 4:26
IndrekSnt1-Oct-03 4:26 
GeneralRe: RAM project Pin
David Crow1-Oct-03 4:33
David Crow1-Oct-03 4:33 
GeneralRe: RAM project Pin
IndrekSnt2-Oct-03 4:43
IndrekSnt2-Oct-03 4:43 
QuestionHow to restore minimized window? Pin
vgrigor30-Sep-03 3:28
vgrigor30-Sep-03 3:28 
AnswerRe: How to restore minimized window? Pin
David Crow30-Sep-03 3:37
David Crow30-Sep-03 3:37 
GeneralRe: How to restore minimized window? Pin
vgrigor30-Sep-03 3:48
vgrigor30-Sep-03 3:48 
GeneralCSocket - CSocketFile - CArchive Problem Pin
Brian Cox30-Sep-03 3:04
Brian Cox30-Sep-03 3:04 
Hello,

I am having some difficulty using the CArchive socket class in a storing (output) situation. My problem is with the m_pArOut pointer in the following code. It seems that for some unknown reason I am unable to write using the CArchive. Here is a code snippet:

----------------------------------------------------------------
<>
sockClient.Create();<br />
sockClient.Connect("192.168.1.112",3030);<br />
<br />
file = new CSocketFile(&sockClient);<br />
<br />
m_pArIn = new CArchive(file,CArchive::load);<br />
m_pArOut = new CArchive(file,CArchive::store);<br />
<br />
*m_pArOut<<"This is a test";

----------------------------------------------------------------
<>
CSocket	sockClient;<br />
CSocketFile* file;<br />
<br />
CArchive* m_pArOut;<br />
CArchive* m_pArIn;

----------------------------------------------------------------

When this code is executed I do not receive the message “This is a test” on my server. However, if I change the code to use a local version of the CArchive object like the following it works:

----------------------------------------------------------------
CArchive	arOut(file,CArchive::store);<br />
m_pArOut = &arOut;

----------------------------------------------------------------

The user of the pointer m_pArIn works in every case. I don’t understand why it would work when locally instantiated. I also don’t understand why the same problem doesn’t exist for the input archive.

Thank you for your help

Confused | :confused: BrianConfused | :confused:
GeneralRe: CSocket - CSocketFile - CArchive Problem Pin
DougW4830-Sep-03 7:01
DougW4830-Sep-03 7:01 
GeneralRe: CSocket - CSocketFile - CArchive Problem Pin
Brian Cox30-Sep-03 7:09
Brian Cox30-Sep-03 7:09 
GeneralSpy++ Pin
hph30-Sep-03 1:59
hph30-Sep-03 1:59 
GeneralMFC ShellExecuteEx structure Pin
Uke30-Sep-03 1:53
Uke30-Sep-03 1:53 
GeneralRe: MFC ShellExecuteEx structure Pin
David Crow30-Sep-03 2:28
David Crow30-Sep-03 2:28 
GeneralRe: MFC ShellExecuteEx structure Pin
Uke30-Sep-03 2:47
Uke30-Sep-03 2:47 
GeneralRe: MFC ShellExecuteEx structure Pin
Uke30-Sep-03 2:55
Uke30-Sep-03 2:55 
GeneralRe: MFC ShellExecuteEx structure Pin
David Crow30-Sep-03 2:56
David Crow30-Sep-03 2:56 
GeneralDebug Assertion Failure Pin
Saurabh_Delhi30-Sep-03 1:50
Saurabh_Delhi30-Sep-03 1:50 
GeneralRe: Debug Assertion Failure Pin
jhwurmbach30-Sep-03 1:55
jhwurmbach30-Sep-03 1:55 
GeneralRe: Debug Assertion Failure Pin
Saurabh_Delhi30-Sep-03 2:20
Saurabh_Delhi30-Sep-03 2:20 
GeneralRe: Debug Assertion Failure Pin
jhwurmbach30-Sep-03 2:31
jhwurmbach30-Sep-03 2:31 
GeneralRe: Debug Assertion Failure Pin
David Crow30-Sep-03 2:43
David Crow30-Sep-03 2:43 
GeneralRe: Debug Assertion Failure Pin
David Crow30-Sep-03 2:40
David Crow30-Sep-03 2:40 
GeneralRe: Debug Assertion Failure Pin
Saurabh_Delhi30-Sep-03 3:06
Saurabh_Delhi30-Sep-03 3:06 
GeneralRe: Debug Assertion Failure Pin
David Crow30-Sep-03 3:35
David Crow30-Sep-03 3:35 
GeneralCode to read thru Pin
bhangie30-Sep-03 0:39
bhangie30-Sep-03 0: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.