简体   繁体   中英

Stack Overflow occuring when moving my window (C++, winapi)

So I've got a sizable program, and a new error has started popping up that I can't seem to track down - and undoing the changes I remember doing recently hasn't proven fruitful. All the code below has been in there practically from the start of the program - still unchanged. I'm... confused, to say the least. ;_;

If it helps with diagnosis; I'm using Visual Studio 2012 Express and the OpenCV api.

So there are two ways that I can consistently get the error:

  1. Attempt to grab the window by the Title Bar and move it.
  2. Attempt to "hide" the options window after interacting with any of the options (even just clicking on a text box - no need to actually change/type anything).

     case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: SendMessage(g_hOptions, WM_COMMAND, IDAPPLY, NULL); ShowWindow(g_hOptions, SW_HIDE); //Causes the issue break; case IDAPPLY: //Never Crashes Program break; case IDCANCEL: SendMessage(cboDotColors, CB_SETCURSEL, currentDot, 0); SendMessage(cboBackgroundColors, CB_SETCURSEL, currentBG, 0); SendMessage(cboCentralColors, CB_SETCURSEL, currentCen, 0); SendMessage(cboCornerColor, CB_SETCURSEL, currentCC, 0); SendMessage(cboSaveShots, CB_SETCURSEL, currentSS, 0); SendMessage(cboDebugMode, CB_SETCURSEL, currentDM, 0); SendMessage(cboTextOutput, CB_SETCURSEL, currentTO, 0); SendMessage(cboLighting, CB_SETCURSEL, lightingCondition, 0); SetDlgItemText(g_hOptions, IDD_MINSIZE_ETB, const_cast<char *>(to_string(minPixelCount).c_str())); SetDlgItemText(g_hOptions, IDD_MAXSIZE_ETB, const_cast<char *>(to_string(maxPixelCount).c_str())); SetDlgItemText(g_hOptions, IDD_VISUALTHRESH_ETB, const_cast<char *>(to_string(visualThreshold).c_str())); SetDlgItemText(g_hOptions, IDD_ALIGNMENTTHRESH_ETB, const_cast<char *>(to_string(alignmentThreshold).c_str())); SetDlgItemText(g_hOptions, IDD_DELAY_MULTIPLIER_ETB, const_cast<char *>(to_string(endDelayMultiplier).c_str())); SetDlgItemText(g_hOptions, IDD_DELAY_DIVISOR_ETB, const_cast<char *>(to_string(endDelayDivisor).c_str())); SetDlgItemText(g_hOptions, IDD_PICTURE_DELAY_ETB, const_cast<char *>(to_string(pictureWait).c_str())); ShowWindow(g_hOptions, SW_HIDE); { 

