Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vshost32.exe crash when calling unmanaged DLL

I'm using a VS 2005 app to interface against an unmanaged (Fortran) DLL. When I run the compiled executable straight from the command line, everything is fine - the DLL can be accessed, and I can work with the functions in the DLL.

Unfortunately, when I launch the app from VS 2005, I get a popup stating "vshost32.exe has stopped working" and no useful debugging information.

Has anyone experienced this behavior, or know why this might be occuring? I can't figure out why it would run fine when launched stand-alone, but not via vshost32.

(One last note: I am using .local files to force registered dlls to be used from cwd, but this particular dll is not registered. I'm just noting it here in case it helps.)


Thanks very much,

Mike

like image 618
Mike Avatar asked Nov 29 '22 05:11

Mike


1 Answers

I had problem with crashes of vshost32.exe the problem vanished when I checked the checkbox:

Properties -> Debug -> Enable unmanaged code debugging

Does it work for you?

EDIT: In more recent versions the option is called: Enable native code debugging (thanks Qwerty01)

EDIT: It also seems to help in VS2008 (@Deacon Frost), VS2010 (@Alxandr).

like image 101
Martin Vseticka Avatar answered Jan 31 '23 07:01

Martin Vseticka