Am 25.05.2013 18:58, schrieb ObiWan:
> Well... given that the OP posted (in another branch of this thread)
> some totally dumb code using the "As New"...
Since when is usage of "As New" considered "totally dumb"?
It is a valid VB-construct which just implies an implicit
and hidden Is-Nothing-Check, before accessing the Variable.
And if somebody decides to use it - especially when he has
some years of experience under his belt, and knows exactly
what to expect from the auto-instancing-behaviour of those
Variables, how on earth does this qualify as "totally dumb"?
It's a nice feature in my opinion.
> my suspect is that he has some code which is dealing with
> "termination" and that this code *expects* to have some
> initialized objects,
What does this have to do with the OPs problem? IIRC, it was
manifesting itself only on startup of a *second* instance of
an App (with a Manifest).
And the relevant codelines for this case were only:
Public Sub Main()
If App.PrevInstance Then
MsgBox "You are already running this application."
Exit Sub
That's all. Just the App.Previnstance-Check and a plain
and simple MsgBox, no "As New" Variable anywhere.
So, why do you think, the App failed (only beeping, not
starting up the Process)?
I mean, I've already mentioned what I've encountered some
years ago. Such crashes are quite normal, in case you define
a Manifest - and then don't initialize the CommonControls-Dll.
To avoid this weird startup-behaviour for "manifested"
Apps, you will have to Init (load) the CommonControls-Dll,
before your upstarting process attempts to show anything
"visual".
> then ok, it's a totally dumb and wrong design but we
> aren't dealing with it in this thread
>
I have no clue, what "totally dumb and wrong design" you
are constantly babbling about.
Care to explain?
Olaf