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

C / C++ / MFC

 
AnswerRe: open exe Pin
khan++14-Mar-06 2:12
khan++14-Mar-06 2:12 
GeneralRe: open exe Pin
Phil.Benson14-Mar-06 3:48
professionalPhil.Benson14-Mar-06 3:48 
GeneralRe: open exe Pin
ThatsAlok14-Mar-06 18:32
ThatsAlok14-Mar-06 18:32 
Questioncolored edit Pin
mosali satish14-Mar-06 1:34
mosali satish14-Mar-06 1:34 
AnswerRe: colored edit Pin
Naveen14-Mar-06 1:45
Naveen14-Mar-06 1:45 
QuestionVC++ linker error in VS2005 Pin
simwall14-Mar-06 1:29
simwall14-Mar-06 1:29 
QuestionIs Gdiplus Image considers each image as color image Pin
snprani@yahoo.com14-Mar-06 1:12
snprani@yahoo.com14-Mar-06 1:12 
QuestionHelp with Client Socket Reconnect Pin
NYTSX14-Mar-06 1:10
NYTSX14-Mar-06 1:10 
I have a client application that works fine provided that the user hits the connect/disconnect button. If the connection gets severed, my application will detect this and notify the user and allow them to reconnect by hitting the connect/disconnect button.

I have a requirement to have my application reconnect automatically, which will be used on an un-manned test later on.

I have one class that inherits from CAsyncSocket and a class for the dialog that contains the GUI/data that needs to be sent to the server. I have been trying to use this code:
int error = pSocket->Send( (char*)&CServerMsg, sizeof( CServerMsg));

// Check to see if the data was sent out OK
// If it wasn't, check to see the error
if(error == SOCKET_ERROR )
{
   // Reconnect to the server
      m_pMainApp = ::AfxGetApp();
      CMainDlg* dlg;
      dlg = (CMainDlg *) m_pMainApp->GetMainWnd();
		
      dlg->m_ConnectButton.SetCheck(TRUE);
      dlg->OnConnectButton();
}

but I keep getting an error that causes my app to die. I stepped through and it dies on the socket Create() method in my OnConnectButton, which is the same method I call when the user hits the connect button. It then throws me to the method
void* CMapPtrToPtr::GetValueAt(void* key) const

When I do a GetLastError(), I get the error code 10038 which says I am performing a socket operation on a non-socket.

The strange thing is that the send works perfectly fine if the server doesn't go down and I am connected to the server the entire time.

Please help, this has been driving me crazy for 3 days! WTF | :WTF: Thanks!
AnswerRe: Help with Client Socket Reconnect Pin
khan++14-Mar-06 1:39
khan++14-Mar-06 1:39 
AnswerRe: Help with Client Socket Reconnect Pin
Moak19-Apr-06 7:34
Moak19-Apr-06 7:34 
QuestionHow to add MouseMove message handling capability for a Static Picture Control Pin
velvel14-Mar-06 1:10
velvel14-Mar-06 1:10 
AnswerRe: How to add MouseMove message handling capability for a Static Picture Control Pin
Nibu babu thomas14-Mar-06 1:27
Nibu babu thomas14-Mar-06 1:27 
QuestionIs Gdiplus image will take any image as color image Pin
snprani@yahoo.com14-Mar-06 1:09
snprani@yahoo.com14-Mar-06 1:09 
Questionloading and destroying upon data verification: VC++.net Pin
luhfluh14-Mar-06 0:59
luhfluh14-Mar-06 0:59 
QuestionFind at lease 8 errors Pin
LiYS14-Mar-06 0:41
LiYS14-Mar-06 0:41 
AnswerRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 1:00
Gary R. Wheeler14-Mar-06 1:00 
GeneralRe: Find at lease 8 errors Pin
Rage14-Mar-06 2:03
professionalRage14-Mar-06 2:03 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:40
Gary R. Wheeler14-Mar-06 2:40 
AnswerRe: Find at lease 8 errors Pin
Rage14-Mar-06 1:59
professionalRage14-Mar-06 1:59 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:39
Gary R. Wheeler14-Mar-06 2:39 
AnswerRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:42
Gary R. Wheeler14-Mar-06 2:42 
GeneralRe: Find at lease 8 errors Pin
LiYS14-Mar-06 3:09
LiYS14-Mar-06 3:09 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 5:41
Gary R. Wheeler14-Mar-06 5:41 
AnswerRe: Find at lease 8 errors Pin
David Crow14-Mar-06 2:48
David Crow14-Mar-06 2:48 
GeneralRe: Find at lease 8 errors Pin
LiYS14-Mar-06 3:12
LiYS14-Mar-06 3:12 

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.