TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Doug Nazar
date: 1996-04-12 04:02:08
subject: Enhanced WPProgram

Hello All!

I remember a few months ago there was a discusion about enhancing the
WPProgram WPS class to support environment overrides. I know someone was
working on one but I wanted to learn WPS programming and also had need of
such a beast.

So a few weeks ago I started working on it. I thought I'd share some info
that I came across.


WPProgram seems to spawn a thread for each program you start, to handle the
the WM_APPTERMINATENOTIFIY message from WinStartApp.

There is an API called WinStartApp. (I've always used DosStartSession or
DosExecPgm before)

I original used DosStartSession and one monitoring thread with a
termination queue but this caused problems with wpDeleteFromObjUseList()
not removing the in-use style.

WinStartApp will allow use of DosSetExtLIBPATH() so I now have support for
that too 

Couldn't seem to get ICollectionList* classes to even compile. It seemed
like it wanted my elements to be descendents of INotifier.

Seems to be a bug with the SOM compilier and the 'hh' emitter when then
used with VA. The metaclass is specified as a SOM name but there isn't one
for it yet. Solution is to manually change it to C++ name (ie. remove the
quotes)

AFAIK there are three ways of opening a program. wpOpen(), wpDrop, &
wpOpen() from and associated datafile. All of which require you to write
code for 


What I have now is a class which inherits from WPProgram. It adds two
settings pages, one for the environment overrides & the other for the
libpaths. Not all functionality is there yet. It's basically missing error
reporting & support for '*' as the exe. I also want to add environment
substitution in the overrides.

It is built with VisualAge C++ 3, current updates. Using DTS and the IOC libraries.

I'd like to post it and get some feedback.

Peter if you could let me know if it's ok to post, it's about 1300 lines total.

Anybody wanting a copy of the source and or dll, send me netmail here or
email to ratchet{at}idirect.com

Doug

--- GoldED/2 2.50+
* Origin: Realm of the Dragons - `Where thy mind hath no limits' (1:250/516)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 250/516 101 99 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.