Our application runs in a kiosk environment, that is, just Windows and our program, no Explorer. Our app is started automatically as Windows starts. If it is closed when the user is logged into our app with a low privileges profile, Windows is shut down. However, if an administrator-level user (in our app's sense, not Windows) closes our app, an Explorer instance is launched and Windows can be used "normally".
This worked perfectly on Windows XP, but now that we' re moving on to Windows 7, we found this specific scenario where it crashes:
- Turn on the computer and log into our app with an admin profile.
- Close the app (Explorer is launched)
- Log off (not restart) from Windows
- Log in (this will relaunch our app)
And it's in this point where our app crashes and we get the Windows message "YourApp.exe closed unexpectedly. Windows is looking for a solution to this problem...". We tried logging in the first line of code, but it doesn't get executed. It seems that our program cannot even get started.
Any tips on debugging this kind of scenario?
UPDATE: I reprod' the problem in a dev machine and let the "Windows is looking for a solution to this problem..." message time out and offer me to debug the program. From that, I discovered that I'm getting an AccessViolationException
when trying to initialize a Winforms User Control we made which wraps a native C++ class that renders using a Direct3D9 device. So this is very likely a Direct3D9 thing. I'm currently trying to get the exception break to stop on native code since that might yield more information.
Weird enough, the error doesn't happen with my debug binaries. Only with the release build.