[softwarelist] Re: Odd DPlngScan error
- From: Alan Adams <alan@xxxxxxxxxxxxxxxx>
- To: davidpilling@xxxxxxxxxxxxx
- Date: Thu, 08 Dec 2016 15:39:46 GMT
In message <55eb4d8c82chris@xxxxxxxxxxxxxxxxxxxxx>
Chris Johnson <chris@xxxxxxxxxxxxxxxxxxxxx> wrote:
In article <c883fa86-80b7-1873-9da4-c5eb5a6388eb@xxxxxxxxxxxxxxxx>,
David Pilling <david@xxxxxxxxxxxxxxxx> wrote:
Presumably you could start changing the Alias$... when the buttons
in DPScan are clicked.
Yes. That is in my list of things to look at.
Another way of doing it would be for DPScan to look if Alias$...
for a given type is set to point to itself - if not ignore the
request to load the file.
I cannot see any advantage in allowing multiple instantiations of
DPScan - it is a 'multi-document' application anyway. I think I will
add code to trap any attempt to start another instance.
Looks like the coming weekend is now organised 8)
If it's any help, here's how I do the check. The real issue of course
is what to do when you detect another instance.
DEF FNstartwimpcheck(name$, neededversion%)
LOCAL h%
h%=FNfindtask(name$)
IF h%=0 THEN
PROCstartwimp(name$,neededversion%)
=TRUE
ELSE
IF DEBUG% THEN *report name$ is already running - cannot start
another copy
=FALSE
ENDIF
DEF FNfindtask(name$)
LOCAL ptr%,taskid%,handle%,I%,A$,name%
ptr%=0
taskid%=0
REPEAT
SYS "TaskManager_EnumerateTasks",taskid%,wlib_block%,16 TO
taskid%,ptr%
handle%=!wlib_block%
name%=wlib_block%!4
I%=0
A$=""
WHILE ( I%<256 ) AND ( (name%?I%) >= 32 )
A$+=CHR$(name%?I%)
I%+=1
ENDWHILE
UNTIL taskid%<0 OR A$=name$
IF A$=name$ THEN =handle% ELSE =0
--
Alan Adams, from Northamptonshire
alan@xxxxxxxxxxxxxxxx
http://www.nckc.org.uk/
To unsubscribe or subscribe goto:
//www.freelists.org/list/davidpilling
Other related posts: