Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
689 views
in Technique[技术] by (71.8m points)

visual studio 2005 - 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...