Click here to Skip to main content
15,905,566 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Application error 0xc0150002 when run MFC in Window 7 Pin
Rolf Kristensen29-Oct-12 9:12
Rolf Kristensen29-Oct-12 9:12 
GeneralRe: Application error 0xc0150002 when run MFC in Window 7 Pin
Andraw11129-Oct-12 11:32
Andraw11129-Oct-12 11:32 
Questionmicrosoft apifor upnp Pin
Saed Leghaee28-Oct-12 8:49
Saed Leghaee28-Oct-12 8:49 
AnswerRe: microsoft apifor upnp Pin
«_Superman_»28-Oct-12 19:47
professional«_Superman_»28-Oct-12 19:47 
GeneralRe: microsoft api for upnp Pin
Saed Leghaee29-Oct-12 8:28
Saed Leghaee29-Oct-12 8:28 
GeneralRe: microsoft api for upnp Pin
enhzflep29-Oct-12 15:37
enhzflep29-Oct-12 15:37 
GeneralRe: microsoft api for upnp Pin
Saed Leghaee3-Dec-12 8:15
Saed Leghaee3-Dec-12 8:15 
QuestionGetting error while sending data from client to Server in Socket using TCP/IP Pin
shanmugarajaa26-Oct-12 21:43
shanmugarajaa26-Oct-12 21:43 
Friends,
I have created two application Server and Client connected with Socket(TCP/IP). Now If i send the data from client to server then i getting error in this line ar.WriteObject(&m_sListOut);" . I have cited the code below.

Code:
C++
//Socket created and connected with server application
pSocket->creat();
pSocket->Connect(IPaddr,Port);

m_File = new CSocketFile(pSocket);
m_pArchIn = new CArchive(m_File,CArchive::load);
m_pArchOut = new CArchive(m_File,CArchive::store);

void SendDataToServer( )
{
  CTransData oData;       // deriver from CObject class
  oData.m_sListOut.AddTail(sPackData);
  pSocket->SendData(&oData);
}

void SendData(CTransData *pData)
{
  if (m_pArchOut != NULL)
  {
	TRY
	{
	   pData->Serialize(*m_pArchOut);
	   m_pArchOut->Flush();
	}
	CATCH(CFileException, e)
	{
	  m_pArchOut->Abort();
	  delete m_pArchOut;
	  m_pArchOut = NULL;
	}
	END_CATCH
  }

}

CTransData.cpp

void CTransData::Serialize(CArchive& ar)
{
   if (ar.IsStoring())
   {
       ar.WriteObject(&m_sListOut);     // In This Line I get Error
   }
   else
  {
      m_sListIn = (CStringList*)ar.ReadObject(RUNTIME_CLASS(CStringList));
  }

}
I have written same code in the Server side application and server is able to send the data to client without any problem. In case of Client, could not send the data to server side. Knidly help me to fix this problem
AnswerRe: Getting error while sending data from client to Server in Socket using TCP/IP Pin
Richard MacCutchan26-Oct-12 22:19
mveRichard MacCutchan26-Oct-12 22:19 
GeneralRe: Getting error while sending data from client to Server in Socket using TCP/IP Pin
shanmugarajaa26-Oct-12 22:42
shanmugarajaa26-Oct-12 22:42 
GeneralRe: Getting error while sending data from client to Server in Socket using TCP/IP Pin
Richard MacCutchan26-Oct-12 23:08
mveRichard MacCutchan26-Oct-12 23:08 
QuestionCHtmlView Pin
john563226-Oct-12 20:54
john563226-Oct-12 20:54 
AnswerRe: CHtmlView Pin
Richard MacCutchan26-Oct-12 22:05
mveRichard MacCutchan26-Oct-12 22:05 
AnswerRe: CHtmlView Pin
chaau29-Oct-12 1:41
chaau29-Oct-12 1:41 
QuestionWindows CE Pin
Jith12526-Oct-12 3:23
Jith12526-Oct-12 3:23 
QuestionRe: Windows CE Pin
David Crow26-Oct-12 4:50
David Crow26-Oct-12 4:50 
QuestionHow to transfer structure data using TCP/IP Socket Pin
shanmugarajaa26-Oct-12 2:17
shanmugarajaa26-Oct-12 2:17 
AnswerRe: How to transfer structure data using TCP/IP Socket Pin
Richard MacCutchan26-Oct-12 3:06
mveRichard MacCutchan26-Oct-12 3:06 
AnswerRe: How to transfer structure data using TCP/IP Socket Pin
jschell26-Oct-12 8:44
jschell26-Oct-12 8:44 
QuestionHow to color the TRACE output in Visual C++ 6 debug mode? Pin
Hoornet9326-Oct-12 1:13
Hoornet9326-Oct-12 1:13 
GeneralRe: How to color the TRACE output in Visual C++ 6 debug mode? Pin
Maximilien26-Oct-12 7:29
Maximilien26-Oct-12 7:29 
GeneralRe: How to color the TRACE output in Visual C++ 6 debug mode? Pin
Hoornet9328-Oct-12 3:19
Hoornet9328-Oct-12 3:19 
GeneralRe: How to color the TRACE output in Visual C++ 6 debug mode? Pin
Maximilien28-Oct-12 4:17
Maximilien28-Oct-12 4:17 
QuestionApply DS_SYSMODAL style when creating a dialog at runtime Pin
narayanagvs26-Oct-12 0:43
narayanagvs26-Oct-12 0:43 
AnswerRe: Apply DS_SYSMODAL style when creating a dialog at runtime Pin
Richard MacCutchan26-Oct-12 1:36
mveRichard MacCutchan26-Oct-12 1:36 

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.