Due to a well known problem with adobe reader, I do call ::OleInitialize(NULL) right in the beginning of main(). But even with that hack, once I hover over a filename inside the GetOpenFileName dialog and the tooltip appears, my app's memory is corrupted and it actually crashes when it receives a WM_PAINT and tries to access that memory.
I want to break the debugging as soon as any code writes in that memory. Is it possible?
OPENFILENAME _ofn; vector<char> _Filename(1024); // buffer for file name //vector<char> _Filename(MAX_PATH); // buffer for file name ::ZeroMemory(&_ofn, sizeof(_ofn)); _ofn.lStructSize = sizeof(_ofn); _ofn.hwndOwner = *_Owner->Qdwindowp; _ofn.lpstrFile = &_Filename; // Set lpstrFile to '\0' so that GetOpenFileName does not // use the contents of _Filename to initialize itself. _ofn.lpstrFile = '\0'; _ofn.nMaxFile = _Filename.size(); _ofn.lpstrFilter = _Filter; _ofn.nFilterIndex = 1; _ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | ( _Allowmultiselect ? OFN_ALLOWMULTISELECT : 0 ); ::GetOpenFileName(&_ofn);