Currently I'm seeing an oddity in functions in one of my programs in visual studio is acting. VS allows me to put break points at certain points in the file, but then in debug mode it moves these break points to spaces and comments.
Things I've already tried:
In case there is simply something odd with my code causing this here is the function it happens in:
bool BManager::Record(string _strFile)
{
bool bSuccess = false;
CBitmap * bitmap = new CBitmap();
HBITMAP handle = NULL;
HPALETTE hPalette = NULL;
//LoadBitmapFromBMPFile( (LPTSTR)_strFile.c_str(), &handle, &hPalette);
ofstream out;
out.open(_strFile.c_str());
handle = (HBITMAP)LoadImage(NULL, (LPTSTR)_strFile.c_str(), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);
bitmap->FromHandle(handle);
bSuccess = ImageBitmap_Record(bitmap);
delete bitmap;
bitmap = NULL;
CloseHandle(handle);
return bSuccess;
}
Any thoughts?
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
The breakpoint will stop your program just before it executes any of the code on that line. Set a breakpoint at line linenum in source file filename .
Make sure the file containing that code doesn't have any optimization flags that override the global settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With