Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Application Error

Application Error

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++sysadmindebuggingperformance
14 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S shiv nand

    Hi all i have developed a MFC Dialoag based application (server application TCP/IP communication a socket programming) on windows xp sp2. I am getting application error message on one of the machine. but some other machine it is working fine. I am not able to fix this bug please help me . The Error message is: The instruction at "0x7c911948" referenced memory at "0x00000000".The memory could not be "read", click on OK to terminate the program click on CANCEL to debug the program What error it is and how to fix it ? Thanks in advance

    H Offline
    H Offline
    Hans Dietrich
    wrote on last edited by
    #2

    It means your app tried to access memory using a null pointer. To fix: Run your app under the debugger, check the call stack when it breaks.

    Best wishes, Hans


    [Hans Dietrich Software]

    S 1 Reply Last reply
    0
    • H Hans Dietrich

      It means your app tried to access memory using a null pointer. To fix: Run your app under the debugger, check the call stack when it breaks.

      Best wishes, Hans


      [Hans Dietrich Software]

      S Offline
      S Offline
      shiv nand
      wrote on last edited by
      #3

      how to check the call stack.

      A 1 Reply Last reply
      0
      • S shiv nand

        how to check the call stack.

        A Offline
        A Offline
        Andrew Brock
        wrote on last edited by
        #4

        Should be down the bottom, but you can activate it via Debug>Windows>Call Stack

        S 1 Reply Last reply
        0
        • A Andrew Brock

          Should be down the bottom, but you can activate it via Debug>Windows>Call Stack

          S Offline
          S Offline
          shiv nand
          wrote on last edited by
          #5

          i am using vc++ 6.0 i am not able to get this option Debug>Windows>Call Stack

          H 1 Reply Last reply
          0
          • S shiv nand

            i am using vc++ 6.0 i am not able to get this option Debug>Windows>Call Stack

            H Offline
            H Offline
            Hans Dietrich
            wrote on last edited by
            #6

            View > Debug Windows > Call Stack

            Best wishes, Hans


            [Hans Dietrich Software]

            1 Reply Last reply
            0
            • S shiv nand

              Hi all i have developed a MFC Dialoag based application (server application TCP/IP communication a socket programming) on windows xp sp2. I am getting application error message on one of the machine. but some other machine it is working fine. I am not able to fix this bug please help me . The Error message is: The instruction at "0x7c911948" referenced memory at "0x00000000".The memory could not be "read", click on OK to terminate the program click on CANCEL to debug the program What error it is and how to fix it ? Thanks in advance

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #7

              A call stack is the bare minimum.

              Steve

              1 Reply Last reply
              0
              • S shiv nand

                Hi all i have developed a MFC Dialoag based application (server application TCP/IP communication a socket programming) on windows xp sp2. I am getting application error message on one of the machine. but some other machine it is working fine. I am not able to fix this bug please help me . The Error message is: The instruction at "0x7c911948" referenced memory at "0x00000000".The memory could not be "read", click on OK to terminate the program click on CANCEL to debug the program What error it is and how to fix it ? Thanks in advance

                M Offline
                M Offline
                Malli_S
                wrote on last edited by
                #8

                The other way out is click on 'CANCEL' button to debug. Before that copy the source code on the machine where you get the above crash. Open the project in visual studio and build the project in 'DEBUG' mode. Now run the application and click 'CANCEL' button to debug when the above error occurs. When OS asks for debugger to attache, provide the running instance of the visual studio, that will take you to the point where the access violation is raised.

                [Delegates]      [Virtual Desktop]      [Tray Me !]
                -Malli...! :rose:****

                S 1 Reply Last reply
                0
                • M Malli_S

                  The other way out is click on 'CANCEL' button to debug. Before that copy the source code on the machine where you get the above crash. Open the project in visual studio and build the project in 'DEBUG' mode. Now run the application and click 'CANCEL' button to debug when the above error occurs. When OS asks for debugger to attache, provide the running instance of the visual studio, that will take you to the point where the access violation is raised.

                  [Delegates]      [Virtual Desktop]      [Tray Me !]
                  -Malli...! :rose:****

                  S Offline
                  S Offline
                  shiv nand
                  wrote on last edited by
                  #9

                  this error because i am creating multiple thread using AfxBeginThread() see below my code : WSADATA wsaData; WSAStartup(0x0101, &wsaData ); struct sockaddr_in stSockaddr_in; struct sockaddr stSockaddr; SOCKET sock; fd_set readfds1; FD_ZERO( &readfds1); //create listening socket sock = socket(AF_INET,SOCK_STREAM,0);//create socket //sets the family,port and the addrees stSockaddr_in.sin_family = AF_INET; stSockaddr_in.sin_addr.s_addr = INADDR_ANY; stSockaddr_in.sin_port = htons(9000) //Use bind to establish the local association of the socket by assigning a local name to an unnamed socket int nRet = bind(sock, (LPSOCKADDR)&stSockaddr_in, sizeof(struct sockaddr));//bind //listen function places a socket a state where it is listening for an incoming connection if(listen( sock, MAX_CONNECTS ) < 0)//listen { //listen error return 0; } SOCKET ret_sock; //accept the connection ret_sock = accept(sock,&stSockaddr,NULL); if(INVALID_SOCKET != ret_sock) { char szBuffer[MAX_BUF_LEN]; //to receive the configuration data int iLength = recv( ret_sock,(char*) szBuffer, MAX_BUF_LEN, 0 ); szBuffer[iLength] = 0; CString csBuffer; int iLen = strlen(szBuffer); WCHAR wcStr[MAX_DATA_SIZE]; memset(wcStr,'\0',sizeof(WCHAR)*MAX_DATA_SIZE); mbstowcs( wcStr,szBuffer,iLen); csBuffer.Format(L"%s",wcStr); //////////////////////////////////////////////////////////////////////// if(!csBuffer.IsEmpty())//data is not empty { CWinThread *Thread = NULL; Thread = AfxBeginThread(func,(LPVOID)&someValue,THREAD_PRIORITY_NORMAL,0,0,NULL); //Here only i am getting the apllication error (Not Creating Multiple thead) } } How to resolve this problem ?

                  H D 2 Replies Last reply
                  0
                  • S shiv nand

                    this error because i am creating multiple thread using AfxBeginThread() see below my code : WSADATA wsaData; WSAStartup(0x0101, &wsaData ); struct sockaddr_in stSockaddr_in; struct sockaddr stSockaddr; SOCKET sock; fd_set readfds1; FD_ZERO( &readfds1); //create listening socket sock = socket(AF_INET,SOCK_STREAM,0);//create socket //sets the family,port and the addrees stSockaddr_in.sin_family = AF_INET; stSockaddr_in.sin_addr.s_addr = INADDR_ANY; stSockaddr_in.sin_port = htons(9000) //Use bind to establish the local association of the socket by assigning a local name to an unnamed socket int nRet = bind(sock, (LPSOCKADDR)&stSockaddr_in, sizeof(struct sockaddr));//bind //listen function places a socket a state where it is listening for an incoming connection if(listen( sock, MAX_CONNECTS ) < 0)//listen { //listen error return 0; } SOCKET ret_sock; //accept the connection ret_sock = accept(sock,&stSockaddr,NULL); if(INVALID_SOCKET != ret_sock) { char szBuffer[MAX_BUF_LEN]; //to receive the configuration data int iLength = recv( ret_sock,(char*) szBuffer, MAX_BUF_LEN, 0 ); szBuffer[iLength] = 0; CString csBuffer; int iLen = strlen(szBuffer); WCHAR wcStr[MAX_DATA_SIZE]; memset(wcStr,'\0',sizeof(WCHAR)*MAX_DATA_SIZE); mbstowcs( wcStr,szBuffer,iLen); csBuffer.Format(L"%s",wcStr); //////////////////////////////////////////////////////////////////////// if(!csBuffer.IsEmpty())//data is not empty { CWinThread *Thread = NULL; Thread = AfxBeginThread(func,(LPVOID)&someValue,THREAD_PRIORITY_NORMAL,0,0,NULL); //Here only i am getting the apllication error (Not Creating Multiple thead) } } How to resolve this problem ?

                    H Offline
                    H Offline
                    Hans Dietrich
                    wrote on last edited by
                    #10

                    To fix: Run your app under the debugger, check the call stack when it breaks.

                    Best wishes, Hans


                    [Hans Dietrich Software]

                    S 1 Reply Last reply
                    0
                    • H Hans Dietrich

                      To fix: Run your app under the debugger, check the call stack when it breaks.

                      Best wishes, Hans


                      [Hans Dietrich Software]

                      S Offline
                      S Offline
                      shiv nand
                      wrote on last edited by
                      #11

                      it breaks in afxBeginthread creation only?

                      H 1 Reply Last reply
                      0
                      • S shiv nand

                        it breaks in afxBeginthread creation only?

                        H Offline
                        H Offline
                        Hans Dietrich
                        wrote on last edited by
                        #12

                        Why does it break? What source line does it break on? What module? If it breaks because of an assert, what does the assert statement say? If it breaks because of a null pointer, what is the pointer supposed to be pointing to? How do you expect us to help you when you don't give us all the details?

                        Best wishes, Hans


                        [Hans Dietrich Software]

                        S 1 Reply Last reply
                        0
                        • H Hans Dietrich

                          Why does it break? What source line does it break on? What module? If it breaks because of an assert, what does the assert statement say? If it breaks because of a null pointer, what is the pointer supposed to be pointing to? How do you expect us to help you when you don't give us all the details?

                          Best wishes, Hans


                          [Hans Dietrich Software]

                          S Offline
                          S Offline
                          shiv nand
                          wrote on last edited by
                          #13

                          i have created parent thread, AfxBeginThread(parent,this,THREAD_PRIORITY_NORMAL,0,0,NULL); declaration : class CTestApp : public CWinApp { public: static UINT parent(LPVOID lpParam); static UINT child(LPVOID lpParam); ///////////////////////////////////////////////////////////////////////////// definition: UINT CTestApp::parent(LPVOID lpParam) //multiple client request the parent { //..... //listening socket and create new thread if(!csBuffer.IsEmpty())//data is not empty { CWinThread *Thread = NULL; Thread = AfxBeginThread(child,(LPVOID)&someValue,THREAD_PRIORITY_NORMAL,0,0,NULL); //Here only i am getting the apllication error (Not Creating Multiple thead) } return 1; } UINT CTestApp::child(LPVOID lpParam) //mulitple times its has to created { //do stuff return 1; } i hope this time i have given clearly my problem. I am tryng to create a multiple threads -- Modified Monday, January 24, 2011 11:08 AM

                          1 Reply Last reply
                          0
                          • S shiv nand

                            this error because i am creating multiple thread using AfxBeginThread() see below my code : WSADATA wsaData; WSAStartup(0x0101, &wsaData ); struct sockaddr_in stSockaddr_in; struct sockaddr stSockaddr; SOCKET sock; fd_set readfds1; FD_ZERO( &readfds1); //create listening socket sock = socket(AF_INET,SOCK_STREAM,0);//create socket //sets the family,port and the addrees stSockaddr_in.sin_family = AF_INET; stSockaddr_in.sin_addr.s_addr = INADDR_ANY; stSockaddr_in.sin_port = htons(9000) //Use bind to establish the local association of the socket by assigning a local name to an unnamed socket int nRet = bind(sock, (LPSOCKADDR)&stSockaddr_in, sizeof(struct sockaddr));//bind //listen function places a socket a state where it is listening for an incoming connection if(listen( sock, MAX_CONNECTS ) < 0)//listen { //listen error return 0; } SOCKET ret_sock; //accept the connection ret_sock = accept(sock,&stSockaddr,NULL); if(INVALID_SOCKET != ret_sock) { char szBuffer[MAX_BUF_LEN]; //to receive the configuration data int iLength = recv( ret_sock,(char*) szBuffer, MAX_BUF_LEN, 0 ); szBuffer[iLength] = 0; CString csBuffer; int iLen = strlen(szBuffer); WCHAR wcStr[MAX_DATA_SIZE]; memset(wcStr,'\0',sizeof(WCHAR)*MAX_DATA_SIZE); mbstowcs( wcStr,szBuffer,iLen); csBuffer.Format(L"%s",wcStr); //////////////////////////////////////////////////////////////////////// if(!csBuffer.IsEmpty())//data is not empty { CWinThread *Thread = NULL; Thread = AfxBeginThread(func,(LPVOID)&someValue,THREAD_PRIORITY_NORMAL,0,0,NULL); //Here only i am getting the apllication error (Not Creating Multiple thead) } } How to resolve this problem ?

                            D Offline
                            D Offline
                            David Crow
                            wrote on last edited by
                            #14

                            So have you stepped into AfxBeginThread() to see what is going on?

                            "One man's wage rise is another man's price increase." - Harold Wilson

                            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                            "Man who follows car will be exhausted." - Confucius

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups