473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help! How to debug if only release version crashes...

Hi, gurus,

I am new with visual studio... I am trying to build a standalone C++ project
by MS visual C++, the problem that I have is: if compile it as "Release"
version, it crashes by a certain combination of the operations, while if
compile it as "debug" version, there is no problem. I also tried to "debug"
the release version in the IDE, after seeing warning and choosing "debug
anyway", there is no crash...I guess the problem has something to do with the
file I/O, but I don't know the debugging method in this situation.

Any suggestion on how to debug this problem??? Thanks a lot!
Nov 22 '05 #1
2 1815

"Song" <aa******@hotmail.com> schrieb im Newsbeitrag
news:7F**********************************@microsof t.com...
Hi, gurus,

I am new with visual studio... I am trying to build a standalone C++
project
by MS visual C++, the problem that I have is: if compile it as "Release"
version


This has definetely nothing to do with .NET. In most cases where this
happens, it is because you are writting beyond allocated memory, or are
freeing it two times. That's a common error when handling BSTR in COM
programming. Simply download a trial of BoundsChecker
(http://www.compuware.com/products/devpartner/bounds.htm) and run Visual
Studio on the debug release. In most cases, this will show you a bunch of
errors, and maybe one of them is crashing your release built app.

Regards
Nov 22 '05 #2

"Song" <aa******@hotmail.com> wrote in message
news:7F**********************************@microsof t.com...
Hi, gurus,

I am new with visual studio... I am trying to build a standalone C++ project by MS visual C++, the problem that I have is: if compile it as "Release"
version, it crashes by a certain combination of the operations, while if
compile it as "debug" version, there is no problem. I also tried to "debug" the release version in the IDE, after seeing warning and choosing "debug
anyway", there is no crash...I guess the problem has something to do with the file I/O, but I don't know the debugging method in this situation.

Any suggestion on how to debug this problem??? Thanks a lot!


Well, you can always Use "Programmer's Best Friend", the MessageBox at
strategic places in your code. The last message you get prior to the crash
will be closest to the offending code. It's a good idea to use use "1" as
the header for the first message, "2" for the second and so on. The actual
message should show somethingthat can help you to identify the problem. If,
for instance, you think the problem may be related to a BSTR, then you
should show it as the message.If you want to debug a file handle, you may
want to use something like (fileHandle!=NULL)?"fileHandle!=NULL" :
"fileHandle==NULL"

/ Fredrik
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
0
by: tbatwork828 | last post by:
If you were like me trying to figure out how to launch context sensitive help topic by the context id, here is the link: http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx and if...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.