Click here to Skip to main content
15,891,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMouse coordinates are too big Pin
rkwan15-Oct-02 0:14
rkwan15-Oct-02 0:14 
GeneralRe: Mouse coordinates are too big Pin
Jon Hulatt15-Oct-02 1:03
Jon Hulatt15-Oct-02 1:03 
GeneralRe: Mouse coordinates are too big Pin
rjuncu15-Oct-02 3:34
rjuncu15-Oct-02 3:34 
GeneralCList Pin
stevenson14-Oct-02 23:17
stevenson14-Oct-02 23:17 
GeneralRe: CList Pin
Alexandru Savescu14-Oct-02 23:24
Alexandru Savescu14-Oct-02 23:24 
GeneralDebug Vs Release Mode Pin
Jamil Ahme14-Oct-02 22:55
sussJamil Ahme14-Oct-02 22:55 
GeneralRe: Debug Vs Release Mode Pin
jmkhael14-Oct-02 23:03
jmkhael14-Oct-02 23:03 
GeneralRe: Debug Vs Release Mode Pin
Anonymous15-Oct-02 0:09
Anonymous15-Oct-02 0:09 
I had a very similar experience. In my case, I forgot to fill the iSubItem field of a LVITEM structure. In debug mode, this field is filled with 0xcccccccc or something, but in release builds, it's filled with whatever happens to reside in that memorylocation previously...

If it's not a LVITEM struct, check if you aren't forgetting to initialise a variable somewhere. An overlooked boolean can be enough to crash the program... (happened to me 4 days ago...)

I used this to find the bug:

extern void SendToDebugFile(const char* comment,bool bNew=false)<br />
{<br />
	FILE* f;<br />
	if(bNew) // Clear the debug file<br />
		f=fopen("Debug.txt","w");<br />
	else // Append to the debug file<br />
		f=fopen("Debug.txt","a");<br />
	if(f)<br />
	{ // append comment to file<br />
		fprintf(f,"%s\n",comment);<br />
		fclose(f);<br />
	}<br />
};


Just call this function at specific locations:
SendToDebugFile("Start of function",true);<br />
...<br />
SendToDebugFile("Marker 1");<br />
...<br />
SendToDebugFile("Marker 2");<br />
...<br />
SendToDebugFile("End of function");


The bug will occur between the last marker in the file and the next one. Zoom in on it with more markers.
GeneralRe: Debug Vs Release Mode Pin
Steen Krogsgaard15-Oct-02 2:08
Steen Krogsgaard15-Oct-02 2:08 
GeneralRe: Debug Vs Release Mode Pin
Raphael Kindt15-Oct-02 2:16
Raphael Kindt15-Oct-02 2:16 
GeneralRe: Debug Vs Release Mode Pin
Daniel Turini15-Oct-02 2:23
Daniel Turini15-Oct-02 2:23 
GeneralRe: Debug Vs Release Mode Pin
Tomasz Sowinski15-Oct-02 2:30
Tomasz Sowinski15-Oct-02 2:30 
GeneralVC++ Application Size Pin
ShahShehpori14-Oct-02 22:44
sussShahShehpori14-Oct-02 22:44 
GeneralRe: VC++ Application Size Pin
jmkhael14-Oct-02 22:54
jmkhael14-Oct-02 22:54 
QuestionHow To redirect to MS Word Pin
newin14-Oct-02 22:27
sussnewin14-Oct-02 22:27 
GeneralCComVariant to c-style string Pin
suresh_sathya14-Oct-02 20:29
suresh_sathya14-Oct-02 20:29 
GeneralRe: CComVariant to c-style string Pin
alex.barylski14-Oct-02 20:55
alex.barylski14-Oct-02 20:55 
GeneralRe: CComVariant to c-style string Pin
Paul M Watt14-Oct-02 20:58
mentorPaul M Watt14-Oct-02 20:58 
QuestionChange wnd style of a dialog?!?!? Pin
Daniel Strigl14-Oct-02 20:18
Daniel Strigl14-Oct-02 20:18 
AnswerRe: Change wnd style of a dialog?!?!? Pin
alex.barylski14-Oct-02 20:37
alex.barylski14-Oct-02 20:37 
AnswerRe: Change wnd style of a dialog?!?!? Pin
Paul M Watt14-Oct-02 21:02
mentorPaul M Watt14-Oct-02 21:02 
GeneralRe: Change wnd style of a dialog?!?!? Pin
adamUK15-Oct-02 1:51
adamUK15-Oct-02 1:51 
QuestionHow to set File/Dir owner (on NTFS)? Pin
Qiang.Fu14-Oct-02 18:59
Qiang.Fu14-Oct-02 18:59 
AnswerRe: How to set File/Dir owner (on NTFS)? Pin
Anonymous15-Oct-02 22:22
Anonymous15-Oct-02 22:22 
QuestionHow to DrawText on top of child window? Pin
Hiusing14-Oct-02 18:39
Hiusing14-Oct-02 18:39 

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.