(The above is somewhat truncated, since the other things don't seem to be interacting with / leading to the issue.)

Things that don't trigger it: Making the options window appear, moving the options window, making changes to the options window, applying those changes, moving focus away from/back to the program, using the program for it's normal functions, and letting it sit there doing nothing.

So here's the actual error that pops up from Visual Studio:

Unhandled exception at 0x01447FB7 in ProjectNameHere.exe: 0xC00000FD: Stack overflow (parameters: 0x00000000, 0x03332000).

The first and last numbers can vary. If I hit "Continue" it goes to another error:

Unhandled exception at 0x01447FB7 in ProjectNameHere.exe: 0xC0000005: Access violation reading location 0x03330000.

Same numbers vary here - and they remain consistent between the two errors. That second error doesn't change further if I keep trying to push it - just repeating itself.

The thread running when it crashes is always: [10###] msvcr110d.dll!_threadstartex When I look at the "Call Stack" in VS, the most recent line executed that I actually wrote is "return DefWindowProc(hwnd, msg, wParam, lParam);"

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CREATE:
            g_hOptions = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsDlgProc);
            g_hbmBoard = ConvertIplImageToHBITMAP(targetBoardImg);
            g_hbmGreenLight = ConvertIplImageToHBITMAP(GreenLightOff);
            g_hbmWorkingLight = ConvertIplImageToHBITMAP(GreenLightOff);
            g_hbmWorkingIndicator = ConvertIplImageToHBITMAP(WorkingIndicatorNull);
            if(g_hbmBoard == NULL)
            {
                setExitError(1001);
                MessageBox(hwnd, "Could not load target board!", "Error", MB_OK | MB_ICONEXCLAMATION);
            }
            hDataBox = CreateWindowEx(WS_EX_STATICEDGE, TEXT("EDIT"), TEXT(""),
                WS_CHILD | WS_VISIBLE | ES_READONLY | WS_BORDER |
                ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL,
                screenResW - 349, 100, 315, 470,
                hwnd, (HMENU)NULL, NULL, NULL );
            CreateWindow(TEXT("Button"), TEXT("Load and Process"),
                WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
                screenResW - 349, 35, 315, 50,
                hwnd, (HMENU) ID_START_STOP, NULL, NULL );
            CreateWindow(TEXT("Button"), TEXT("Clear Processing"),
                WS_VISIBLE | WS_CHILD,
                screenResW - 349, 585, 155, 35,
                hwnd, (HMENU) ID_BUTTON_CLEARPROCESSING, NULL, NULL );
            CreateWindow(TEXT("Button"), TEXT("Save Data"),
                WS_VISIBLE | WS_CHILD,
                screenResW - 349, 630, 155, 35,
                hwnd, (HMENU) ID_FILE_SAVE, NULL, NULL );
            CreateWindow(TEXT("Button"), TEXT("Clear Data"),
                WS_VISIBLE | WS_CHILD,
                screenResW - 189, 585, 155, 35,
                hwnd, (HMENU) ID_FILE_CLEAR, NULL, NULL );
            CreateWindow(TEXT("Button"), TEXT("Quit"),
                WS_VISIBLE | WS_CHILD,
                screenResW - 189, 630, 155, 35,
                hwnd, (HMENU) ID_FILE_EXIT, NULL, NULL );
        break;
        case WM_PAINT:
            g_hbmBoard = ConvertIplImageToHBITMAP(targetBoardImg);
            BITMAP bm;
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hwnd, &ps);
            HDC hdcMem = CreateCompatibleDC(hdc);

            HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmBoard);
            GetObject(g_hbmBoard, sizeof(bm), &bm);
            BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

            hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmGreenLight);
            GetObject(g_hbmGreenLight, sizeof(bm), &bm);
            BitBlt(hdc, screenResW - 59, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

            hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmWorkingLight);
            GetObject(g_hbmWorkingLight, sizeof(bm), &bm);
            BitBlt(hdc, screenResW - 94, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

            hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmWorkingIndicator);
            GetObject(g_hbmWorkingIndicator, sizeof(bm), &bm);
            BitBlt(hdc, screenResW - 129, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

            SelectObject(hdcMem, hbmOld);
            DeleteDC(hdcMem);

            EndPaint(hwnd, &ps);
        break;
        case WM_COMMAND:
            if(HIWORD(wParam) == BN_CLICKED)
            {
                switch(LOWORD(wParam))
                {
                    //case ID_BUTTON_CAMVIEW:
                        //{
                            //if(!camviewOn)
                            //{thread (displayCameraView).detach();}
                        //}
                    break; // Whoops! Not that this should affect anything...
                    case ID_FILE_SAVE:
                    {
                        if(textBoxCoords != "")
                        {
                            OPENFILENAME ofn;
                            WCHAR savefile[MAX_PATH+1] = L"";
                            ZeroMemory(&ofn, sizeof(ofn));
                            ofn.lStructSize = sizeof(ofn); 
                            ofn.hwndOwner = hwnd;
                            ofn.lpstrFilter = (LPCSTR)"Text(*.txt)\0*.txt\0All Files(*.*)\0*.*\0";
                            ofn.lpstrFile = (LPSTR)savefile;
                            ofn.nMaxFile = MAX_PATH;
                            ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
                            ofn.lpstrDefExt = (LPCSTR)"txt";
                            if(textOutput){cout << "Choosing save file...\n";}
                            if(GetSaveFileName(&ofn))
                            {
                                ifstream checkFile;
                                checkFile.open(ofn.lpstrFile);
                                if(checkFile.good())
                                {
                                    checkFile.close();
                                    if(textOutput){cout << "File exists.\n";}
                                    if(MessageBox(hwnd, "File exists. Overwrite?", "Overwrite?", MB_ICONEXCLAMATION | MB_YESNO) == IDYES)
                                    {
                                        ofstream outputFile;
                                        outputFile.open ((ofn.lpstrFile), fstream::in | fstream::out | fstream::trunc);
                                        if(outputFile.is_open())
                                        {
                                            outputFile << textBoxCoords;
                                            outputFile.close();
                                            if(textOutput){cout << "File overwritten.\n";}
                                        }
                                        else
                                        {
                                            if(textOutput){cout << "File failed to open.\n";}
                                            MessageBox(hwnd, "File could not be saved.", "Error!",
                                                MB_ICONEXCLAMATION | MB_OK);
                                            outputFile.close(); // Just in case.
                                        }
                                    }
                                    else
                                    {
                                        if(textOutput){cout << "File not overwritten.\n";}
                                    }
                                }
                                else
                                {
                                    checkFile.close();
                                    ofstream outputFile;
                                    outputFile.open ((ofn.lpstrFile), fstream::in | fstream::out | fstream::trunc);
                                    if(outputFile.is_open())
                                    {
                                        outputFile << textBoxCoords;
                                        outputFile.close();
                                        if(textOutput){cout << "File Saved.\n";}
                                    }
                                    else
                                    {
                                        if(textOutput){cout << "File failed to open.\n";}
                                        MessageBox(hwnd, "File could not be saved.", "Error!",
                                            MB_ICONEXCLAMATION | MB_OK);
                                        outputFile.close(); // Just in case.
                                    }
                                }
                            }
                            else
                            {if(textOutput){cout << "File save canceled.\n";}}
                        }
                        else
                        {MessageBox(hwnd, "Nothing to save.", "Error!", MB_ICONEXCLAMATION | MB_OK);}
                    }
                    break;
                    case ID_FILE_LOAD:
                    {
                        OPENFILENAME ofn;
                        WCHAR loadfile[MAX_PATH+1] = L"";
                        ZeroMemory(&ofn, sizeof(ofn));
                        ofn.lStructSize = sizeof(ofn); 
                        ofn.hwndOwner = hwnd;
                        ofn.lpstrFilter = (LPCSTR)"Text(*.txt)\0*.txt\0All Files(*.*)\0*.*\0";
                        ofn.lpstrFile = (LPSTR)loadfile;
                        ofn.nMaxFile = MAX_PATH;
                        ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST;
                        ofn.lpstrDefExt = (LPCSTR)"txt";
                        if(textOutput){cout << "Choosing load file...\n";}
                        if(GetOpenFileName(&ofn))
                        {
                            ifstream inputFile;
                            inputFile.open(ofn.lpstrFile);
                            if (inputFile.is_open())
                            {
                                if(textBoxCoords == "" || MessageBox(hwnd, "Loading a file will clear all current datapoints. Unsaved data will be lost. Are you sure you want to proceed?",
                                    "Barrel full of monkeys?", MB_ICONEXCLAMATION | MB_YESNO) == IDYES)
                                {
                                    textBoxCoords = "";
                                    inputFile.seekg(0, std::ios::end);
                                    textBoxCoords.reserve(inputFile.tellg());
                                    inputFile.seekg(0, std::ios::beg);
                                    textBoxCoords.assign((std::istreambuf_iterator<char>(inputFile)), std::istreambuf_iterator<char>());
                                    refreshTargetBoard();
                                    if(textOutput){cout << "Data loaded.\n";}
                                    inputFile.close();
                                }
                            }
                            else
                            {
                                if(textOutput){cout << "File does not exist or cannot  be read.\n";}
                                    MessageBox(hwnd, "File could not be opened.", "Error!",
                                        MB_ICONEXCLAMATION | MB_OK);
                            }
                        }
                        else
                        {if(textOutput){cout << "File load canceled.\n";}}
                    }
                    break;
                    case ID_BUTTON_RESETERRORS:
                    {
                        exitCode = 0;
                        g_hbmGreenLight = ConvertIplImageToHBITMAP(GreenLightOff);
                        program_ON = false;
                        char Starp[6];
                        sprintf(Starp, "Start");
                        SetDlgItemTextA(hwnd, ID_START_STOP, (LPCSTR)Starp);
                        updateMainWindow();
                        clickPoint[0].X = -1; clickPoint[0].Y = -1;
                        clickPoint[1].X = -1; clickPoint[1].Y = -1;
                        clickPoint[2].X = -1; clickPoint[2].Y = -1;
                        clickPoint[3].X = -1; clickPoint[3].Y = -1;
                        done = true;
                    }
                    break;
                    case ID_BUTTON_CLEARPROCESSING:
                    {
                        //Not written yet.
                    }
                    break;
                    case ID_FILE_CLEAR:
                    {
                        if(textBoxCoords == "" || MessageBox(hwnd, "All unsaved data will be lost.\r\nAre you sure you wish to proceed?", "Make data go \"Bye-Bye\"?", MB_ICONEXCLAMATION | MB_YESNO) == IDYES)
                        {
                            textBoxCoords = "";
                            refreshTargetBoard();
                            if(textOutput){cout << "Data cleared.\n";}
                        }
                    }
                    break;
                    case ID_FILE_OPTIONS:
                    {
                        if(g_hOptions != NULL)
                        {ShowWindow(g_hOptions, SW_SHOW);}//AnimateWindow(g_hOptions, 200, AW_ACTIVATE);}
                        else
                        {MessageBox(hwnd, "Options window failed to be created", "Warning!", MB_OK | MB_ICONINFORMATION);}
                    }
                    break;
                    case ID_FILE_CALIBRATE:
                    {if(textOutput){cout << "Calibration window not yet available.\n";}}
                    break;
                    case ID_FILE_EXIT:
                    {exitProg = true; done = true; Sleep(30); PostMessage(hwnd, WM_CLOSE, 0, 0);}
                    break;
                    case ID_HELP_INST:
                    {if(textOutput){cout << "Instructions window not yet available.\n";}} // TODO
                    break;
                    case ID_HELP_ABOUT:
                    {if(textOutput){cout << "About window not yet available.\n";}} // TODO
                    break;
                    case ID_LOAD_PROCESS:
                    {
                        if(exitCode == 0)
                        {
                            done = false;
                            if(!program_ON)
                            {
                                program_ON = true;
                                thread (pointProc).detach();
                                thread (workingIndicatorFunction).detach();
                            }
                        }
                    }
                    break;
                    case ID_START_STOP:
                    {
                        if(exitCode == 0)
                        {
                            if(!program_ON)
                            {
                                g_hbmGreenLight = ConvertIplImageToHBITMAP(GreenLightOn);
                                program_ON = true;
                                char Starp[5];
                                sprintf(Starp, "Stop");
                                SetDlgItemTextA(hwnd, ID_START_STOP, (LPCSTR)Starp);
                                updateMainWindow();
                                done = false;
                                thread (pointProc).detach();
                                thread (workingIndicatorFunction).detach();
                                if(true) // Part of functionality that was changed earlier.
                                {
                                    const int MAX_SHOTFILE_LINES = 512;
                                    IplImage* imgB4;
                                    IplImage* imgAR;
                                    Mat TempB4;
                                    Mat TempAR;
                                    ifstream shotFile;
                                    shotFile.open("Input Pictures/ShotFile.txt");
                                    if(shotFile.good())
                                    {
                                        char shotFileLine[MAX_SHOTFILE_LINES][512] = {};
                                        int countUp = 0;
                                        string lineGot = "";
                                        while(!shotFile.eof() && countUp < MAX_SHOTFILE_LINES)
                                        {
                                            std::getline(shotFile, lineGot);
                                            int lineGotSize = lineGot.size();
                                            for(int i = 0; i < lineGotSize; i++)
                                            {shotFileLine[countUp][i] = lineGot.at(i);}
                                            countUp++;
                                        }
                                        for(int i = 0; i < countUp; i++)
                                        {
                                            if(isalnum(shotFileLine[i][0]))
                                            {
                                                string filenames[2];
                                                int fileCoords[8];

                                                int numSearch = 0;
                                                int numCheck = 0;
                                                int totalShotFileWords = 0;

                                                string shotFileLineStr(shotFileLine[i]);

                                                for(;numSearch < 512;numSearch++)
                                                {
                                                    if(shotFileLine[i][numSearch] == ' ' || shotFileLine[i][numSearch] == NULL)
                                                    {
                                                        if(totalShotFileWords < 2)
                                                        {
                                                            filenames[totalShotFileWords] = "Input Pictures/" + shotFileLineStr.substr(numCheck, (1+numSearch-numCheck));
                                                        }
                                                        else if(totalShotFileWords < 10)
                                                        {
                                                            for(int count = numCheck; count < numSearch; count++)
                                                            {if(!isdigit(shotFileLine[i][count])){goto malformed_coords;}}
                                                            istringstream(shotFileLineStr.substr(numCheck, (1+numSearch-numCheck))) >> fileCoords[totalShotFileWords-2];
                                                        }
                                                        numCheck = numSearch+1;
                                                        totalShotFileWords++;
                                                    }
                                                    if(shotFileLine[i][numSearch] == NULL){break;}
                                                }
                                                malformed_coords:
                                                if(totalShotFileWords < 2) // Not enough filenames
                                                {/*\Nothing Happens\*/}
                                                else if(totalShotFileWords < 10) // Not enough coords
                                                {
                                                    imgB4 = cvLoadImage( filenames[0].c_str(), 1);
                                                    if(imgB4 != NULL)
                                                    {
                                                        TempB4 = imgB4;
                                                        imgAR = cvLoadImage( filenames[1].c_str(), 1);
                                                        if (imgAR != NULL)
                                                        {
                                                            TempAR = imgAR;
                                                            Mat TestshotB4 = TempB4*1;
                                                            Mat TestshotAR = TempAR*1;
                                                            falsePics(TestshotB4, TestshotAR, ++audioCount);
                                                            cvReleaseImage(&imgB4);
                                                            cvReleaseImage(&imgAR);
                                                            delete imgB4;
                                                            delete imgAR;
                                                        }
                                                    }
                                                }
                                                else // Got everything
                                                {
                                                    imgB4 = cvLoadImage( filenames[0].c_str(), 1);
                                                    if(imgB4 != NULL)
                                                    {
                                                        TempB4 = imgB4;
                                                        imgAR = cvLoadImage( filenames[1].c_str(), 1);
                                                        if (imgAR != NULL)
                                                        {
                                                            TempAR = imgAR;
                                                            Mat TestshotB4 = TempB4*1;
                                                            Mat TestshotAR = TempAR*1;
                                                            coords testShotCyanCoordsA, testShotCyanCoordsB, testShotCyanCoordsC, testShotCyanCoordsD;
                                                            testShotCyanCoordsA.X = fileCoords[0]; testShotCyanCoordsA.Y = fileCoords[1];
                                                            testShotCyanCoordsB.X = fileCoords[2]; testShotCyanCoordsB.Y = fileCoords[3];
                                                            testShotCyanCoordsC.X = fileCoords[4]; testShotCyanCoordsC.Y = fileCoords[5];
                                                            testShotCyanCoordsD.X = fileCoords[6]; testShotCyanCoordsD.Y = fileCoords[7];
                                                            falsePics(TestshotB4, TestshotAR, ++audioCount, testShotCyanCoordsA, testShotCyanCoordsB, testShotCyanCoordsC, testShotCyanCoordsD);
                                                            cvReleaseImage(&imgB4);
                                                            cvReleaseImage(&imgAR);
                                                            delete imgB4;
                                                            delete imgAR;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    shotFile.close();
                                }
                            }
                            else
                            {
                                g_hbmGreenLight = ConvertIplImageToHBITMAP(GreenLightOff);
                                program_ON = false;
                                char Starp[20];
                                sprintf(Starp, "Load and Process");
                                SetDlgItemTextA(hwnd, ID_START_STOP, (LPCSTR)Starp);
                                updateMainWindow();
                                done = true;
                            }
                        }
                    }
                    break;
                }
            }
                    break;
        case WM_CLOSE:
        {
            if(textBoxCoords == "" || MessageBox(hwnd, "Are you certain you wish to exit?\r\nAll unsaved data will be lost.", "Leaving so soon?", MB_ICONEXCLAMATION | MB_YESNO) == IDYES)
            {
                DestroyWindow(hwnd);
            }
        }
        break;
        case WM_DESTROY:
        {
            if(textOutput){cout << "\nExiting.\n\n";}
            else{if(IsWindow(consoleWindow)){ShowWindow(consoleWindow, SW_SHOW);} cout << "\nExiting.\n\n";}
            PostQuitMessage(0);
        }
        break;
        default:
            cout << setw(10) << hwnd << setw(10) << msg << setw(15) << wParam << setw(15) << lParam << endl;
            //Recent addition when this started. If you think the info I get from this would help, please ask!
            return DefWindowProc(hwnd, msg, wParam, lParam); // <===This thing!
    }
    return 0;
}

The actual code that it crashes on is in "chkstk.asm": "test dword ptr [eax],eax"

; Find next lower page and probe
cs20:
        sub     eax, _PAGESIZE_         ; decrease by PAGESIZE
        test    dword ptr [eax],eax     ; probe page. <====
        jmp     short cs10

Here is the full Stack Trace/Call Stack from Visual Studio:

Project1.exe!_chkstk() Line 99  Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_SendMessageW@16()   Unknown
msctf.dll!UIComposition::UpdateCompositionRect(class IMCLock &) Unknown
msctf.dll!CIMEUIWindowHandler::ImeUINotifyHandler(struct HWND__ *,unsigned int,unsigned int,long)   Unknown
msctf.dll!CIMEUIWindowHandler::ImeUIWndProcWorker(struct HWND__ *,unsigned int,unsigned int,long)   Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_SendMessageToUI@20()    Unknown
user32.dll!_ImeNotifyHandler@16()   Unknown
user32.dll!_ImeWndProcWorker@20()   Unknown
user32.dll!_ImeWndProcW@16()    Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_RealDefWindowProcWorker@20()    Unknown
user32.dll!_RealDefWindowProcA@16() Unknown
user32.dll!_DefWindowProcA@16() Unknown
Project1.exe!WndProc(HWND__ * hwnd=0x000f04be, unsigned int msg=642, unsigned int wParam=11, long lParam=0) Line 1842   C++
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_SendMessageW@16()   Unknown
imm32.dll!_MakeIMENotify@28()   Unknown
imm32.dll!_ImmSetCompositionWindow@8()  Unknown
user32.dll!_ImeSetContextHandler@16()   Unknown
user32.dll!_ImeWndProcWorker@20()   Unknown
user32.dll!_ImeWndProcW@16()    Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_RealDefWindowProcWorker@20()    Unknown
user32.dll!_RealDefWindowProcA@16() Unknown
user32.dll!_DefWindowProcA@16() Unknown
Project1.exe!WndProc(HWND__ * hwnd=0x000f04be, unsigned int msg=641, unsigned int wParam=1, long lParam=-1073741809) Line 1842  C++
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_SendMessageW@16()   Unknown
imm32.dll!_ImmSetActiveContext@12() Unknown
user32.dll!_FocusSetIMCContext@8()  Unknown
user32.dll!_ImeSystemHandler@16()   Unknown
user32.dll!_ImeWndProcWorker@20()   Unknown
user32.dll!_ImeWndProcW@16()    Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_DispatchClientMessage@20()  Unknown
user32.dll!___fnDWORD@4()   Unknown
ntdll.dll!_KiUserCallbackDispatcher@12()    Unknown
user32.dll!_GetWindowInfo@8()   Unknown
user32.dll!_RealDefWindowProcA@16() Unknown
user32.dll!_DefWindowProcA@16() Unknown
Project1.exe!WndProc(HWND__ * hwnd=0x000f04be, unsigned int msg=6, unsigned int wParam=1, long lParam=1640404) Line 1842    C++
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_DispatchClientMessage@20()  Unknown
user32.dll!___fnDWORD@4()   Unknown
ntdll.dll!_KiUserCallbackDispatcher@12()    Unknown
user32.dll!_GetWindowInfo@8()   Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallDlgProcCheckWow@32()    Unknown
user32.dll!_DefDlgProcWorker@20()   Unknown
user32.dll!_DefDlgProcA@16()    Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_SendMessageWorker@20()  Unknown
user32.dll!_SendMessageW@16()   Unknown
user32.dll!_xxxButtonNotifyParent@8()   Unknown
user32.dll!_xxxBNReleaseCapture@8() Unknown
user32.dll!_ButtonWndProcWorker@20()    Unknown
user32.dll!_ButtonWndProcA@16() Unknown
user32.dll!_InternalCallWinProc@20()    Unknown
user32.dll!_UserCallWinProcCheckWow@32()    Unknown
user32.dll!_DispatchMessageWorker@8()   Unknown
user32.dll!_DispatchMessageA@4()    Unknown
Project1.exe!WinMain(HINSTANCE__ * hInstance=0x00000000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00000000, int nCmdShow=1) Line 1914 C++
Project1.exe!std::_Bind<0,void,int (__stdcall*)(HINSTANCE__ *,HINSTANCE__ *,char *,int),HINSTANCE__ *,HINSTANCE__ *,char *,int,std::_Nil,std::_Nil,std::_Nil>::operator()() Line 1152   C++
Project1.exe!std::_LaunchPad<std::_Bind<0,void,int (__stdcall*)(HINSTANCE__ *,HINSTANCE__ *,char *,int),HINSTANCE__ *,HINSTANCE__ *,char *,int,std::_Nil,std::_Nil,std::_Nil> >::_Run(std::_LaunchPad<std::_Bind<0,void,int(__stdcall*)(HINSTANCE__ *,HINSTANCE__ *,char *,int),HINSTANCE__ *,HINSTANCE__ *,char *,int,std::_Nil,std::_Nil,std::_Nil> > * _Ln=0x0012fafc) Line 196  C++
Project1.exe!std::_LaunchPad<std::_Bind<0,void,int (__stdcall*)(HINSTANCE__ *,HINSTANCE__ *,char *,int),HINSTANCE__ *,HINSTANCE__ *,char *,int,std::_Nil,std::_Nil,std::_Nil> >::_Go() Line 187 C++
msvcp110d.dll!_Call_func(void * _Data=0x0012fafc) Line 52   C++
msvcr110d.dll!_callthreadstartex() Line 354 C
msvcr110d.dll!_threadstartex(void * ptd=0x00bcaba8) Line 337    C
kernel32.dll!@BaseThreadInitThunk@12()  Unknown
ntdll.dll!___RtlUserThreadStart@8() Unknown
ntdll.dll!__RtlUserThreadStart@8()  Unknown

I'm not actually certain where to go from here. Help?

(If you need more information about it, please ask - I'm not entirely certain what's relevant here, and there's a lot of code and a lot of data... EDIT: This should now be apparent to all...)

Look deeper into the call stack. One common reason for stack overflows is infinite recursion. Does DefWindowProc somehow do something which ends up calling WndProc , which then calls DefWindowProc , which then calls WndProc ? There may be several layers of function calls in between.

It could also simply be an excessive use of the stack. One of several ways to increase stack size is this: http://msdn.microsoft.com/en-us/library/tdkhxaks.aspx

Other possible reasons are massive allocations on the stack (often involving alloca ), or stack corruption.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM