views:

196

answers:

3

If I start my self written app from the explorer it works fine.

If I try to start it in visual studio(F5), it crashes at some point. It is also not dependant on the working directory!

It is quite annoying, because I cannot debug that way. (I could try attaching to the process after launch, but....)

Can anyone point me into a direction that I may have overlooked? What settings can cause such strange circumstances in general?

Thanks a lot in advance!

EDIT: System and stuff involved: WinXPProSp3(32bit), VS2005Sp1, Win SDK6.1, DXSDK09

EDIT: Clarification: The program I wish to debug crashes without a comment. Visual Studio has no problem and just states that the program to debug has terminated.

The Debug settings are all in order. I can debug and step through the beginning up to a certain point, where the debug info leaves me (some lib related to DirectShow) and the program peacefully dies.

I have only the Debug build configuration set up.

I hit F5 -> dead I start the same exe from outside the ide -> works like a charm.

I still am nowhere near of figuring this out... <:|

EDIT: Answer: A decoder library that doesn't work in debug mode managed to slip into my DirectShow filter chain. That caused all this strange behaviour. I simply uninstalled it. (somehow lowering the "merit" on the thing didn't work). Thanks for the help.

A: 

When you say, "crashes at some point," do you mean that the IDE crashes or that your program stops execution and the IDE displays the source code line that triggered the unhandled exception?

Chris Judge
Thanks for the interest! see my clarifications.
AndreasT
A: 

Do you need the working directory to be correct for your program, the default behaviour is for the working directory to be where VS is running from.

If you do set it by going to the project properties, debugging and fill in working directory

DrHazzard
as I stated, the problem is not Working directory related. I checked which dlls got loaded, they are ok. I even (in desperation) copied the media stuff into every directory related to the project. Which was really nonsense because missing data files get handled correctly.
AndreasT
The default for the working directory is the location of the .prj file, btw.
AndreasT
+1  A: 

Since you mention DirectShow, the FAQ says

When I run my application in the debugger, it crashes.

Some decoders are designed not to work while the application is attached to the debugger. Try running the application outside the debugger.

Not very helpful, but could explain why. You might have to go back to output debugging info using some logging routines or System.Diagnostics.Debug.Write

sgmoore
Damn! That could be it! I'll look into it. Thanks a lot! +1
AndreasT
Thanks man! I would give you 10+ if I could :) That hint was solid gold. A Nero decoder snuck in between me and my cam, that was the problem. Their decoders are obviously not debuggable.
AndreasT