Click here to Skip to main content
15,891,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Freezing first columns of a CListCtrl Pin
Nelek23-Jul-07 4:42
protectorNelek23-Jul-07 4:42 
QuestionShow / Hide controls on a dialog Pin
Makakuin22-Jul-07 3:58
Makakuin22-Jul-07 3:58 
AnswerRe: Show / Hide controls on a dialog Pin
Abhijeet Pathak22-Jul-07 4:29
Abhijeet Pathak22-Jul-07 4:29 
AnswerRe: Show / Hide controls on a dialog Pin
Mark Salsbery22-Jul-07 8:09
Mark Salsbery22-Jul-07 8:09 
AnswerRe: Show / Hide controls on a dialog Pin
Hamid_RT31-Jul-07 19:50
Hamid_RT31-Jul-07 19:50 
QuestionA question about lib files. Pin
mt_samiei22-Jul-07 3:41
mt_samiei22-Jul-07 3:41 
AnswerRe: A question about lib files. Pin
Abhijeet Pathak22-Jul-07 4:33
Abhijeet Pathak22-Jul-07 4:33 
QuestionTransfer a File through Socket with CArchive Pin
glemaire22-Jul-07 3:02
glemaire22-Jul-07 3:02 
I am trying to understand how it is possible to transfer a binary file (CFile) through an open CSocket connection that uses CArchive/CSocketFile. Bellow is a sample of my actual code. The socket transfer is working because before transfering the file itself, I am serializing other objects. They are correctly received. But the CFile.serialize() method leads to the reception of an empty file.

Server part :

m_pFile = new CSocketFile(this);
m_pArchiveIn = new CArchive(m_pFile,CArchive::load);
m_pArchiveOut = new CArchive(m_pFile,CArchive::store);
...
CString strFileName = "C:\Toto.exe";
CFile sourceFile;
sourceFile.Open( strFileName, CFile::modeRead | CFile::typeBinary, &fe );
sourceFile.Serialize(*(m_pArchiveOut));
m_pSocket->m_pArchiveOut->Flush();


Client part :

m_pFile = new CSocketFile(this);
m_pArchiveIn = new CArchive(m_pFile,CArchive::load);
m_pArchiveOut = new CArchive(m_pFile,CArchive::store);
...
CString strFileName = "C:\Toto.exe";
CFile destFile;
destFile.Open( strFileName, CFile::modeCreate | CFile::modeWrite | CFile::typeBinary, &fe );
destFile.Serialize(*(m_pArchiveIn));


Any help would be appreciate. Thanks.


Guillaume.
AnswerRe: Transfer a File through Socket with CArchive Pin
Mark Salsbery22-Jul-07 8:19
Mark Salsbery22-Jul-07 8:19 
GeneralRe: Transfer a File through Socket with CArchive Pin
glemaire22-Jul-07 22:21
glemaire22-Jul-07 22:21 
GeneralRe: Transfer a File through Socket with CArchive Pin
Mark Salsbery23-Jul-07 5:14
Mark Salsbery23-Jul-07 5:14 
QuestionWinInet + "POST" request - how to make progress bar for uploading file? Pin
chox_nox22-Jul-07 0:17
chox_nox22-Jul-07 0:17 
Questionmoving a mfc app into a dll Pin
DevMentor.org21-Jul-07 23:11
DevMentor.org21-Jul-07 23:11 
AnswerRe: moving a mfc app into a dll Pin
#realJSOP22-Jul-07 0:16
mve#realJSOP22-Jul-07 0:16 
GeneralRe: moving a mfc app into a dll Pin
DevMentor.org22-Jul-07 8:32
DevMentor.org22-Jul-07 8:32 
AnswerRe: moving a mfc app into a dll Pin
Mark Salsbery22-Jul-07 9:15
Mark Salsbery22-Jul-07 9:15 
GeneralRe: moving a mfc app into a dll Pin
DevMentor.org22-Jul-07 9:35
DevMentor.org22-Jul-07 9:35 
GeneralRe: moving a mfc app into a dll Pin
Mark Salsbery22-Jul-07 9:39
Mark Salsbery22-Jul-07 9:39 
GeneralRe: moving a mfc app into a dll Pin
DevMentor.org22-Jul-07 9:55
DevMentor.org22-Jul-07 9:55 
GeneralRe: moving a mfc app into a dll Pin
Mark Salsbery22-Jul-07 10:05
Mark Salsbery22-Jul-07 10:05 
GeneralRe: moving a mfc app into a dll Pin
DevMentor.org22-Jul-07 10:17
DevMentor.org22-Jul-07 10:17 
AnswerRe: moving a mfc app into a dll Pin
DevMentor.org23-Jul-07 10:39
DevMentor.org23-Jul-07 10:39 
Questionhow to get Cwnd object Pin
Max++21-Jul-07 21:46
Max++21-Jul-07 21:46 
AnswerRe: how to get Cwnd object Pin
#realJSOP22-Jul-07 0:27
mve#realJSOP22-Jul-07 0:27 
AnswerRe: how to get Cwnd object Pin
ThatsAlok22-Jul-07 17:56
ThatsAlok22-Jul-07 17:56 

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.