home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-31 | 94.6 KB | 2,379 lines |
-
- This forum is supplied for demonstration purposes only and is
- accessible via the IBM OS/2 BBS system. What you see below is the
- forum as it existed on 10/30/92. The IBM OS/2 Bulletin Board System
- (BBS) is IBM's new electronic support offering for OS/2 Version 2.0.
- With OS/2 BBS you can electronically review OS/2 technical
- information, submit program defects to IBM, and receive information
- on how to solve problems. Users of the OS/2 BBS not only include
- OS/2 customers, but the OS/2 expertise of the entire internal IBM
- community worldwide. OS2BBS makes all this available via a local
- or toll free number in most major cities.
-
- To request a complete OS/2 BBS Information Package detailing
- the OS/2 BBS offering and including pricing and registration/access
- information, please call: 1-800-547-1283.
-
- ===== OS2PRG CFORUM created at 01:50:23 on 92/04/08 GMT (by HOPKINS at AUSVM8)
- IBM UNCLASSIFIED
- ----------------
- The information in this forum is considered by IBM to be
- external and may be shared by everyone who is given access.
- This forum is shared with the internal IBM employee conferences.
-
- Forum: OS2PRG CFORUM
-
- Forum subject: OS/2 Base Programming and System Routines
-
- This FORUM is provided as a conferencing tool to promote
- discussion of issues, questions, and problems relating
- to OS/2 Base Programming and System Routines.
-
- Contributions must not contain confidential or proprietary information.
-
- Each contributor agrees, in placing material in this forum, that IBM and
- other users are free to prepare derivative works based upon it, and to use,
- reproduce, perform, display and distribute inside and outside their company
- such material and such derivative works, without obligation or charge.
-
- IBM is not responsible or liable for the use, copying, or distribution of
- materials placed on this forum, and has therefore no obligation to control
- such acts.
-
- All subscribers are required to abide at all times by the conference
- rules described in the Bulletin Board Rules under "News and Announcements".
-
- All IBM personnel are required to abide at all times by the IBMPC RULES
- and the IBM Business Conduct Guidelines. IBM personnel will read the
- CUSTOMER FORUM RULES in IBMPC RULES before contributing.
-
- Contributions violating these rules will be deleted by the CFORUM
- Owner or their delegate, and in some cases by an IBM conference
- Administrator.
-
- The OS2BBS CFORUM is where anyone may raise concerns regarding rules
- violations found in this and other CFORUMS.
-
- The IBM Owner of this forum is:
- Name: Kenneth M. Hopkins, OS/2 Support Services
- Mailing Address: IBM Manufacturing and Development
- 11400 Burnet Road
- Internal Zip 2900-042/1D003
- Austin, Texas 78758
- IBM Node/Userid: AUSVM8/HOPKINS
-
- ----- OS2PRG CFORUM appended at 22:02:43 on 92/05/05 GMT (by IL80988 at OS2CUST)
- Subject: comm port address
-
- does anyone recall the comm port address for programming ?
-
- ----- OS2PRG CFORUM appended at 14:07:34 on 92/05/06 GMT (by SHOWPM1 at TPAVMPS2)
- Subject: comm port address
- Ref: Append at 22:02:43 on 92/05/05 GMT (by IL80988 at OS2CUST)
-
- If you are writing a device driver then the COM address depends
- on which COM port you want to use. I think that the address for
- COM1 is 3F8H. I do not know about other COM ports. If you are
- writing a OS/2 application all you need to use is DosOpen, to
- open the COM port, DosRead, to read information from the COM port,
- DosWrite, to write information to the COM port, and use DosDevIOCtl
- to control the COM port.
-
- Joseph Mogavero
-
- ----- OS2PRG CFORUM appended at 19:18:59 on 92/05/07 GMT (by SSIA013 at OS2CUST)
- Subject: Com port address
-
- Shouldn't you get the COM port address from 0:400 - 407? If I install a com
- port and have it address some place else (other than the standard post), then
- it should be reflected there.
-
- pgk
-
- ----- OS2PRG CFORUM appended at 14:34:07 on 92/05/11 GMT (by SHOWPM1 at TPAVMPS2)
- Subject: Com port address
- Ref: Append at 19:18:59 on 92/05/07 GMT (by SSIA013 at OS2CUST)
-
- Yes, That is correct you would look at the absolute address 400 - 406
- to find out the port base address. Thank you, I should have added that
- to my first reply. If you need more information about this I would
- get the 'Personal System/2 and Personal Computer BIOS Interface
- Technical Reference', you can order this book from you branch
- office. The IBM number on this book is S04G-3283-00.
- You can also get the book 'Micro Channel Architecture Revolution
- in Personal Computing', ISBN number 0-442-00433-8 this will help
- a little. I also know that there are some other books out there
- that talk about the BIOS.
-
- Joseph
-
- ----- OS2PRG CFORUM appended at 18:00:44 on 92/05/13 GMT (by TEMP19GD at CLTVM1)
- Subject: Peeking a memory location
-
- How does one go about looking at the contents of memory at some
- memory location under OS/2 2.0?
-
- Thanks,
- Justin Smith
-
- ----- OS2PRG CFORUM appended at 16:36:34 on 92/05/15 GMT (by FIECHTNE at BCRVMPC1)
- Subject: Peeking a memory location
- Ref: Append at 18:00:44 on 92/05/13 GMT (by TEMP19GD at CLTVM1)
-
- You must be able to build a Selector which includes the memory location
- where you wish to look. Only a device driver can build selectors.
-
- Mark Fiechtner
-
- ----- OS2PRG CFORUM appended at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
- Subject: Converting Windows programs to OS/2 via "MIRRORS"
-
- We are currently using the MIRRORS libraries to convert our Windows
- applications to OS/2. We have run into a couple of problems with MIRRORS. I
- am trying to find the correct forum to ask questions about MIRRORS conversion
- and report problem.
-
- ----- OS2PRG CFORUM appended at 13:09:37 on 92/05/19 GMT (by LECTION at BETASVM2)
- Subject: Converting Windows programs to OS/2 via "MIRRORS"
- Ref: Append at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
-
- The most correct forum would be OS2WIN CFORUM. Also, if you have any
- questions about direct conversion of Windows code to OS/2 code, please
- ask away in that forum! I've programmed Windows apps for IBM for seven
- years, and I am now doing OS/2. So I can compare the two programming
- wise to a great extent.
-
- David B. Lection
-
- ----- OS2PRG CFORUM appended at 13:14:26 on 92/05/19 GMT (by WEEKS at AUSVM2) -
- ..... OS2PRG CFORUM modified at 15:26:22 on 92/05/19 GMT (by WEEKS at AUSVM2) .
- Subject: Converting Windows programs to OS/2 via "MIRRORS"
- Ref: Append at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
-
- | Yeah, OS2WIN is probably better.
-
- Craig Weeks
- OS/2 Application Development Center
- Austin, Texas
-
- ----- OS2PRG CFORUM appended at 18:56:47 on 92/05/19 GMT (by KMCCARTH at ENDVM1)
- Subject: SYS RC4
-
- I am coding in C using PM and multiple threads and I get an ocasional
- RC 4 on a dosopen. I coded a dossetmaxfh to 40 but I don't have near
- that amt of files open. Does anyone know why this may be happening.
-
- Kevin E. Mc Carthy
-
- ----- OS2PRG CFORUM appended at 21:42:51 on 92/05/19 GMT (by UST1013 at OS2CUST)
- Subject: OS/2 Monitor
-
- aaadkfdjkdj kjasjsdjlasdj lksdjlksdfjlkjsdlsd
-
- ----- OS2PRG CFORUM appended at 21:44:05 on 92/05/19 GMT (by UST1013 at OS2CUST)
- Subject: OS/2 Monitor
-
- (no text entered)
-
- ----- OS2PRG CFORUM appended at 21:47:29 on 92/05/19 GMT (by UST1013 at OS2CUST)
- Subject: OS/2 Monitor
-
- Looking for an OS/2 monitor. Facilities should include a display summary of
- the active sessions/processes/threads. Would prefer one written in C that
- is packaged with C source code. P.W.
-
- ----- OS2PRG CFORUM appended at 15:30:19 on 92/05/20 GMT (by WWRAGG at SFOVMIC1)
- Subject: Converting Windows programs to OS/2 via "MIRRORS"
- Ref: Append at 13:14:26 on 92/05/19 GMT (by WEEKS at AUSVM2)
- Thanks for taking care of my customer
-
- ----- OS2PRG CFORUM appended at 14:59:42 on 92/05/21 GMT (by IL21834 at OS2CUST)
- Subject: Keyboard Buffer - Want to increase size
-
- I have an OS/2 PM application with a Dialog Box containing an entry field;
- input to this entry field is either keyboard entry or a bar code scanner;
- the scanner input is coming through the keyboard port.
-
- The problem we have is sometimes the scanner sends data to the keyboard buffer
- faster than the application can process it; the keyboard buffer is full;
- the PS/2 beeps; and characters are lost.
-
- Two questions: 1) What is the current size of the Keyboard buffer?
- 2) Is there a way for us to increase the size of the
- keyboard buffer?
-
- Thank You
- Ken Prince - EI DuPont
-
- ----- OS2PRG CFORUM appended at 14:24:38 on 92/05/28 GMT (by AOI1075 at OS2CUST)
- Subject: SYS RC4
- Ref: Append at 18:56:47 on 92/05/19 GMT (by KMCCARTH at ENDVM1)
-
- Are you opening files across the LAN? If so, I believe you can get a return
- code 4 from DosOpen because of the configuration settings on the server.
-
- J.Farmer
-
- ----- OS2PRG CFORUM appended at 18:04:28 on 92/06/04 GMT (by WZ00541 at OS2CUST)
- Subject: Converting Windows programs to OS/2 via "MIRRORS"
- Ref: Append at 15:30:19 on 92/05/20 GMT (by WWRAGG at SFOVMIC1)
-
- (no text entered)
-
- Joel Rosenberger, Attachmate Corporation
-
- ----- OS2PRG CFORUM appended at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
- Subject: Program Abends During Exit Processing
-
- I am in the midst of developing a PM application. One of the bugs that I am
- currently trying to remedy is an abend during the execution the "return"
- statement in main(). I am getting a SYS3175. I got into the debugger
- and set a breakpoint on the "return" statement. If I step into the code, I
- am dropped into the assembler and I abend there during what I presume is
- exitlist handling. I have coded no exitlist processing of my own.
-
- This is a multithreaded PM application and my current theory is that it has
- something to do with the cleanup of the threads. I do not terminate the
- threads in my code. I just exit the main routine. I've never had any
- problems with this under OS/2 v1.x. This is my first 32-bit PM application.
- I am using C Set/2.
-
- Any suggestions? The threads were started using _beginthread. I did not
- allocate any thread stack, as I understand that OS/2 v2.0 handles that now
- automatically. This one's got me stumped.
-
- Gary Murphy
-
- ----- OS2PRG CFORUM appended at 20:50:07 on 92/06/04 GMT (by OCANUC at BETASVM2)
- Subject: Program Abends During Exit Processing
- Ref: Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
-
- From an OS/2 command prompt, try "help sys3175" (if you haven't
- already). The error text suggests a problem with pointers rather
- than threads. Secondary threads should be shutdown automatically
- when the main thread is shutdown.
-
- Brandon Booth Advanced Programming - ICSRS
-
- ----- OS2PRG CFORUM appended at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
- Subject: How to turn an APIRET into a string?
-
- Pollling through the documentation, I can't find any way to get a
- character string version of one of the ERROR_ APIRET values. I could
- type in my own table of strings for them, but it would only be in
- english. This is for some substrate code that can't make assumptions
- about Vio versus PM. Is there something I don't know?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
-
- I know exactly what you're talking about because I looked for
- the same thing a couple of years back. I even started on the
- project, but quit (and for much the same reason you mention).
- So, if you write the dll, can I have a copy? (not serious;-)
-
- Brandon Booth Advanced Programming - ICSRS
-
- ----- OS2PRG CFORUM appended at 17:16:45 on 92/06/05 GMT (by IL11901 at OS2CUST)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
-
- Funny you should mention this at this point in time. We are finishing up a
- high level runtime API debugger and production code monitor. It reports the
- error which occurred AND a description of what the error means. This idea
- was born out of the problem you describe (having to look up every error code)
- and the concept of centralizing error handling.
-
- Message back if you are interested in more information.
-
- Steve Dacek - Soft & GUI Inc
-
- ----- OS2PRG CFORUM appended at 17:25:44 on 92/06/05 GMT (by IL11901 at OS2CUST)
- Subject: Program Abends During Exit Processing
- Ref: Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
-
- Most likely, you are not allocating enough stack or heap space (My money would
- be on heap space). Add a lot more in your definition file and see if the
- problem goes away. The minimum for both should be about 8K each. This has
- usually solved the problem you describe whenever it has happened to me.
-
- Good Luck.
-
- Steve Dacek - Soft & GUI Inc
-
- ----- OS2PRG CFORUM appended at 18:42:11 on 92/06/05 GMT (by XXNOVA24 at TORVMCOP)
- Subject: Program Abends During Exit Processing
- Ref: Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
-
- Instead of 'return'-ing you can call the DosExit function. I haven't
- tried it with GA CSET/2 but this should do the job.
-
- Geza Szivos
- NOVACOR Chemicals (403)-290-6583
-
- ----- OS2PRG CFORUM appended at 20:22:48 on 92/06/05 GMT (by OCANUC at BETASVM2)
- Subject: Program Abends During Exit Processing
- Ref: Append at 20:50:07 on 92/06/04 GMT (by OCANUC at BETASVM2)
-
- One other thing to look at is the size of the thread stack(s).
- You can (potentially) have three kinds of stacks: the main
- stack (specified in the def file), secondary thread stacks
- (specified on the _beginthread call), and a 16-bit stack if
- you make calls to 16-bit routines (this value is specified
- in a pragma in IBM C-Set2).
-
- Brandon Booth Advanced Programming - ICSRS
-
- ----- OS2PRG CFORUM appended at 22:34:35 on 92/06/05 GMT (by PMUELLR at CARVM3)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
-
- It may be overkill, but you can get text messages for os/2 error
- codes from the OSO001.MSG and OSO001H.MSG files in \os2\system (2.0).
- You can even do this in rexx with SysGetMessage()!
-
- Patrick Mueller - IBM Cary
-
- ----- OS2PRG CFORUM appended at 21:04:13 on 92/06/09 GMT (by ANFUSO at STLVM27)
- Subject: VIO Problems
-
- I have a non-IBM friend who is trying to port an application
- to OS/2 (1.1+). I'm not a programmer, but I'll pose his
- problem as best I can:
-
- .......................................................
- His application will run in a character-mode full-screen
- OS/2 session. He is concerned about the default colors
- available. He contends that the system pallette offers
- 16 colors, but notices that other applications use colors
- that don't seem to be available when he tries all of the
- 16 default colors. He is convinced that these other applications
- may be re-defining the system pallette, but wonders how this is
- done. He thinks it has something to do with "VIO".
- .........................................................
-
- I'm not even sure if this is even a good forum to append this
- question to, since I don't know if PM has anything to do with it.
- His program is, apparently, NOT a PM program.
-
- Any help at all would be appreciated, even if you can steer
- me in a better direction!
-
- Tom Anfuso J63/G331
- TL 543 - 4835
-
- ----- OS2PRG CFORUM appended at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
- Subject: Vio, in 2.0, what's that?
-
- The CP documentation makes passing reference to several
- vio things, including popups and the like. But no where
- in the $300 box of programming documentation can I find
- any other information about it. Is There Another Book?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 21:06:38 on 92/06/10 GMT (by WZ00576 at OS2CUST)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
-
- I saw the reply from someone at Cary referencing some files with
- strings in them, and a Rexx procedure to poke around therin.
- I'm finding it hard to believe that OS/2 2.0 lacks some API
- for fetching messages out of Locale=dependent files. In short,
- its hard to believe that there isn't a c-callable way to open
- the system message catalog and fish out the string for a
- particular APIRET. WHen I signed up for this BBS, the literature
- said that I could count on responses from the OS/2 support/devo
- group. Is this the right place to expect that?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 11:53:23 on 92/06/11 GMT (by PMUELLR at CARVM3)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 21:06:38 on 92/06/10 GMT (by WZ00576 at OS2CUST)
-
- I think you're referring to my append. Sorry I only referenced the
- rexx function SysGetMessage (in the RexxUtil.dll external functions).
- There is also a function you can use from C - DosGetMessage() (this is
- the name in 1.3 - it may have changed in 2.0, but I don't have the 2.0
- toolkit at home).
-
- Note that the original append seemed to want a way to translate a
- return code, say 8, into the string "ERROR_NOT_ENOUGH_MEMORY". There
- is a define in the toolkit for
- #define ERROR_NOT_ENOUGH_MEMORY 8
- I don't know how to do this. The SysGetMessage() and DosGetMessage()
- functions return the text for the message. For instance, here is a
- session from rexxtry with the 8 message:
-
- [E:\] rexxtry
- REXXTRY.CMD lets you interactively try REXX statements.
- Each string is executed when you hit Enter.
- Enter 'call tell' for a description of the features.
- Go on - try a few... Enter 'exit' to end.
- say sysgetmessage(8,oso001.msg)
- SYS0008: There is not enough storage available to
- process this command. All available storage is in use.
-
- ................................................ REXXTRY.CMD on OS/2
- say sysgetmessage(8,oso001h.msg)
- EXPLANATION: If segment swapping is active, the swap file may be
- full, or an input/output (I/O) error may have occurred on the
- auxiliary storage device that contains the swap file.
- ACTION: Do one of the following and then retry the command:
- 1. Reduce the number of running programs.
- 2. Reduce the value of the BUFFERS=, TRACEBUF=, DISKCACHE=,
- THREADS=, RMSIZE=, or DEVICE=VDISK.SYS statement
- in the CONFIG.SYS file. Then restart the system.
- 3. Remove unwanted files from the swap file
-
- ................................................ REXXTRY.CMD on OS/2
- exit
-
- As I said before, this may be overkill. Also note that the rexx
- function is implemented by calling DosGetMessage(). DosGetMessage()
- can be used to read any suitable OS/2 message file.
-
- Patrick Mueller - IBM Cary
-
- ----- OS2PRG CFORUM appended at 20:55:58 on 92/06/11 GMT (by JDEEN at AUSVM1) -
- Subject:Changing File Attributes
-
- I am in the midst of programming an application that at one time
- may need to write/delete files with the read-only or hidden-file
- file attributes, I would like to DosOpen() and DosSetFileInfo() but
- this is clearly out because I can not not DosOpen() with write flags
- on when the file is write protected. Am I missing something or is there
- a 2.0 api that I can change a read_only to normal file status..
-
- JAMES DEEN
-
- ----- OS2PRG CFORUM appended at 00:35:45 on 92/06/12 GMT (by RICHKULP at CARVM3)
- Subject: Changing File Attributes
- Ref: Append at 20:55:58 on 92/06/11 GMT (by JDEEN at AUSVM1)
-
- Look up DosSetPathInfo. This allows you to change the attributes of
- a closed file. The only restriction is that nobody else can have
- the file open (i.e. Read-Only is OK to allow changes).
-
- Rich Kulp
-
- ----- OS2PRG CFORUM appended at 17:54:58 on 92/06/12 GMT (by DAVISN at HOUVMSCC)
- Subject: Vio, in 2.0, what's that?
- Ref: Append at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
-
- The VIO and MOU calls (and maybe some others) are available in 2.0 for
- compatibility with 1.x. They are not available as 32-bit entry points,
- and are not documented with the 32-bit toolkit. If you need to find
- out how to use these calls, find a good book on programming OS/1 1.x
-
- sorry,
- Nathan Davis
-
- ----- OS2PRG CFORUM appended at 12:44:40 on 92/06/23 GMT (by WZ00576 at OS2CUST)
- Subject: How to turn an APIRET into a string?
- Ref: Append at 11:53:23 on 92/06/11 GMT (by PMUELLR at CARVM3)
-
- This is just what I wanted to know. Thanks.
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 12:50:14 on 92/06/23 GMT (by WZ00576 at OS2CUST)
- Subject: Vio, in 2.0, what's that?
- Ref: Append at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
-
- The response is not informative.
-
- When the Control Program reference, particularly on the topic
- of DosExecPgm and DosStartSession, references Vio popups,
- is is describing a feature that is no longer meaningful? Is there
- no 32 bit API to OS/2 session windows at all? Is there a corresponding
- PM concept the documentation should reference instead?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 14:45:03 on 92/06/24 GMT (by LINSUSAN at HKGVM8)
- Subject: compiling and linking 16-bit OS/2 API programs in 2.0
-
- I have a sample program which calls the AS/400 PC Support API's.
- This sample program was compiled using MS C 6.0 and OS/2 1.3 toolkit.
- Therefore these must be 16 bit API's.
-
- How do I call these API's in a 32 bit program developed using
- C Set/2, Toolkit 2.0? Unfortunaly the DLL that came with this
- API must be a 16 bit DLL. I seem to recall that I can call a 16 bit DLL
- from a 32 bit program.
-
- What changes must I make to the header file? Right now the
- header contains statements such as :
-
- extern int extentry QSNDDTAQ(...........
-
- but my compiler doesn't like it.
-
- How about any special options I must set to compile and link this?
-
- Susan S. Lin
-
- ----- OS2PRG CFORUM appended at 14:48:25 on 92/06/24 GMT (by LINSUSAN at HKGVM8)
- Subject: Minimize a session
-
- I have written a OS/2 full screen program to DosStartSession a
- DOS FS program, after the DOS program finishes running, I do not
- want to close the session but want to minimize it and put it in
- the background.
-
- What function do I need to make this happen? There is a DosSelectSession
- to bring a dependent child session to the foreground but what
- about moving the child session to the background?
-
- Susan S. Lin
-
- ----- OS2PRG CFORUM appended at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
- Subject: compiling and linking 16-bit OS/2 API programs in 2.0
-
- I have a sample program which calls the AS/400 PC Support API's.
- This sample program was compiled using MS C 6.0 and OS/2 1.3 toolkit.
- Therefore these must be 16 bit API's.
-
- How do I call these API's in a 32 bit program developed using
- C Set/2, Toolkit 2.0? Unfortunaly the DLL that came with this
- API must be a 16 bit DLL. I seem to recall that I can call a 16 bit DLL
- from a 32 bit program. Do I have to do some thunking or what?
-
- What changes must I make to the header file? Right now the
- header contains statements such as :
-
- extern int extentry QSNDDTAQ(...........
-
- but my compiler doesn't like it.
-
- How about any special options I must set to compile and link this?
- If someone has a short sample to do this, please send it to me. Thanks.
-
- - Susan Lin (IBM China/Hong Kong)
-
- ----- OS2PRG CFORUM appended at 14:11:54 on 92/06/25 GMT (by OCANUC at BETASVM2)
- Subject: compiling and linking 16-bit OS/2 API programs in 2.0
- Ref: Append at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
-
- The C-Set/2 Users Guide has a chapter on calling 16-bit functions
- from 32-bit code. The bit of information that helped me the most
- was changing the function prototype of the 16-bit call from APIENTRY
- (which equates to _System) to APIENTRY16 (which equates to _Far16
- _Pascal). The linker seemed to figure everything else out. You
- do have to think about the 16-bit stack. This is a pragma in C_SET/2
- (pragma stack16).
-
- Brandon Booth Advanced Programming - ICSRS
-
- ----- OS2PRG CFORUM appended at 16:13:56 on 92/06/25 GMT (by LNK1SM3 at MARTLINK)
- Subject: compiling and linking 16-bit OS/2 API programs in 2.0
- Ref: Append at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
-
- For a 32 bit program to call a 16 bit API in a DLL you must put:
-
- APIRET16 APIENTRY16 16BITAPI(
-
- This will tell the compiler to put thunking in for you. If this does
- not work give me some code and I will look at it. You should not
- to have to change your header at all unless you have you prototype
- there.
-
- By the does any know if 'thunking' means my program is not 'thinking'!
-
- Joseph A. Mogavero
-
- ----- OS2PRG CFORUM appended at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
- Subject: Named Pipe Local Host Name?
-
- When using named pipes across a network, it would seem fairly
- important to be able to determine the local host name -- the
- name that some other machine would put into \\NAME\pathname.
- Where can I get it?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 15:40:37 on 92/06/30 GMT (by XXTCAN06 at TORVMCOP)
- Subject: OS/2 command from Smalltalk/V PM 1.4.
-
- Hi!
- Does anybody know how to issue OS/2 commands from a Smalltalk/V PM 1.4
- program? I'm specifically looking to run 'NET VIEW' commands. Actually,
- the next step after that will be to refine the methods to use the NET API
- (which I'm not familiar with at all!). So, as a 2nd question: Does
- anybody have any experience in making calls to DLLs from Smalltalk? And
- were can I find the NET API DLL(s) and documentation?
-
- Thanks.
- Pierre Legault
- Transport Canada
- 1-613-993-7149
-
- ----- OS2PRG CFORUM appended at 11:47:47 on 92/07/02 GMT (by WZ00576 at OS2CUST)
- Subject: DosRead of 0, waits?
-
- I need to do a read-with-timeout from a perhaps local or perhaps
- remote named pipe. I don't see a way given the restriction of
- semaphore binding to local pipes.
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 03:22:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
- Subject: Named Pipe Local Host Name?
- Ref: Append at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
-
- See the NetWkStaGetInfo api in the Lan Server manual...
-
- It will return the Workstation name, Domain name and
- User name (if any)..this can't tell you the SERVER
- name of the pipe tho, as you CAN talk CROSS DOMAIN
- with Named Pipes PROVIDED you have access rights
- to the pipe AND are logged on..
-
- Sam
-
- ----- OS2PRG CFORUM appended at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
- Subject: DosRead of 0, waits?
- Ref: Append at 11:47:47 on 92/07/02 GMT (by WZ00576 at OS2CUST)
-
- DosPeekNmPipe will tell you any data Exists..
-
- Sam
-
- ----- OS2PRG CFORUM appended at 11:39:24 on 92/07/03 GMT (by WZ00576 at OS2CUST)
- Subject: DosRead of 0, waits?
- Ref: Append at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
-
- I need to make a tnread wait for input but not read any imput.
- The routine you reference won't do that, will it?
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 11:42:26 on 92/07/03 GMT (by WZ00576 at OS2CUST)
- Subject: DosRead of 0, waits?
- Ref: Append at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
-
- I don't have the lan server API. What I have is the Novell
- netware requester, which supports Named Pipes, so I'm trying
- to just use them with the Control Program API. Is this as stupid
- an idea as I'm beginning to suspect? Does the Lan Server API work with plain
- Novell Named Pipes?
-
- Somewhat on the subject, is there any chance of making semaphores
- work with remote named pipes. Its mighty inconvienient not to be
- able to do any sort of wait on them except DosRead.
-
- Benson Margulies
-
- ----- OS2PRG CFORUM appended at 18:01:59 on 92/07/06 GMT (by A157623 at OS2CUST)
- Subject: OS/2 and Smalltalk
-
- I have interfaced Smalltalk with DLLs and can share that info with you. The
- NET APIs calls are documented in the SDK for Lan Manager. I have such a book
- and can give the details on the calls you will be needing.
-
- Larry Mason
- Texas Instruments
-
- ----- OS2PRG CFORUM appended at 18:13:08 on 92/07/07 GMT (by IL12431 at OS2CUST)
- Subject: Changing Keyboard States
-
- Is there example code available showing how to change the keyboard (numlock,
- caps lock, and scroll lock) states? I recall an older IBM IUO utility that
- changed startup states but I need example code for per session management.
-
- Thanks in advance.
-
- Dave Scheffer, ARGO Data Resource Corp.
-
- ----- OS2PRG CFORUM appended at 21:26:05 on 92/07/07 GMT (by IL12431 at OS2CUST)
- Subject: Changing VIO font mode
-
- Is there example code available showing how to change the operative video mode
- of an OS/2 VIO window to 132 character mode? Am I able to do so internally or
- must I externally define the object/window?
-
- Thanks in advance.
-
- Dave Scheffer, ARGO Data Resource Corp.
-
- ----- OS2PRG CFORUM appended at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
- Subject: Changing Keyboard States
- Ref: Append at 18:13:08 on 92/07/07 GMT (by IL12431 at OS2CUST)
-
- Here's a fragment of code which turns on the NumLock key when the program
- is activated, and turns it off when the program is deactivated. Hope it
- helps:
-
- MRESULT EXPENTRY WindowProc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
- {
- static BOOL Toggled;
- static BYTE KeyStateTableì256┘;
-
- switch (msg)
- {
- case WM_ACTIVATE:
- case WM_SETFOCUS:
- {
- SHORT NumLockState;
-
- if (SHORT1FROMMP(mp1))
- {
- NumLockState = WinGetKeyState (HWND_DESKTOP, VK_NUMLOCK);
- Toggled = NumLockState & 0x0001;
-
- if (!Toggled)
- {
- WinSetKeyboardStateTable(HWND_DESKTOP,
- (PBYTE) KeyStateTable,
- FALSE);
-
- KeyStateTableìVK_NUMLOCK┘ |= 0x01;
-
- WinSetKeyboardStateTable(HWND_DESKTOP,
- (PBYTE) KeyStateTable,
- TRUE);
- }
- }
- else
- if (!Toggled)
- {
- KeyStateTableìVK_NUMLOCK┘ &= 0xFE;
- KeyStateTableìVK_CTRL┘ = 0;
- KeyStateTableìVK_ALT┘ = 0;
-
- WinSetKeyboardStateTable(HWND_DESKTOP,
- (PBYTE) KeyStateTable,
- TRUE);
- }
-
- return (WinDefDlgProc(hwnd, msg, mp1, mp2));
- }
- }
- }
-
- Patrick Malneritch, Delta Air Lines
-
- ----- OS2PRG CFORUM appended at 13:16:42 on 92/07/10 GMT (by KWINZ at RALVM5) -
- ..... OS2PRG CFORUM modified at 13:50:39 on 92/07/10 GMT (by KWINZ at RALVM5) .
- Subject: Drive letter -> drive number
- Ref: None
-
- | Urk. Never mind. Looks like DosOpen is happy with opening
- | "a:panda.ndf" anyway, so I don't need to mess with the path.
- | There was an unrelated bug that was causing the DosOpen to
- | fail. Shows what I get for jumping to conclusions....
-
- Given a drive letter, is there any way for me to find out the drive
- number that's required for DosQCurDir?
-
- What I need to do is to take an input of the form x:filename.ext,
- and insert the fully qualified path for the current directory
- on that drive, to come up with x:\panda\filename.ext. That should
- give me a valid pathname that I can pass to DosOpen.
-
- The problem is that I have a drive letter passed in, but DosQCurDir
- wants a drive number. Is the drive number an absolute or a
- relative thing? For example, if I get a drive letter "F:", will that
- always be drive number 6, or does it depend on how many logical
- drives are defined with lower letters on the system?
-
- Kim Winz
-
- ----- OS2PRG CFORUM appended at 13:33:18 on 92/07/10 GMT (by LECTION at BETASVM2)
- Subject: Drive letter -> drive number
- Ref: Append at 13:16:42 on 92/07/10 GMT (by KWINZ at RALVM5)
-
- Kim,
-
- It is my impression that the drive number is an absolute number, with
- drive A: starting at zero. So if you have a letter you could use the
- following c code to get the number:
-
- int iDriveNumber = (int) ( toupper('x') - 'A' );
-
- Where "x" is the drive letter.
-
- David B. Lection
-
- ----- OS2PRG CFORUM appended at 13:51:54 on 92/07/10 GMT (by KWINZ at RALVM5) -
- Subject: Drive letter -> drive number
- Ref: Append at 13:33:18 on 92/07/10 GMT (by LECTION at BETASVM2)
-
- I just found out that I was jumping to conclusions and I don't need
- to do this after all, but thanks for the info anyway. Its good to
- know that; I'll file it away.
-
- Thanks,
-
- Kim Winz
-
- ----- OS2PRG CFORUM appended at 13:55:17 on 92/07/10 GMT (by 64924111 at TOROHON1)
- Subject: Drive letter -> drive number
- Ref: Append at 13:51:54 on 92/07/10 GMT (by KWINZ at RALVM5)
-
- I believe that you only need the drive number to change drives from
- inside a program.
-
- Regards.....Pete Liukaitis
-
- ----- OS2PRG CFORUM appended at 16:53:07 on 92/07/10 GMT (by IL12431 at OS2CUST)
- Subject: Changing Keyboard States
- Ref: Append at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
-
- Thanks very much for the fragment, Patrick.
-
- Dave Scheffer, ARGO Data Resource Corp.
-
- ----- OS2PRG CFORUM appended at 18:23:03 on 92/07/10 GMT (by IL22868 at OS2CUST)
- Subject: Named Pipe Local Host Name?
- Ref: Append at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
-
- I believe the WHOAMI program in the Software Library section of this
- BBS has what you need (it contains both C source and EXE).
-
- Ken Singer, Shell Oil, Houston
-
- ----- OS2PRG CFORUM appended at 18:48:25 on 92/07/10 GMT (by IL22868 at OS2CUST)
- Subject: API For PSTAT.EXE Information
- Ref: Append at 18:03:29 on 92/06/25 GMT (by AT at VIA) -----
-
- I have info on DosQProcStatus for 2.0 -- got it from KILLM2 on
- Gilmore's Magnum BBS (it may also be on other OS/2 BBSs). If you
- can't find it, I may be able to FAX you the source. Also on
- Gilmore's BBS, but in a more restrictive area, is PROCTST. KILLM2
- includes source and an include file for the structure of the buffer
- returned from the OS/2 2.0 version of DosQProcStatus. Following is
- the README.DOC file for KILLM2:
-
- ===============================================================================
- KILLEM.EXE kills running processes by name. It works with version 6.177h or
- OS/2 2.0. Haven't tried any version before or after. It uses the undocumented
- API DosQProcStatus to get a list of running processes - therefore its stability
- is in question because IBM could change or remove this API without telling
- anyone.
-
- Usage: KillEm process-name process-name ...
-
- If no extension is given for process-name, .EXE is appended. process-name is
- the name that the program was started with.
-
- All instances of all process-names will be killed unless those processes
- ignore KillProcess signals.
-
- Any comments, suggestions, bug reports can be sent to my CIS id 72251,750.
-
- Hope this utility proves useful.
-
- Rick Fishman
- Code Blazers, Inc.
- 4113 Apricot
- Irvine, CA 92720
- ===============================================================================
-
- Ken Singer, Shell Oil, Houston
-
- ----- OS2PRG CFORUM appended at 12:09:13 on 92/07/13 GMT (by IL62623 at OS2CUST)
- Subject: Named Pipe Local Host Name?
- Ref: Append at 18:23:03 on 92/07/10 GMT (by IL22868 at OS2CUST)
-
- Too bad IBM still hasn't supplied me with a version of PMHPO that
- can download. I'll ask my SE to fetch it. Thanks.
-
- ----- OS2PRG CFORUM appended at 18:50:08 on 92/07/14 GMT (by KURODA at RALVM5)
- Subject : DosReallocSeg return code
-
- I get return codes ERROR_ACCESS_DENIED (5) and ERROR_LOCKED (212)
- from DosReallocSeg. I want to know what the return codes means.
-
- Does anyone help me ?
-
- Thanks in advance,
- Aki Kuroda ----- Yamato, Japan
-
- ----- OS2PRG CFORUM appended at 00:41:32 on 92/07/15 GMT (by PSC31 at OS2CUST)
- Subject: 32-bit executable file format
-
- Is the 32-bit executable file format documented. If so, where?
-
- Bob Dedrick, Prodigy Services Company (P*HFDD60A)
-
- ----- OS2PRG CFORUM appended at 00:52:53 on 92/07/15 GMT (by KENKAHN at PKSMRVM)
- Subject: DosReallocSeg return code
- Ref: Append at 18:50:08 on 92/07/14 GMT (by KURODA at RALVM5)
-
- There was a lot of discussion on this RC=5 problem with DosReallocSeg (I was
- getting it myself). I'll see if I can dig up the exact discussion but I do
- remember that the *fix* was to simply reissue the DosReallocSeg call if you
- got a RC=5 on the first try. The second try usually works.
-
- Kenneth Kahn Staff of IBM Fellow/NetWork Computing Poughkeepsie, NY
- Internet: KENKAHN@PKSMRVM.VNET.IBM.COM IBMMAIL: USIB25P9 at IBMMAIL
-
- ----- OS2PRG CFORUM appended at 01:36:03 on 92/07/15 GMT (by V$IPAULD at BCRVMPC1)
- Subject: 32-bit executable file format
- Ref: Append at 00:41:32 on 92/07/15 GMT (by PSC31 at OS2CUST)
-
- The header files are available as part of the toolkit, along with
- a program EXEHDR that dumps info from an executable. Documentation
- on the format has been made available external to IBM. I can print
- and mail you a copy, or mail you a diskette, or transfer with a
- modem. Get me a mailing address or a phone number ...
-
- Paul Devriendt, OS/2 Development.
-
- ----- OS2PRG CFORUM appended at 12:37:04 on 92/07/15 GMT (by KURODA at RALVM5)
- Subject : DosReallocSeg return code
- Ref: Append at 00:52:53 on 92/07/15 GMT (by KENKAHN at PKSMRVM)
-
- Kenneth, thanks for your response,
-
- I call DosReallocSeg in my own memory management component. This
- component calls RodSubSet, DosSubAlloc, and DosSubFree to manage
- the memory. This component is a set of functions like library
- and the other components(thread) share this component to manage
- the memory pool.
-
- I'm worried that I made some bug in my code. Please let me know if
- you find some more information.
-
- Thanks again,
- Aki Kuroda ----- Yamato, Japan
-
- ----- OS2PRG CFORUM appended at 23:20:39 on 92/07/15 GMT (by PSC31 at OS2CUST)
- Subject: 32-bit executable file format
- Ref: Append at 01:36:03 on 92/07/15 GMT (by V$IPAULD at BCRVMPC1)
-
- Paul,
-
- Probably U.S. mail is easiest. My address is
-
- Bob Dedrick
- Systems Development Manager
- Prodigy Services Company
- 445 Hamilton Avenue, Mail Stop B12D
- White Plains, NY 10601
-
- We wrote a 16-bit post-mortem debugger for 1.3 which we're porting to 2.0.
-
- Thanks.
-
- Bob Dedrick, Prodigy Services Company (P*HFDD60A)
-
- ----- OS2PRG CFORUM appended at 14:42:49 on 92/07/16 GMT (by IL61500 at OS2CUST)
- Subject: SYTOS PLUS FOR OS/2
-
- HELLO EVERYONE!!!
-
- DOES ANYONE KNOW OF A WAY THIS SCENARIO CAN BE ACCOMPLISHED:::
-
- USING SYTOS PLUS FOR OS/2 1.3 ON AN OS/2 LANSERVER 1.3 TO B/U TO A SCSI ATTACHE
- D TECMAR B/U UNIT. UNIT IS ATTACHED TO SERVER; SW IS INSTALLED AT SERVER.
- WOULD LIKE TO WRITE A PROGRAM THAT WOULD ACCESS SYTOS PLUS, CHECK THE HEADER ON
- THE CURRENT INSERTED TAPE AND RETURN A CONDITION TO ADVISE A USER TO CHANGE TH
- E TAPE IF IT MATCHES THE ONE OBSERVED PREVIOUSLY. SYTRON HAS BEEN OF NO ASSISTA
- NCE.
-
- I KNOW THIS IS A TOUGH ONE.
-
- ANY IDEAS?
-
- THANKS!!
- LOU
-
- LOU BREIT, DEAN WITTER REYNOLDS
-
- ----- OS2PRG CFORUM appended at 16:05:54 on 92/07/16 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
-
- I just took a program that was working when entirely linked
- as a single module and broke it into a small executable and two
- dlls.
-
- Now, when I run it (it is a pmtype:vio) from command line, it exits
- immediately. From ipmd, I learn that it terminates someplace in the
- startup code. I don't know where to look next. Can someone
- give me a hint?
-
- ----- OS2PRG CFORUM appended at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 16:05:54 on 92/07/16 GMT (by IL62623 at OS2CUST)
-
- Hello,
-
- Did you write your own DLL initialisation routine or are you letting
- C Set/2 handle it for you?
-
- Cheers, Karri.
-
- ----- OS2PRG CFORUM appended at 17:07:05 on 92/07/16 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
-
- I have no custom init routines. My .def file looks like:
-
- LIBRARY libos
- PROTMODE
- DATA MULTIPLE NONSHARED READWRITE LOADONCALL
- CODE LOADONCALL
- EXPORTS
-
- and then the exports list.
-
- I'm using tcpip 1.2.1, which is 16 bit. Is it possible
- that PROTMODE is a bad idea if my dll calls into the TCP dll
- which is 16 bit?
-
- ----- OS2PRG CFORUM appended at 17:07:36 on 92/07/16 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
-
- (no text entered)
-
- ----- OS2PRG CFORUM appended at 08:27:04 on 92/07/17 GMT (by KARRI at WINVMK) -
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 17:07:05 on 92/07/16 GMT (by IL62623 at OS2CUST)
-
- I suppose the 1st ? I have to ask you is that: is your DLL 32-bit?
- i.e. for OS/2 2.00? Would help a lot if you could either append a
- code snippet or even send it over so that I could have a look and a
- play around with it.
-
- All the Best, Karri.
-
- ----- OS2PRG CFORUM appended at 11:17:19 on 92/07/17 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 08:27:04 on 92/07/17 GMT (by KARRI at WINVMK) -
-
- It is a brand new 32 bit dll, built with icc and link386. I don't
- have any way to upload it at this time, except perhaps with help from
- my SE. It would be moderately large. Can I fedex you a disk?
-
- ----- OS2PRG CFORUM appended at 11:33:43 on 92/07/17 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 11:17:19 on 92/07/17 GMT (by IL62623 at OS2CUST)
-
- Some more experiments show that the dll's are themselves fine -- I can
- create a trivial executable that calls them, link it with them, and
- it works. So there is something wrong with the executable I'm actually
- trying to run.
-
- Is there any way to really verify that I haven't accidently compiled
- a .obj file with the /Ge- flag and then tried to link it into an
- executable?
-
- The failing program is pretty large and complex, and worked when the
- whole mess was compiled /Ge+ and linked all into one .exe. Surely
- there are a limited number of conditions that would provoke this sort
- of behavior?
-
- ----- OS2PRG CFORUM appended at 11:47:55 on 92/07/17 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 11:33:43 on 92/07/17 GMT (by IL62623 at OS2CUST)
-
- Well, indeed, one module linked to my base executable had been
- mistakenly compiled /Ge-. Couldn't link386 somehow detect and complain
- about this?
-
- ----- OS2PRG CFORUM appended at 13:12:34 on 92/07/17 GMT (by KARRI at WINVMK) -
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 11:47:55 on 92/07/17 GMT (by IL62623 at OS2CUST)
-
- Did it fix the problem though?
-
- Cheers, Karri.
-
- ----- OS2PRG CFORUM appended at 19:02:07 on 92/07/17 GMT (by IL62623 at OS2CUST)
- Subject: Exit from executable entry, what do I do?
- Ref: Append at 13:12:34 on 92/07/17 GMT (by KARRI at WINVMK) -
-
- Oh yes. Once I compiled all the executable pieces /Ge+ the thing worked
- fine.
-
- ----- OS2PRG CFORUM appended at 19:08:13 on 92/07/17 GMT (by IL62623 at OS2CUST)
- Subject: longjmp versus exception handling
-
- Ive an exception handler.
-
- The exception handler calls a routine that calls longjmp,
- which of course call Unwind.
-
- The unwind target is scoped within the exception handler,
- so the unwind operation should not disturb the exception handler.
-
- However, it appears that once the unwind happens, the exception handler
- is somehow disabled, even though it still is listed in the chain
- rooted in the TIB. That is, a general protection fault happening after
- the longjmp is not reported to the exception handler.
-
- help?
-
- ----- OS2PRG CFORUM appended at 21:02:48 on 92/07/29 GMT (by IL71794 at OS2CUST)
- Subject: TRAP screen information?
-
- Can anyone direct me to or give me information on interpreting TRAP screens?
-
- Chris Eytalis
-
- ----- OS2PRG CFORUM appended at 15:56:40 on 92/07/30 GMT (by DALNK03 at OS2CUST)
- Subject: TRAP screen information?
- Ref: Append at 21:02:48 on 92/07/29 GMT (by IL71794 at OS2CUST)
-
- I put together this info from what I've been able to figure out. Hope it
- helps:
-
- To make use of the Trap Screen Information:
-
- 1 Add /Fc to C compiler options
- 2 Add /MAP to Link options
-
- 3 Look at the IP number from the Trap Screen
-
- 4 Search the map file for the routine that the number falls into.
- (the bottom information in the map file is sorted by
- address order)
-
- Example: IP=4194 from trap screen.
-
- Map file listings:
-
- .
- .
- .
-
- 0001:33B6 _print_ifdef_script
- 0001:3840 _find_and_hash_each_line
- 0001:443E _read_files
- 0001:462A _print_normal_script
-
- .
- .
- .
-
- The trap happened in routine _find_and_hash_each_line
-
- (IP > 3840 and IP < 443E
-
- 5 Subtract the offending functions address from the IP
-
- 4194 - 3840 = 960 hex.
-
- 6 Now search the .COD file which was generated (/Fc option) for the
- function (_find_and_hash_each_line)
-
- example:
-
- _find_and_hash_each_line PROC FAR
- *** 000278 c8 1a 00 00 enter 26,0
-
- 7 Take the hex number (000278) and add it to the calculated number
- from step 5.
-
- (278+960 = BD8 hex)
-
- 8 Now search down the .COD file for the number calculated in step 7.
- The trap happened at that instruction.
-
- example:
-
- ;|*** if (c != *--p1)
- ; Line 442
- *** 000bd2 8e 46 e2 mov es,WORD PTR ìbp-30┘
- *** 000bd5 49 dec cx
- *** 000bd6 8b d9 mov bx,cx
- trapped here -> *** 000bd8 26 38 07 cmp BYTE PTR es:ìbx┘,al
- *** 000bdb 75 12 jne $L20084
-
- The bug is on line 442 of the source code.
-
- The CS value seems to be translatable to the .EXE's .MAP file via
- the following assignments: 0047=1:, 0067=2:, 0087=3:, 00a7=4:, ...
-
- Patrick Malneritch, Delta Air Lines
-
- ----- OS2PRG CFORUM appended at 18:23:47 on 92/07/30 GMT (by WEEKS at AUSVM2) -
- Subject: TRAP screen information?
- Ref: Append at 15:56:40 on 92/07/30 GMT (by DALNK03 at OS2CUST)
-
- This is a good technique for OS/2 1.x. But it is not applicable
- to 2.0 where IP is really EIP and is 32-bits long. I haven't
- figured out how to map the EIP value back to the .EXE or .DLL, much
- less the actual routine that was running. I'm sure our customers
- (and even we internal types) would love to see some guidance on
- how to do this in the 2.0 environment. Post it here if you have
- any.
-
- Craig Weeks
- LAN Systems Performance (DCE)
- Austin, Texas
-
- ----- OS2PRG CFORUM appended at 14:14:22 on 92/07/31 GMT (by KEENLEY at TOROLAB6)
- Subject: TRAP screen information?
- Ref: Append at 18:23:47 on 92/07/30 GMT (by WEEKS at AUSVM2)
-
- EXEs are always loaded at address 0x10000 (64K). DLLs are always loaded
- in high memory ie. somewhere below 512M. If you get a trap at a
- relatively low address then the trap is probably occurring inside the
- EXE. Subtract 0x10000 from the EIP value and look up this offset in
- the MAP file. This will give you the function where the trap occurred.
- Finding TRAPs in DLLs is harder because you have to figure out where
- they are loaded.
-
- John Keenleyside OS/2 Compiler Dev.
-
- ----- OS2PRG CFORUM appended at 17:41:53 on 92/08/01 GMT (by XXPRMN01 at TORVMCOP)
- Subject: Trap information
- One way of interpreting the trap info is to take the address of your
- first function within one of your DLL's. Usually, you will be able
- to then compute the address similar to the method used to find the
- modules within the .EXE by subtracting 0x10000.
-
- Matt Smith, Prominare Inc.
-
- ----- OS2PRG CFORUM appended at 14:14:30 on 92/08/04 GMT (by IL12431 at OS2CUST)
- Subject: Changing Keyboard States
- Ref: Append at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
-
- I note that this fragment is a WindowProc - will it work for a VIO/Full-screen
- session as well? If not, does someone have a fragment for non-window sessions?
-
- Dave Scheffer, ARGO Data Resource Corp.
-
- ----- OS2PRG CFORUM appended at 15:41:05 on 92/08/04 GMT (by DALNK03 at OS2CUST)
- Subject: Changing Keyboard States
- Ref: Append at 14:14:30 on 92/08/04 GMT (by IL12431 at OS2CUST)
-
- I think the code should work for a VIO program. The WinGetKeyState function
- requires a message queue, so you'll need to have the following:
-
- hab = WinInitialize (0);
- hmq = WinCreateMsgQueue (hab, 0);
-
- I don't know how a VIO program can determine if it is gaining or losing
- focus, maybe somebody else can help out there.
-
- Pat Malneritch, Delta Air Lines
-
- ----- OS2PRG CFORUM appended at 18:46:34 on 92/08/05 GMT (by AMRT071 at OS2CUST)
- Subject: DosQueue and memory problem
-
- Are there any known problems using Dos queues ??
-
- I have had a random problem of memory being freed during
- DosReadQueue and DosWriteQueue function calls.
-
- My app is multi-threaded and reads/writes to several
- queues. One thread creates the queues and seperate threads
- read from them. The problem is as follows :
- 1. A sperate process running on the workstation will allocate
- a block of memory and send it back to my app via DDE.
-
- 2. One thread will allocate a small block of memory that
- contains the data I wish to pass to the other thread
- and writes that pointer addess to a queue.
-
- 3. A seperate thread will read the pointer address from that queue
- and the block memory that was allocated by the seperate
- process is freed in error by the Que function and the value
- at the pointer address will be put in its place. The memory
- coming from the seperate process IS IN NO WAY used
- during or at anytime near the time the queue functions are
- being processed.
-
- I really need help with this one.
-
- Thanks
-
- W. David Ashley American Airlines
-
- ----- OS2PRG CFORUM appended at 23:48:00 on 92/08/05 GMT (by SDETWEIL at DETVMIC4)
- Subject: DosQueue and memory problem
- Ref: Append at 18:46:34 on 92/08/05 GMT (by AMRT071 at OS2CUST)
-
- Queues AND DDE do NOT copy data. They pass only POINTERS to data.
-
- If on the DDE send from app2 to app1, the PM WinProc should malloc()
- and COPY the data sent from app2, OR DosWriteQueue with the
- address, or it will be lost after the Winproc ends.
-
- DosReadQueue does NOT copy data. It returns the POINTER VALUE
- written at the time of DosWriteQueue.
-
- I've used Queues extensively and have never encountered this
- problem.
-
- Is is possible that the shared memeory allocated in app2
- (it MUST BE SHARED for DDE between processes) is not
- DosGiveSeg'd to app1?
-
- Sam
-
- ----- OS2PRG CFORUM appended at 17:58:29 on 92/08/06 GMT (by IL57044 at OS2CUST)
- Subject: Trap D in DosSubAlloc
-
- I Have an app that uses DosAllocSeg and DosSubAlloc to obtain memory. After
- many iterations of DosSubAlloc/DosSubFree I am getting a trap D. Message SYS31
- 75 indicates DOSCALL1.DLL 0005 as the routine getting the access violation.
- Also, when I request 64K of memory on DosAllocSeg, OS/2 intermittantly gets a
- system trap D. This is an OS/2 16 bit app developed on OS/2 1.3. Is there
- something I should be aware of when useing this type of memory management on
- OS/2 2.0?
-
- Thanks! Larry Snyders
-
- ----- OS2PRG CFORUM appended at 19:34:42 on 92/08/11 GMT (by JAMILLE1 at CHGVMIC1)
- Subject: WinQuerySwitchList
- A novice C and OS/2 API programmer needs some help, please!
- I have written a program that looks at the task list entries and
- selects one to become the active program. Excerpts of the code
- follows:
-
- typedef struct _SWB {
- ULONG cswentry;
- SWENTRY aswentry<48>; /* square brackets for an array */
- } SWB; /* I am establishing a max of 48 entries */
-
- HAB hab = 0;
- SWB SwitchBlock;
- void main ()
- { ULONG NumberOfTasks,i;
- NumberOfTasks = WinQuerySwitchList(hab,NULL,0);
- NumberOfTasks = WinquerySwitchList( (HAB) hab,
- (PSWBLOCK) &SwitchBlock,
- (ULONG) sizeof(SwitchBlock) );
- etc.
- My problem is that it keeps blowing up on the last statement with
- a "General Protection Fault Exception". (I step it through debug and
- the 1st WinQuerySwitchList runs fine and returns a valid number in
- NumberOfTasks.)
- I'm doing this with OS/2 2.0 and C-SET/2.
- Any help would be appreciated. Thanks.
-
- ----- OS2PRG CFORUM appended at 11:22:01 on 92/08/13 GMT (by DALNK03 at OS2CUST)
- ..... OS2PRG CFORUM modified at 11:32:07 on 92/08/13 GMT (by DALNK03 at OS2CUST)
- Subject: WinQuerySwitchList
- This APPEND was deleted at 07:32:07 on 08/13/92 EST.
-
- ----- OS2PRG CFORUM appended at 19:31:02 on 92/08/17 GMT (by OCANUC at BETASVM2)
- Subject: Trap D in DosSubAlloc
- Ref: Append at 17:58:29 on 92/08/06 GMT (by IL57044 at OS2CUST)
-
- DosAllocSeg no longer exists in OS/2 2.0 due to the flat memory
- model. As for memory sub-allocation the internal discussion within
- IBM seems to indicate that the malloc and free support in the C-Set/2
- product are just fine for most applications (we use this in particular).
-
- Brandon Booth Spoken Language Systems
-
- ----- OS2PRG CFORUM appended at 19:50:39 on 92/08/17 GMT (by FIECHTNE at BCRVMPC1)
- Subject: Trap D in DosSubAlloc
- Ref: Append at 19:31:02 on 92/08/17 GMT (by OCANUC at BETASVM2)
-
- DosAllocSeg certainly DOES exist in 2.0 but not in the 32-bit API set.
- Please re-read the append which you referenced, this is a compatability
- point which we MUST maintain.
-
- As for solving the original problem, I've not seen this type of problem
- and I have a home grown 16-bit Async Terminal which uses these calls
- all over the place. I know of no restrictions that are imposed by
- OS/2 2.0 for these services. I suggest a service call to log a
- problem report against our 1.X compatability.
-
- Mark Fiechtner (OS/2 Development)
-
- ----- OS2PRG CFORUM appended at 23:05:17 on 92/08/17 GMT (by IL72906 at OS2CUST)
- Subject: Writing a IFS?
-
- Where is there information on writing an Installable File System?
-
- David Alcock - Central and South West Services - Dallas, Tx
-
- ----- OS2PRG CFORUM appended at 12:47:50 on 92/08/18 GMT (by 72468326 at EHONE)
- Subject: OS/2 V2 and Fortran/2 Malfuntions with READ from a file
-
- My customer uses large programs compiled with Fortran/2. If he runs
- such programs under OS/2 V2 he gets errors when reading real variables
- from a file. For example:
- READ (5,'(F10.3)'),A ( A = 1.000)
- WRITE (7,'(F10,3)'),A ( A = +++++++++++)
-
- Who has any ideas, suggestion? Please respond offline to
-
- Wilfried Mensching, System Engineer ACIS Hannover, Germany
- HAMENSC at HAMBVM2
-
- ----- OS2PRG CFORUM appended at 19:49:19 on 92/08/20 GMT (by IL12431 at OS2CUST)
- Subject: OS2 v1.3 VIO 132 column mode
-
- What VIO function mode is used to get 132 column display? The DOS mode 20
-
- was mode 20, and it is not clear to me in the documentation how to toggle
- 132 column VIO setmode.
-
- Dave Scheffer, ARGO Data Resource Corp.
-
- ----- OS2PRG CFORUM appended at 20:07:06 on 92/08/20 GMT (by KENKAHN at PKSMRVM)
- Subject: OS2 v1.3 VIO 132 column mode
- Ref: Append at 19:49:19 on 92/08/20 GMT (by IL12431 at OS2CUST)
-
- You use the VioSetMode command. To swtich to 132 columns you use:
-
- viomi_Col = 132;
- viomi_Row = 28;
- viomi_hres = 1056;
- VioSetMode(..);
-
- To switch back to 80 column mode
-
- viomi_Col = 80;
- viomi_Row = 25;
- viomi_hres = 720;
- VioSetMode(..)
-
- The important part here is setting the Horizontal resolution.
-
- Kenneth Kahn Staff of IBM Fellow/NetWork Computing Poughkeepsie, NY
- Internet: KENKAHN@PKSMRVM.VNET.IBM.COM IBMMAIL: USIB25P9 at IBMMAIL
-
- ----- OS2PRG CFORUM appended at 20:36:35 on 92/08/21 GMT (by IL12431 at OS2CUST)
- Subject: OS2 v1.3 VIO 132 column mode
- Ref: Append at 20:07:06 on 92/08/20 GMT (by KENKAHN at PKSMRVM)
-
- Ken, thanks for the info. However, when I run this code under OS/2 2.0
- the result is a shaking, banded display and appears to be scrolling very
- rapidly from top to bottom. Following are the parameters on the call.
-
- Length = 34
- Type = 1
- Color = 4
- Col = 132
- Row = 28
- hres = 1056
- vres = 400
- Format ID = 0
- Attrib = 1
-
- Interestingly enough, I get similar results on the MODE 132,28 command.
- I do get a zero return code from the system when I pipe my test code
- through CVP, though.
-
- Could the problem be hardware? I'm testing on a beta model 57 w/8515
- monitor. The BIOS is dated 8/28/91, submodel 38, revision 6.
-
- ----- OS2PRG CFORUM appended at 00:07:53 on 92/08/22 GMT (by KENKAHN at PKSMRVM)
- Subject: OS2 v1.3 VIO 132 column mode
- Ref: Append at 20:36:35 on 92/08/21 GMT (by IL12431 at OS2CUST)
-
- I'm fairly certain it's not an OS/2 V2 problem per say. I got this code from
- an application I have (a 3270 Terminal Emulator) that runs on both 1.x and 2.0
- systems. I'm afraid I'm not that savy on this so hopefully someone else can
- comment on your problem.
-
- Just to make sure I got the obvious out of the way, you are using an XGA type
- adapter, right? 132 columns are supported only on an XGA. Also this will
- olny work in a full screen mode, not in a VIO window.
-
- Kenneth Kahn Staff of IBM Fellow/NetWork Computing Poughkeepsie, NY
- Internet: KENKAHN@PKSMRVM.VNET.IBM.COM IBMMAIL: USIB25P9 at IBMMAIL
-
- ----- OS2PRG CFORUM appended at 20:05:40 on 92/08/24 GMT (by DJJQ1 at OS2CUST)
- Subject: Writing a IFS?
- Ref: Append at 23:05:17 on 92/08/17 GMT (by IL72906 at OS2CUST)
-
- I don't have a document ID, but we obtained from IBM a document titled
- "Installable File Systems For OS/2 Version 2.0" from the OS/2 File Systems
- Department, PSPC Boca Raton, Florida (dated Feb 17, 1992) It doesn't have
- "IBM Internal use only" on it so I assume that you should be able to get it
- without too much trouble. I'm not personally working with IFS, but I
- understand that it is not trivial.
-
- Hope this helps
-
- Kevin Phillips - DST Systems, Inc. Kansas City, MO
-
- ----- OS2PRG CFORUM appended at 18:01:38 on 92/08/25 GMT (by AMRT071 at OS2CUST)
- Subject: Pgms using IOPL
-
- I am currently writing a program which needs to play some music to the PC's
- speaker. All the examples I am using are 1.x programs which use segments
- which have been marked IOPL to the linker. I have tried using the same
- technique with 32-bit programs but when executed the segments which have been
- marked as IOPL all cause an access violation when the first code instruction (a
- PUSH EBP) is executed. Can someone give me a hint as to what I am doing wrong?
-
- Thanks in advance.
-
- W. David Ashley American Airlines
-
- ----- OS2PRG CFORUM appended at 23:52:48 on 92/08/26 GMT (by SDETWEIL at DETVMIC4)
- Subject: Writing a IFS?
- Ref: Append at 20:05:40 on 92/08/24 GMT (by DJJQ1 at OS2CUST)
-
- The hardest part is memory mgmt, as the IFS runs at ring 0 (kernel mode)..
-
- I have written a couple of IFSs supporting both 1.3 and 2.0, so
- ask away..
-
- Sam
-
- ----- OS2PRG CFORUM appended at 23:54:30 on 92/08/26 GMT (by SDETWEIL at DETVMIC4)
- Subject: Pgms using IOPL
- Ref: Append at 18:01:38 on 92/08/25 GMT (by AMRT071 at OS2CUST)
-
- You still have to do the same thing, 32 bit pgms do not yet support
- IOPL level segments.
-
- So, you must make a 16 bit segment, mark it IOPL as before
- and call it from the 32 bit code..
-
- 32 bit code CANNOT do IN/OUT instructions directly...
-
- Sam
-
- ----- OS2PRG CFORUM appended at 18:22:09 on 92/09/01 GMT (by PNWB016 at HONE81)
- Subject: Exception handler questions
-
- One of the developers I work with asked that I submit the
- following questions... thanks in advance for any light that may
- be shed on this.
-
- I need some help with an Exception Handler:
- I want to get the same information that is displayed when
- a trap screen appears.
-
- I have found where the EIP is kept
- (ExceptionAddress field of the EXCEPTIONREPORTRECORD)
- but...
- Where is the thread number kept?
-
- Where is the Register info. kept?
- It doesn't appear that it's in the CONTEXTRECORD field because all
- all values are zero in it when I get control.
-
- Thanks again!
-
- Wayne "Not responsible for the contents of this message" Holmes
- U S WEST Communications
-
- ----- OS2PRG CFORUM appended at 15:59:22 on 92/09/09 GMT (by STINCHI at ROMESC)
- Subject: DLL.
-
- We are working with OS/2 DLL. We need to export functions and variables
- from main program (staticly linked)
- to DLL (all the examples show how to
- export functions and variables from DLL to main).
- Is it possible ? Have someone source code
- or some form of documentation on this problem?
- Any help will be appreciated.
-
- Stefano Stinchi and Fabrizio Pacelli.
-
- ----- OS2PRG CFORUM appended at 16:48:52 on 92/09/09 GMT (by WEEKS at AUSVM2) -
- Subject: DLL.
- Ref: Append at 15:59:22 on 92/09/09 GMT (by STINCHI at ROMESC)
-
- You can't EXPORT from .EXE to .DLL the way you can from .DLL to
- .EXE (via .DEF file). If you want the .DLL to have access to the
- .EXE variables you can use shared memory, or pass a pointer to the
- .DLL function as a parameter, or any one of several other (probably)
- techniques.
-
- Craig Weeks
- LAN Systems Performance (DCE)
- Austin, Texas
-
- ----- OS2PRG CFORUM appended at 16:55:59 on 92/09/09 GMT (by VENRTC51 at DFWVM04)
- Subject: int 3 obj
-
- I need an object file that does an interrupt 3 which I can link
- with my C code. This is for 16 bit code, large model.
-
- Thanks,
- Kurt
- (VENRTC51 at DFWVM04)
-
- ----- OS2PRG CFORUM appended at 01:35:04 on 92/09/10 GMT (by SDETWEIL at DETVMIC4)
- Subject: int 3 obj
- Ref: Append at 16:55:59 on 92/09/09 GMT (by VENRTC51 at DFWVM04)
-
- If using MS C6, just make one
-
- trace()
- {
- _asm {
- int 3
- };
- }
-
- Then when you need to stop, just add
- trace(); to your code.
- I pass a parm, when I need to know WHICH trace entry caused the stop
- Sam
-
- ----- OS2PRG CFORUM appended at 20:28:46 on 92/09/14 GMT (by XXWESB07 at TORVMCOP)
- Subject: DosWriteQueue returns 334
-
- I am developing a 32-bit multithreaded PM application that is using
- queues (ie. DosCreateQueue, DosWriteQueue, DosReadQueue). My app
- successfully writes/reads from/to the queue a number of times. Then
- a DosWriteQueue() call fails with error 334. Looking this up it says
- "Inadequate queue memory". Doing a help 334 it goes on to say that you
- should contact the supplier of the program! Anyways, I am wondering if
- there is a system configuration parameter that affects the amount of
- memory available to the queues code in the system. I am unable to locate
- any additional information on this error code and how to resolve it.
- My swap file is about 10MB and there is about 35MB left on the swap
- device. I am running 2.0 GA on a P70 with 8MB of RAM using the
- Workset/2 (no CSDs) over a network.
-
- The code I am using was copied (almost a clone) from the 16-bit version
- of our application that was a background process under OS/2 1.3.
- We never encountered this error under OS/2 1.3.
-
- Also, if the DosWriteQueue() fails, the app sleeps for 5 seconds and
- then retries but is never able to successfully complete.
- Thanks...
-
- Craig Knelsen, ISM Corp.
- One Research Drive, Regina, SK S4S 7H1
- (306) 781-5191
-
- ----- OS2PRG CFORUM appended at 01:36:49 on 92/09/15 GMT (by SDETWEIL at DETVMIC4)
- Subject: DosWriteQueue returns 334
- Ref: Append at 20:28:46 on 92/09/14 GMT (by XXWESB07 at TORVMCOP)
-
- When writing between processes, one must give/get access to the
- shared memory somehow. Under 1.x you did a DosGive/GetSeg on the
- selector and then a DosFreeSeg when you were done. Both sides
- freed the selector eventually, and the use count dropped to 0,
- and the memory was freed...
-
- Now, under 2.0, the BASE address of the DosAllocMem object must
- be Given/Gotten AND FREED, else the memory does not get freed..
-
- 334 sounds like the elements were not pulled off the queue,
- but only PEEKed...
-
- Sam
-
- ----- OS2PRG CFORUM appended at 15:54:32 on 92/09/15 GMT (by XXWESB07 at TORVMCOP)
- Subject: DosWriteQueue returns 334
- Ref: Append at 01:36:49 on 92/09/15 GMT (by SDETWEIL at DETVMIC4)
-
- Thanks for the reply. Your reply tells me that I need to further
- clarify what my app is doing. The 16-bit version communicates with
- other processes (the one who started it and those it starts) using
- pipes (unnamed and named). In the 32-bit version, the process that
- used to start the 16-bit app is now combined into one program with
- multiple threads although it still communicates with 32-bit PM
- apps, that it starts, using named pipes. The queues are used internally
- within the app (either 16 or 32 bit versions) to send messages between
- the threads. We use malloc() to allocate space for the messages.
- However, since our message areas are of a fixed size, we optimize the
- allocation routine by saving the addresses of our processed messages
- in a free list. The allocation routine checks this free list and uses
- a previously allocated message area if there's one available. Otherwise,
- it calls malloc().
- I hope that the system queues code in 2.0 is not expecting the msgs that
- have been written to the queue and then retrieved by DosReadQueue() are
- free'd within a short space of time after that. I do not see why it
- would matter in the above scenario.
-
- Craig Knelsen, ISM Corp.
- One Research Drive, Regina, SK S4S 7H1
- (306) 781-5191
-
- ----- OS2PRG CFORUM appended at 16:26:26 on 92/09/15 GMT (by ALIU at BOSTON) --
- Subject: 'Dir' Command locks resources?
- Hi,
-
- I am wondering about what's going on with the simple old 'Dir' command.
- Basically, I'm writing a REXX program that is checking the last file
- write access timestamp of a given file. Everything seems OK
- with the REXX program itself. However, in another OS2 Window, I've
- got another program that will occasionally update the same file.
- When that happens, it appears that as I obtain the Directory information
- of that file via that Rexx program, if I happen to be updating that
- file, I get a Resource/Lock message with an RC = 32. I think I can
- get around this by trapping for RC = 32 in the other process basically
- by doing a retry of the write.
-
- However, I wonder what's going on with the 'Dir' statement. It seems
- to me that I'm only trying to read the Directory Information of the
- file. Why am I locking up the Resource? Is there some other way of
- getting the Directory Information without locking that resource up?
- Anybody else have another suggestion than checking for RC = 32?
-
- Regards,
- Art Liu (ALIU at BOSTON)
- IBM Services Company
- Client/Server Practice
-
- ----- OS2PRG CFORUM appended at 18:11:52 on 92/09/15 GMT (by RICHKULP at CARVM3)
- Subject: 'Dir' Command locks resources?
- Ref: Append at 16:26:26 on 92/09/15 GMT (by ALIU at BOSTON)
-
- In your REXX command try doing this command instead of 'Dir' It should
- be easier and faster and may fix your lock problem:
-
- filename = 'c:\whatever' /* Any file name is valid. */
- .
- .
- .
- datetime = stream(filename, 'c', 'query datetime')
-
- datetime will then contain the date and time in this format:
- mm-dd-yy hh:mm:ss
-
- Rich Kulp
-
- ----- OS2PRG CFORUM appended at 03:19:54 on 92/09/16 GMT (by SDETWEIL at DETVMIC4)
- Subject: DosWriteQueue returns 334
- Ref: Append at 15:54:32 on 92/09/15 GMT (by XXWESB07 at TORVMCOP)
-
- As the queue doesn't actually copy any data, there is no timing
- relationship involved. all the queue does is pass the pointer
- from one place to another..
-
- I'd say, if you can recreate this in a smaller testcase, then
- you have a legitimate bug..
-
- Just for grins, have you tried serializing around reading/writing
- from/to the queue from the multiple threads? It shouldn't be
- required, but then bugs are just that..
-
- Sam
-
- ----- OS2PRG CFORUM appended at 20:02:25 on 92/09/17 GMT (by XXTCAN06 at TORVMCOP)
- Subject: Interface Smalltalk/V PM 1.4 to NETAPI.DLL under OS/2 2.0.
- Hi!
- I'm trying to call my 1st API in NETAPI.DLL from Smalltalk/V PM 1.4
- but I'm obviously not doing it quite right yet 'cause I'm getting
- protection exceptions or infinite message loops et al.
- Firstly: I'm under OS/2 2.0 but I'm reading the usoft 'LAN Manager
- Programmer's Reference for version 2.0'. Is that reference book valid?
- If so, why would this wrapper method for NetUseEnum not work?:
-
- useEnum: pszServer level: sLevel buffer: pbBuffer bufferSize: cbBuffer
- entriesRead: pcEntriesRead totalAvail: pcTotalAvail
- <api: NETUSEENUM struct short struct ushort struct struct ushort >
- `self invalidArgument .
-
- The code to test this method is as follows:
-
- | answer buffer entriesRead totalAvail |
- buffer := String new: 64 .
- entriesRead := 0 .
- totalAvail := 0 .
- answer := NetAPIDLL open
- useEnum: '' asParameter
- level: 1
- buffer: buffer asParameter
- bufferSize: (buffer size)
- entriesRead: entriesRead
- totalAvail: totalAvail .
- self halt .
-
- The 'NetAPIDLL open' seems to be working 'cause it inspects as
- 'NetAPIDLL{61 3 }'.
-
- The prototype for NetUseEnum in the book is:
-
- #define INCL_NETUSE
- #define INCL_NETERRORS
- #include <lan.h>
-
- API_FUNCTION
- NetUseEnum (const char far * pszServer,
- short sLevel,
- char far * pbBuffer,
- unsigned short cbBuffer,
- unsigned short far * pcEntriesRead,
- unsigned short far * pcTotalAvail
- );
-
- Anyone with any ideas? Maybe especially Larry Mason of Texas Instruments
- who said, back in July, that he had some expertise in that field.
-
- Thanks.
-
- ----- OS2PRG CFORUM appended at 07:32:17 on 92/09/23 GMT (by DEV0144 at OS2CUST)
- Subject: ACCESSING PHYSICAL MEM VIA IOCtl Device Driver Function
-
- Howdy, I am writing a device driver, for a memory mapped i/o board. This memory
- mapped i/o board is an isa 8 bit isa class card that runs in an IBM pc 'crone'.
-
- I would appreciate a code sample that illustrates an application call via
- DosDevIOCtl to a device driver accessing a chunk of physical memory. Also the
- receiving device driver code chunk would be appreciated.
-
- I am thouroughly confused as to how to accomplish this seemingly simple task.
-
- Every time I access my device driver I get a 'GP' fault. I have ordered the
- Control Programming Reference manual, but have not received it as yet. I hope
- this will shed some further light on the subject.
-
- The Physical Device Driver Reference is not very clear on this subject.
-
- I appreciate IBM's decision to allow folks (such as I) access to this forum.
-
- Thankyou.
-
- Any help regarding this matter will be greatly appreciated.
-
- ----- OS2PRG CFORUM appended at 10:19:00 on 92/09/23 GMT (by KENKAHN at PKSMRVM)
- Subject: ACCESSING PHYSICAL MEM VIA IOCtl Device Driver Function
- Ref: Append at 07:32:17 on 92/09/23 GMT (by DEV0144 at OS2CUST)
-
- I thinkwhat you are asking is how an application can request access to the
- physical memory on an adapter card. If this is the case then the following
- applies (if not the following is useful anyway but you can ignore it).
-
- In the device driver, you use the PhysToUVirt DevHelp to translate the
- physical memory to a virtual storage address that is accessible via the
- calling process's LDT Table.
-
- DCA_Address DD 0CE000h ; Address of DCA Buffer on 3270 Adapter
- org
- DCAaddrHI DW 0000Ch
- DCAaddrLO DW 0E000h
-
- Mov AX,DCAaddrHI ; Get the High-order address
- Mov BX,DCAaddrLO ; Get the Low-order address
- Mov CX,8192 ; get the buffer size
- Mov DH,1 ; make segment R/W
- Mov DL,DevHlp_PhysToUVirt
- Call Device_Help
- Mov CX,ES ; Save Selector
- Mov DX,BX ; Save Offset
- LES BX,Request_Packet ; restore request packet address
- LES BX,ES:[BX+15] ; get a pointer to IOCtlParms
- Mov ES:[BX],DX ; save Offset into IOCtlParms
- Mov ES:[BX+2],CX ; Save Selector into IOCtlParms
-
- The allocated virtual address will be returned in IOCtlParms. An application
- would use DosDevIOCtl to call the DD and pass it a 32-bit pointer field.
- The DD would return the values ES:BX in this 32-bit field, which the
- application could then use directly as a pointer to the buffer.
-
- IOCtlData DB 50 DUP(?)
- IOCtlParms DB 50 DUP(?)
- DCApointer DD ?
-
- @DosDevIOCtl IOCtlData,IOCtlParms,2,80h,DD_Handle
-
- Mov BX,Word Ptr IOCtlParms ; get the Offset returned
- Mov Word Ptr DCApointer,BX ; save it
- Mov BX,Word Ptr IOCtlParms+2 ; get the Selector returned
- Mov Word Ptr DCApointer+2,BX ; save it
-
- Kenneth Kahn Staff of IBM Fellow: IBM Personal/370 Poughkeepsie, NY
- Internet: KENKAHN@PKSMRVM.VNET.IBM.COM IBMMAIL: USIB25P9 at IBMMAIL
-
- ----- OS2PRG CFORUM appended at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
-
- I have been having the following problem in converting my OS2 1.3 Applicaation
- to OS2 2.0 application. We have a hardware accelerator that resides on the PC B
- us and the Microchannel. It only has I/O port for communicatioon. In OS2 1.3 w
- e were able to talk to our hardware by enabling IOPL=YES in the config.sys f
- ile and enabling IOPL privileges for the whole segment that specifically commun
- icated with the hardware. If a similar procedure is followed on OS2 then I am
- getting exception error whenever I enter the segment with IOPL enabled for the
- segment. If IOPL is not enabled then the program enters the segment but flags
- an exception whenever it encounters an I/O instruction.
- I would like some help that can resolve my problem vis-a-vis access to our hard
- ware aceelerators ports . We are currently using WATCOM/386 compiler for OS2.
- The version of the compiler is 9.0. WATCOM is suggesting that OS2 2.0 does not
- allowing direct access to hardware ports. "IS IT TRUE".
-
- MY REQUEST FOR AN ANSWER IS VERY URGENT. WE HAVE A MAJOR CUSTOMER WHO HAS REQ
- UESTED US TO PORT OUR LIBRARIES TO OS2 2.0
-
- My phone number is 619-452-0903 x26 and I am available 12:30 p.m to 10 p.m East
- er Time.
-
- ----- OS2PRG CFORUM appended at 22:09:07 on 92/10/05 GMT (by ZUBER at RALVM14)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
-
- IOPL still exists in V2.0, but it has to still look just like it did
- in V1.3. Or in other words, it can't have 386 instructions.
-
- Clyde Zuber
-
- ----- OS2PRG CFORUM appended at 02:20:00 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
-
- You still have to be at ring 2 to access ports in version 2.0. You
- will trap if you try to access a port from ring 3. There is no
- compiler support for ring 2 in the flat 32-bit world (it requires
- a segment register change, and the concept of changing segment
- registers does not exist in a flat programming model.
-
- The easiest way to do this is to do the port access from ring 2 in
- 16-bit code just as on versions 1.x, and write a thunk to call the
- 16-bit code from your 32-bit code.
-
- Paul Devriendt
-
- ----- OS2PRG CFORUM appended at 12:12:30 on 92/10/06 GMT (by KEENLEY at TOROLAB6)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 02:20:00 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
-
- C Set/2 will supply the thunking code for the 32 to 16 call
- automagically.
-
- John Keenleyside OS/2 Compiler Dev.
-
- ----- OS2PRG CFORUM appended at 20:25:26 on 92/10/06 GMT (by ABLI001 at OS2CUST)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
-
- This is interesting. I thought 2.0 was upwardly compatible in this area.
- Did you get the error using the original compiled version (16bit) or did
- it only occur after recompiling with the 386 compiler?
-
- ->Rich Corbett; ABC Liquors, Inc., Orlando, FL (NASPA: CORBRIC7)
-
- ----- OS2PRG CFORUM appended at 21:22:55 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 20:25:26 on 92/10/06 GMT (by ABLI001 at OS2CUST)
-
- OS/2 2.0 is compatible as regards IOPL in that a 1.x application
- with both ring 2 and ring 3 segments will run unchanged on 2.0.
- However, you can not take the source for this application, and
- recompile as 32-bit.
-
- Paul Devriendt
-
- ----- OS2PRG CFORUM appended at 14:21:25 on 92/10/08 GMT (by XXPRMN01 at TORVMCOP)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 12:12:30 on 92/10/06 GMT (by KEENLEY at TOROLAB6)
-
- Automagically ??
-
- Matt Smith, Prominare Inc.
-
- ----- OS2PRG CFORUM appended at 22:06:28 on 92/10/08 GMT (by THRUMD at SYDVM1)
- Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
- Ref: Append at 14:21:25 on 92/10/08 GMT (by XXPRMN01 at TORVMCOP)
-
- Absolugely!
- Dave
-
- ----- OS2PRG CFORUM appended at 01:24:32 on 92/10/09 GMT (by AAAF0CY at OS2CUST)
- Subject: DosStartSession
-
- I would like to start a DOS window from an OS/2 program and have the
- OS/2 program be able to know when the DOS pgm terminates. There are
- several options, but so far the most promising has been to use
- DosStartSession creating a child window and using the TermQ field to
- provide notification to the OS/2 pgm. I'm having a problem where the
- child window immediately terminates. i.e. the window appears with
- "Dos Window" in the title bar then immediately "Closing DOS Window"
- shows up in the title bar and the window terminates. If I create the
- DOS window as independent instead of a child, it works fine. The
- queue is being created and the create function has a return code of
- 0. I don't remember what happens if I start an OS/2 child window. I
- think it also immediately terminates, so there maybe a problem with
- the DosStartSession call. Has anyone had experience with this under OS/2 2.0
- and can give me a helpful hint???
-
- Thanks
-
- Jim Sauber, MN Mutual
-
- ----- OS2PRG CFORUM appended at 03:52:45 on 92/10/13 GMT (by DEV2203 at OS2CUST)
- Subject: PDD access via DOS MVDM using IOCTLS (INT44)
-
- Can a DOS MVDM session access an OS/2 device driver (PDD) using the
- INT 21 function 44H to create an IOCTL packet for send and receive.
-
- The general thought here is that you need a VDD to connect to the
- OS/2 PDD. The DOS program would then speak to the VDD via INT21 (44)
- and the VDD would pass the commands over to the PDD.
-
- The objective is to allow a DOS program to talk to the existing OS/2
- device driver via INT 21 calls.
-
- Can this be done without the need for a VDD?
-
- Thanks,
-
- Phil
-
- ----- OS2PRG CFORUM appended at 11:08:49 on 92/10/13 GMT (by FIECHTNE at BCRVMPC1)
- Subject: PDD access via DOS MVDM using IOCTLS (INT44)
- Ref: Append at 03:52:45 on 92/10/13 GMT (by DEV2203 at OS2CUST)
-
- This can be done without a VDD. (the MODE command does this)
-
- Mark Fiechtner
-
- ----- OS2PRG CFORUM appended at 15:44:58 on 92/10/14 GMT (by SAMEH at YKTVMH) -
- Subject: General OS/2 semaphore question.
-
- When using an Event semaphore, the system keeps track of the
- number of times that the semaphore gets posted since the last
- Reset. The documentation is clear on this. However, the documentation
- says nothing about what happens to this post count as a result of
- DosWaitEventSem() or DosWaitMuxWaitSem() system calls.
-
- Does the post count get automatically decremented every time I
- DosWaitEventSem() on the semaphore and find it already posted?
-
- Does the post count get automatically decremented when I
- DosWaitMuxWaitSem() and the Event semaphore is already posted?
- (This is after adding the event semaphore to the MuxWait semaphore).
-
- Will the semaphore eventually get automatically 'Reset' when the post
- count reaches zero?
-
- Also, is there a good OS/2 2.0 reference book like the "The Waite Group's
- OS/2 Programmer's Reference by Asael Dror" was for OS/2 1.3?
-
- Thanks in advance for any help.....
-
- Sameh A. Fakhouri
-
- ----- OS2PRG CFORUM appended at 15:49:35 on 92/10/15 GMT (by PSC30 at OS2CUST)
- Subject: writing mouse device drivers
-
- I originally posted this question in BASE back in May. I got some responses
- from KIKO @ TOROLABS (Thanks, Kiko!) but without REAL documentation and the
- toolkit, I couldn't react to them. I now have BOTH, and the project was
- overdue then.
- I wrote a mouse replacement driver for 1.3 to support a graphics drawing
- pad (absolute positioning device). When I moved this driver to 2.0, it did
- not work. The several suggestions offered then did not work.
- Basically, after the device driver loads via CONFIG.SYS it initializes
- correctly(?) but there is no cursor visible on the screen at all. KDB seems
- to show that the correct events are being pushed to MOUSE$ via the Process_
- Packet (or Process_Absolute) IDC. The Query_Config and Read_Enable entries
- seem to be entered correctly. If I run a text program that issues 'MouRead
- EventQue' it shows ever changing (and apparently correct) positions - so I
- assume that the events being pushed to MOUSE$ are being accepted and
- reported.
- My suspicion is that somehow the cursor (pointer arrow) "thinks" it is
- "behind" the desktop, but I have no way of knowing that and I have not yet
- been able to externalize it into visibility.
-
- Kiko offered the suggestion that ALL 2.0 mouse events MUST show motion (event
- bit 0 = 1), but I have tried that without success and the Toolkit PDD
- manual EXPLICITLY says that absolute position events do not contain motion.
- I also run the device in "relative" mode (Process_Packet) with no success.
-
- I know that the 2.0 IDC structures have changed slightly from 1.3. I've
- programmed for that! In 1.3, the AX register contained non-zero if MOUSE$
- did not accept the event (the carry bit was also set per the doc, but AX
- was also set - I walked through the MOUSE$ code too many times!!)
- I am consistently getting a non-zero AX in 2.0 (documentation claims only
- carry is significant, but carry is off in my case so I must assume that the
- event was accepted in spite of the AX code...
-
- I'm starting to run on here. Can anybody help with this? I think if I
- can get the pointer visible, it would be working correctly....
-
- Graham Yarbrough - Prodigy Services Co
-
- ----- OS2PRG CFORUM appended at 15:33:41 on 92/10/16 GMT (by PSC30 at OS2CUST)
- Subject: Writing a IFS?
-
- Ref: Append at 23:05:17 on 92/08/17 GMT (by Il72906 at OS2CUST)
- I downloaded a copy of "Installable File Systems for OS2 2.0 ....." dated
- May 20, 1992 from the Developers Assistance BB in Boca. I suggest that you
- start by calling 407-982-6408 to get enrolled. All you need is a license
- for the 2.0 Toolkit.
- It is a big document and it looks like writing an IFS is non-trivial, but
- it doesn't look like its beyond a good OS/2 knowledgeable programmer.
-
- Graham Yarbrough - Prodigy Services Co
-
- ----- OS2PRG CFORUM appended at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
- Subject: Programmatic startup of Windows Applications
-
- Does anyone know how to programmatically start up a Windows application in a
- seamless window? I want to do the equivalent of "START /WIN PROGRAM.EXE"
- without kicking off a command processor (CMD.EXE). I have tried starting
- WINOS2.COM with both DosStartSession and WinStartApp to no avail. Are there
- some parameters I need to send to WINOS2.COM so it only starts the application
- and not a full Windows session (i.e. Program Manager...)?
-
- Rick Newill Ford Motor Company
-
- ----- OS2PRG CFORUM appended at 12:56:29 on 92/10/21 GMT (by THRUMD at SYDVM1)
- ..... OS2PRG CFORUM modified at 13:00:37 on 92/10/21 GMT (by THRUMD at SYDVM1)
- Subject: Programmatic startup of Windows Applications
- Ref: Append at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
-
- | it's late - in retrospect I didn't answer your question.
- | I guess it's time to go home...
-
- Dave
-
- ----- OS2PRG CFORUM appended at 17:31:05 on 92/10/21 GMT (by AAAF0CY at OS2CUST)
- Subject: Programmatic startup of Windows Applications
- Ref: Append at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
-
- Using DosStartSession, you can pass in the environment string
- settings for the object and DOS settings. If you send
- "SETPROGTYPE=WINDOWEDWIN;" along with the other settings (including
- setting the DOS environment, i.e. EMS_MEMORY_LIMIT, ...), this should
- make it a windows windowed session. I believe that for the program
- name you only have to name the executable.
-
- Jim Sauber, MN Mutual
-
- ----- OS2PRG CFORUM appended at 08:03:47 on 92/10/22 GMT (by DEV4186 at OS2CUST)
- Subject: DosFindFirst/Next() Can't Find Leading spaces
-
- Ok, Here is an interesting one for all of you. Has anyone tried to locate
- Files with DosFindFirst()? Write a simple program that Call FindFirst,
- printf, while( anymore files?){DosFindNext. printf}
- Compile ICC test.c
- Default Compile and Link.
- Run The Given Program in a Directory with filenames that contain leading spaces
- They don't show up!
- I have an APAR open on this one, but thought I would see if anyone had
- encountered this one yet?
-
- Thanks
- Michael Kupka
-
- ----- OS2PRG CFORUM appended at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
- Subject: Starting a DOS app in the foreground
-
- Before I embark on trying to write a C program that would start a DOS app
- in the foreground of the WPS, I need to know if it is even possible.
- Problem is that I have a company grown Windoze app that starts some DOS
- apps. When it does, it starts them in the foreground of Windoze so as to
- give the user easier access to them for response. As everybody knows,
- OS/2 does not allow a Windows program to start a DOS program. So we have
- the Windows programs write the command line for the DOS app to a file
- where we have a REXX program looking for writes to the file. When the
- file is written to, it executes the command line. Unfortunately, the user
- then has to see the error about not being able to start a DOS app and at
- that time, he or she CNTR-ESCapes to the Window List to pick out the DOS
- app for use.
- I was told that the only way to get the DOS app to start in the foreground
- was by the use of C programming. Now I am getting a conflicting statement
- from a company that does OS/2 programming for a living. They say that the
- only way to start a DOS app in the foreground is for the program starting
- it to be in the foreground. This of course is impossible to accomplish.
- I know that it is also false, since I can get a notification of a print job
- being finished over the network. Maybe it is totally different, but I think
- that there should be some way, after all we are talking about control of the
- interface (WPS), which a C programmer should have some of.
- Heck, even if the program which starts the DOS app has to give itself
- the focus before starting the DOS app, I can live with that.
- Any suggestions or definitive answers will be appreciated.
- Thanks,
-
- Nick Gardiner HHSD012
-
- ----- OS2PRG CFORUM appended at 16:40:33 on 92/10/27 GMT (by NAAO3IY at HONE82)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
-
- Why not just start a CMD that executes the DOS program?
-
- John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
-
- ----- OS2PRG CFORUM appended at 18:54:23 on 92/10/27 GMT (by MAAV7IB at HONE83)
- Subject: Debugging 16-bit code under OS/2 2.0
-
- We have an existing OS/2 1.3 application that we want to move to OS/2 2.0.
- Our concern is supporting (debugging) the 16-bit code under OS/2 2.0.
-
- The current organization is the Application Manager 3 (AM) programs
- call MS C
- 6.0 code, which calls Sybase "Open Client", TCP/IP, and APPC
- routines.
- We want to call this existing C code from AM 4 (on OS/2 2.0).
- We think we can
- link the existing 16-bit MS C code with AM 4, but are concerned
- with debugging
- the code under 2.0. We'd rather not convert the existing code
- to C-Set/2
- (32-bit) for the time being.
-
- What can I use to debug the code under 2.0? Are there facilities
- in the
- Workset/2 that I can use? OS/2 itself? Or should I be looking
- at 3rd party
- packages? Any advise would help.
-
- Thanks in advance!
-
- Kevin Miller, The Capital Group, Inc. (USCAPFAB at IBMMAIL)
-
- ----- OS2PRG CFORUM appended at 18:56:52 on 92/10/27 GMT (by HHSD012 at OS2CUST)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 16:40:33 on 92/10/27 GMT (by NAAO3IY at HONE82)
-
- Oh, if it were only that easy. We did start off with a REXX that was supposed
- to start the session in the foreground. But; when you run it and the CMD is
- not in the foreground (which it can't be), it gives you an error about not
- being able to start the session in the foreground and then starts it in the
- background. That is the point at which I was told I was going to have to
- go to C to force the session into the foreground and hence my concern about
- reports that even mighty C cannot do this...Thanks
-
- Nick Gardiner HHSD012
-
- ----- OS2PRG CFORUM appended at 20:15:50 on 92/10/27 GMT (by WZ00813 at LINK21)
- Subject: Order of mail from a mailslot
-
- I am writing a distributed application using LAN
- Server as the LAN OS. I am using mailslots to send
- messages and data between computers. I have run
- into the problem of having the messages and data
- come from the mailslot in a different order than
- they were written. Is this the way mailslots are
- supposed to work?? These messages/data blocks are
- all first class/priority one.
-
- Ross D. Schaack
-
- ----- OS2PRG CFORUM appended at 21:42:56 on 92/10/27 GMT (by WEEKS at AUSVM2) -
- Subject: Debugging 16-bit code under OS/2 2.0
- Ref: Append at 18:54:23 on 92/10/27 GMT (by MAAV7IB at HONE83)
-
- I believe IPMD (the C Set/2 debugger) can decode 16-bit code that
- was compiled for Codeview. Ask over in C-SET2 CFORUM to be sure.
-
- Craig Weeks
- LAN Systems Performance (DCE)
- Austin, Texas
-
- ----- OS2PRG CFORUM appended at 16:31:39 on 92/10/28 GMT (by NAAO3IY at HONE85)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 18:56:52 on 92/10/27 GMT (by HHSD012 at OS2CUST)
-
- Try using a C program to start a CMD in the foreground that
- executes the DOS program.
-
- John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
-
- ----- OS2PRG CFORUM appended at 21:09:06 on 92/10/28 GMT (by HHSD012 at OS2CUST)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 16:31:39 on 92/10/28 GMT (by NAAO3IY at HONE85)
-
- John,
- I take it you mean that a C program can start an OS/2 program in the foreground
- even when it is in the background. If that is the case, then you have
- answered my question. If that does work, I should be fixed up...Thanks
-
- Nick Gardiner HHSD012
-
- ----- OS2PRG CFORUM appended at 23:12:43 on 92/10/28 GMT (by SC025203 at AUSVM8)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
-
- Nick,
-
- You are making this way too complicated for what you are trying
- to do. I'm not sure why you need a WINAP to just start other
- DOS apps but I'll assume you have your reasons. This could be done
- as follows and with minimal (if any) coding:
-
- 1. Have a CMD file with two commands:
-
- WINAP (Your Windoze app)
- START WINOUT (A CMD file that WINAP writes)
- EXIT (Optional)
-
- 2. Have WINAP write to WINOUT.CMD, it has:
-
- START DOSAP1 (First DOS app)
- START DOSAP2 (Second DOS app)
- . . .
- START DOSAPn (Last DOS app)
- EXIT
-
- 3. Set up an icon (from templates) that starts the CMD file from number
- one above; or, start it in STARTUP.CMD (or any other CMD you will
- be running at this time).
-
- You stated that you already have the WINAP writing the DOS app
- names to a file, just change it to write to a CMD file (WINOUT in
- my example but you can name it anything) and to put "START " in front
- of each. The exit at the end is nice for cleanup but not absolutely
- necessary.
-
- Does this make sense?
-
- Stephen Poole
- OS/2 Service and Support - IBM Austin, TX
-
- ----- OS2PRG CFORUM appended at 02:31:53 on 92/10/29 GMT (by HHSD012 at OS2CUST)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 23:12:43 on 92/10/28 GMT (by SC025203 at AUSVM8)
-
- Stephen,
- First, let me thank you for taking a look at this. Now on to the meat.
- There are plenty of reasons for a 'homegrown' windoze or OS/2 app to start
- a DOS app. In this particular case, we use the very powerful wordprocessing
- capabilities of WordPerfect and the graphics capabilities of DrawPerfect
- to process documents that have been put together by our Toolbook app. The
- data processing people try to only use DOS programs when the Windoze
- versions aren't quite up to snuff yet. I personally did the same thing with
- Personal AS/2 and WordPerfect for DOS.
-
- Now; to make it easier for the data processing people to agree to cooperate
- with us black sheep who are using OS/2,we had them write the command line
- of the DOS app to a file before they would try to execute it from Windoze.
- They always write to the same file handle for ease of implementation, but the
- command line is almost always different because of parameters passed along
- also. To start the Toolbook app, we start our CMD from the desktop like you
- suggested. It keeps running on the desktop, but unfortunately has to leave
- the foreground so one can interact with the Toolbook app. When the Toolbook
- app writes to the file handle, the CMD program 'notices' and does a START on
- whatever command line was written to the file. This works great except for
- one thing, the CMD file CANNOT throw the DOS app to the foreground unless it
- itself is in the foreground. You might ask why that matters, we could just
- switch to the window list and restore the DOS app. That is what we do now,
- and I am sorry to tell you that it just isn't good enough. We have some people
- called'users' here who will not always remember to CNTL-ESCto the Window
- List because when they were running Windoze they didn't have to do that.
-
- Anyway, having been told on IBMLINK that REXX wouldn't be able to start a
- DOS session in the foreground unless it was there, and having been told that
- the only way to do that was with C (or some such), that started my quest.
- Now I have C-Set/2 and was about to hunker down with it when the programmers
- at a very reputable OS/2 programming house that it couldn't be done with C
- either. Therefore, I am trying to get OFFICIAL word from IBM either way.
- Can I or Can't I force a DOS app by hook or by crook onto the foreground with
- an application that isn't running in the foreground. As in a previous thread,
- I don't care if I have to force another OS/2 program into the foreground which
- starts the DOS app in the foreground, because this could be done quickly
- enough so the user doesn't even notice.
-
- Lastly Stephen, I am sorry that I am even having to do this. If IBM had
- been able to throw in some sort of pseudo enhanced mode Windoze support,
- I probably wouldn't need to 'Switch to another session to start this
- program'. Then again, if Asymetrics would come out with a Toolbook 1.5
- for OS/2 I wouldn'tneed pseudo enhanced mode or win-os2 for that matter
- since my company writes half of there apps in Toolbook.
-
- Thanks for letting me bend your eye,
-
- Nick Gardiner HHSD012
-
- ----- OS2PRG CFORUM appended at 19:56:01 on 92/10/29 GMT (by NAAO3IY at HONE84)
- Subject: Starting a DOS app in the foreground
- Ref: Append at 21:09:06 on 92/10/28 GMT (by HHSD012 at OS2CUST)
-
- I'm shaky myself about this -- but if a C program can start
- CMD.EXE in the foreground, then that CMD.EXE can of course
- run a CMD that will start the DOS program in the foreground.
-
- John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
-