Click here to Skip to main content
16,010,394 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: permission denied --- Pin
Daniel Turini8-Oct-02 7:58
Daniel Turini8-Oct-02 7:58 
GeneralRe: permission denied --- Pin
ns8-Oct-02 8:03
ns8-Oct-02 8:03 
GeneralMacro programming reference Pin
fury948-Oct-02 6:17
fury948-Oct-02 6:17 
GeneralCComboBox question. Pin
ns8-Oct-02 5:24
ns8-Oct-02 5:24 
GeneralRe: CComboBox question. Pin
Stephane Rodriguez.8-Oct-02 5:45
Stephane Rodriguez.8-Oct-02 5:45 
GeneralRe: CComboBox question. Pin
Max Santos8-Oct-02 5:52
Max Santos8-Oct-02 5:52 
GeneralThank you! Pin
ns8-Oct-02 6:18
ns8-Oct-02 6:18 
GeneralStrange MFC socket problems Pin
User 66588-Oct-02 4:58
User 66588-Oct-02 4:58 
Hi,

I'm sending queries to many game servers via UDP in a for-loop. But in the receive function there seems to be a problem:

void CMainFrame::OnReceiveUDP()
{
        SOCKADDR_IN fromAddr;
        int fromSize = sizeof(fromAddr);
	
	TCHAR pkt[PACKETLEN];
	
        int respStringLen = m_sSocket.ReceiveFrom(pkt, PACKETLEN-1, (SOCKADDR*)&fromAddr, &fromSize, 0);
        if(respStringLen == SOCKET_ERROR)
        {
                CString	string;
                string.Format("CUDPSocket::ReceiveFrom() failed\nReason: %i", GetLastError());
                MessageBox(string, "Error", MB_OK|MB_ICONSTOP);
                return;		
        }
        else
        {
                CListView* pView = (CListView*)GetActiveView();
                CListCtrl &list = pView->GetListCtrl();

                list.InsertItem(idx, pkt);
                idx++;
        }
}


But after about 30 servers I only have garbage characters in the variable pkt, although the servers send normal packets. How can this happen?

thanks in advance
Greg

modified 12-Sep-18 21:01pm.

GeneralRe: Strange MFC socket problems Pin
jparsons8-Oct-02 6:40
jparsons8-Oct-02 6:40 
GeneralRe: Strange MFC socket problems Pin
User 66588-Oct-02 7:38
User 66588-Oct-02 7:38 
QuestionWin32 API : Which #include do I need ? Pin
Jerome Conus8-Oct-02 4:36
Jerome Conus8-Oct-02 4:36 
AnswerRe: Win32 API : Which #include do I need ? Pin
Steve S8-Oct-02 4:51
Steve S8-Oct-02 4:51 
AnswerRe: Win32 API : Which #include do I need ? Pin
Stephane Rodriguez.8-Oct-02 4:55
Stephane Rodriguez.8-Oct-02 4:55 
AnswerRe: Win32 API : Which #include do I need ? Pin
Max Santos8-Oct-02 5:57
Max Santos8-Oct-02 5:57 
GeneralRe: Win32 API : Which #include do I need ? Pin
Jerome Conus8-Oct-02 19:15
Jerome Conus8-Oct-02 19:15 
GeneralGetWindowText Pin
ns8-Oct-02 4:05
ns8-Oct-02 4:05 
GeneralRe: GetWindowText Pin
Joaquín M López Muñoz8-Oct-02 4:11
Joaquín M López Muñoz8-Oct-02 4:11 
Generalthanks Pin
ns8-Oct-02 4:45
ns8-Oct-02 4:45 
GeneralRe: GetWindowText Pin
Ranjan Banerji8-Oct-02 4:17
Ranjan Banerji8-Oct-02 4:17 
GeneralCombo Box: I want to catch user changes once he/she is finished Pin
Le centriste8-Oct-02 3:54
Le centriste8-Oct-02 3:54 
GeneralRe: Combo Box: I want to catch user changes once he/she is finished Pin
Chris Hambleton8-Oct-02 4:18
Chris Hambleton8-Oct-02 4:18 
GeneralRe: Combo Box: I want to catch user changes once he/she is finished Pin
valikac8-Oct-02 10:01
valikac8-Oct-02 10:01 
Generalenter should tab Pin
ns8-Oct-02 3:53
ns8-Oct-02 3:53 
GeneralRe: enter should tab Pin
Chris Hambleton8-Oct-02 4:31
Chris Hambleton8-Oct-02 4:31 
GeneralThank you! Pin
ns8-Oct-02 4:44
ns8-Oct-02 4:44 

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.