views:

148

answers:

4

I am using Visual Studio 2008 to run an application, which loads a number of DLL's at startup, that immediately exits with "The program '[3668] cb_tcl.exe: Native' has exited with code -1072365566 (0xc0150002)." Unfortunately I get no other clues about the source of the problem and the exit occurs before the program starts, but I suspect some sort of issue with one of the DLL's. Can anyone recommend some good tools to use to help isolate the cause of the startup issue?

+5  A: 

I'm not positive this is what you are looking for, but Dependency Walker is very helpful for me in situations like this.

Jeff Wilhite
+1 I was searching for the name of this soft but couldn't find it
f4
Yes! Been a while since I've used Visual C++ so I couldn't remember the name, but used that tool years ago with success. Thanks
RickNotFred
This tools gets installed with visual studio.
Unicorn
A: 

You might try turning on break-on-exceptions, in Debug->Exceptions. It might be throwing a catchable exception, and if so, if you click all the checkboxes in the Debug->Exceptions window, the debugger will break on the exception rather than let the program die like that.

I doubt Dependency Walker will help, that'll tell you what DLLs you are loading but so does the Visual Studio output window, and whichever DLL was printed last is the only one worth considering.

Scott Stafford
had tried this too. Problem was missing dll's referenced buy other dll's.
RickNotFred
A: 

The output window in Visual Studio 2005 will show dll's being loaded when you start in the debugger. I'm sure that VS 2008 will do the same. If it isn't showing dll's loading, right click on the output window, you should see a menu that lets you enable "Module Load Messages".

the last dll load message should be your culprit. You can then set a breakpoint in it's DllMain and try and figure out why it's failing.

John Knoeller
ALready had this enabled, thanks. depends immediately pointed to issues.
RickNotFred
A: 

Do you not get any output in the Visual Studio debug window? For example, when I run a debug build I get a list of DLLs it's loading like this:

'Blah.exe': Loaded 'C:\StarTeam\Blah\Development\Blah\CODE\Debug\Blah.exe', Symbols loaded.
'Blah.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Blah.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Blah.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'Blah.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Blah.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.

The shortcut to enable/show the window is Alt+2 in VS2005. I assume it's the same in VS2008. Make sure the top of the window shows its outputting "Debug" messages. And right click to ensure all output is selected so you don't miss anything.

John D.