Quote:
> VB6SP6. In this one example case the class is used only from
> the main form. There is a bas module with a startup Sub Main
> that sets and shows the form. Dim fMain as frmMain. From then
> on, the form is always in existence until the app is exited. I can
> declare and set the class either place, bas module or form. What
> are the pros and cons to the location . . .
While not directly related to your specific question, I recently had a
problem with my app crashing ("AppX has stopped responding") when I checked
App.Previnstance and used the result to close an instance of my application
if another instance was already running. This occurred in an app which was
doing some subclassing for the mouse scroll wheel and other things. I was
useing my main Form as the startup module and I checked App.Previnstance in
my main Form's Load event, closing it if an instance was already running.
That's when I got the "Appx has stopped responding", from the second
instance (the one I had just closed). Moving the App.Previnstance check to a
bas module (and making Sub Main the startup routine) solved the problem. I
was busy at the time and so I didn't look into it further, but I imagine it
was something to do with the second instance of the app in some way picking
up the subclassing of the first instance.
Mike