POV-Ray : Newsgroups : povray.beta-test : Win POV mixed versions single instancing Server Time
29 Jul 2024 12:30:03 EDT (-0400)
  Win POV mixed versions single instancing (Message 1 to 5 of 5)  
From: Gelu Stoicescu
Subject: Win POV mixed versions single instancing
Date: 9 Jun 2002 16:39:37
Message: <3d03bd09@news.povray.org>
Win POV
3.5.beta.RC5.icl.win32
3.1g.watcom.win32 [Pentium IIoptimized]
OS Win98 SE, hardware not an issue
(nothing improved since my last post, sigh...)

Problem:
When either one of versions 3.1 or 3.5 (RC5 for that matter) is
"running" and the "other version" is set to run single instance, when
launching the "other version" it inadvertedly recognizes the "running"
instance as its own and brings focus on the existing window instead of
launching itself. This happens no matter how that "other version" is
launched (menu, shortcut, double-clicking the .exe and so on).

Cause:
I briefly investigated this with Spy++ (tool part of MS VS) and found
that both versions have very similar id infos (same class name for the
main window "PovMainWinClass" and same caption). The .exe launched is
correct but the instance recognition fails because some elements OS
relies when identifying instances are identical.

Suggested (working) fix:
Have the version number mangled somewhere in the main window class name,
as to make a difference for each version.
As Win specific code is not yet available for any of the versions, and
I'm such a sore excuse hacker that I don't even have a decent hex-editor
on my disks, I fell down to good old DOS days edit.com, still available
in Windows/Command; has binary open option, is long filenames awared and
features lovely color customization :) With this wonderful tool I was
able to modify the only occurence of the main window class name in .exe
to PovMaimWinClass (to preserve length and because "maim" is what I done
after all) and to perform a saving which, to my surprise, resulted in an
.exe of the same lenght and functionality. And the offending behaviour
was corrected too.
In a separate experiment I even managed to replace the windows caption
(with a search and replace which, as a side effect,  messed up the whole
logo messages) but seems like OS instance recognition doesn't care about
that one.
Of course this problem is tranzient, when 3.5 is final we'll all know
what version to choose :) Then again, the issue may arise again when POV
4 beta will be around.


Gelu


Post a reply to this message

From: Gelu Stoicescu
Subject: Re: Win POV mixed versions single instancing
Date: 16 Jun 2002 13:24:23
Message: <3d0cc9c7@news.povray.org>
I'd appreciate 2 words here, as my post was badly timed right after RC6,
and I hate to wait 1 month for the next release to find out if my report
made any sense to anyone, while everybody is involved in an endless
(=infinite) dance around the hat operator (apologies to mexican readers,
no offense intended). In case I failed to make myself clear enough,
here's how to reproduce. It assumes you have both Win POV 3.1g and 3.5
(any beta/RC) installed and for no particular reason you need to have
them running at the same time (quite common case during beta testing, I
guess).

1. Launch 3.5 only to check menu "Options/Keep Single Instance" and also
"Options/Other Settings/Save Settings on Exit" (or make sure they're
checked). Now close 3.5.
2. Launch 3.1g and leave it running (visible, minimized, in the system
tray, whatever).
3. Now TRY to launch 3.5 in any manner (startup menu, shortcut, click
pvengine.exe, click .pov file) and observe how each time 3.5 thinks 3.1
app is its own instance, so walks away. See? Told you so :)

Of course, you could launch 3.5 first, but then again 3.1 may have been
set itself to keep single instance. Am I the only one who sees this
behaviour as abnormal? I wrote so much about so little because to SEE
the problem is really the hardest part here, fixing (read original msg)
is piece of cake.

Thx,
G.

"Gelu Stoicescu" <gel### [at] homero> wrote in message
news:3d03bd09@news.povray.org...
| Win POV
| 3.5.beta.RC5.icl.win32
| 3.1g.watcom.win32 [Pentium IIoptimized]
| OS Win98 SE, hardware not an issue
| (nothing improved since my last post, sigh...)
|
| Problem:
| When either one of versions 3.1 or 3.5 (RC5 for that matter) is
| "running" and the "other version" is set to run single instance, when
| launching the "other version" it inadvertedly recognizes the "running"
| instance as its own and brings focus on the existing window instead of
| launching itself. <...>


Post a reply to this message

From: bob h
Subject: Re: Win POV mixed versions single instancing
Date: 16 Jun 2002 21:34:56
Message: <3d0d3cc0@news.povray.org>
Nice try :-) You went about a "fix" in a manner I often use because I too
never program executables. I used to go about changing some things like
that, edit.com or the old Windows Write. I rarely do that anymore.

However, hate to say this after all you said and checked into it, the
#version directive is probably one of the best reasons to forget about
installing, or leaving installed, past versions. I'd be putting words in the
mouths of the POV-Team but they might think of it like this: why have
multiple installs of the same program when said program itself applies
backward compatibility? Yes, I know... not truly so but the idea is still
there.

Your reasoning seems mainly to be that multiple versions can't be ran with
different setups. I guess you could also argue the fact that patches can be
trouble if the system doesn't distinguish between official and unofficial
POV-Rays. Oh yeah, you did infer that already concerning the Beta.

I'll have to side with keeping to a singular version instead, but I see your
point when it comes to parallel patches and/or versions. I'm just willing to
bet that the program wasn't really meant to work in unison with others (and
itself) "out of the box" unless such programs are officially sanctioned,
which has been talked about in the past. In other words, version changes
moves things ahead and leaves the old versions behind. That's pretty common
practice.

bob h


Post a reply to this message

From: Chris Cason
Subject: Re: Win POV mixed versions single instancing
Date: 16 Jun 2002 22:59:23
Message: <3d0d508b@news.povray.org>
This issue has been rectified.

-- Chris


Post a reply to this message

From: Gelu Stoicescu
Subject: Re: Win POV mixed versions single instancing
Date: 20 Jun 2002 12:53:05
Message: <3d120871@news.povray.org>
Chris spoke, matter settled, me happy.
Just back to point out that at least MegaPov and PovMan have the same
issue (can't be launched same time with "clean" 3.1g). Seems fit to me
to add in the new WinPOV 3.5 sources that are to be released, one of
these #error directives to draw patchers's attention on customizing the
main window class name found in PVENGINE.C, just as you people did for
the patcher's name and email address. Perhaps you're way ahead and it's
already there. To answer bob and others about the opportunity of such
issue, IMO when it comes to incorrect behaviour in the multitasking OS,
up to not launching at all (even if only in some particular cases) the
users are entitled to full satisfaction, without having to answer
questions like "whatta heck do you need it for?", especially that the
fix is ridiculously simple and has no side-effects whatsoever (your
favourite prayer here).
Hope I'm not off-topic, since this group is mainly about removing
errors, not putting them in ;)

G.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.