home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / pfaq20in.zip / ProgFAQ.INF (.txt) next >
OS/2 Help File  |  1993-06-01  |  61KB  |  1,316 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Heading ΓòÉΓòÉΓòÉ
  3.  
  4. (reserved for future use) 
  5.  
  6.  
  7. ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
  8.  
  9.             OS/2 2.x Frequently Asked Questions, Programmer's Edition
  10.                             Version 2.0, June 1, 1993
  11.  
  12.                                    Compiled by
  13.                       Barry Jaspan <bjaspan@athena.mit.edu>
  14.                                        and
  15.                        Jeff Garzik <jgarzik@nyx.cs.du.edu>
  16.  
  17. This FAQ is for programming and development-related issues for OS/2 2.x.  It is 
  18. freely distributable.  Direct all responses and questions to 
  19. jgarzik@nyx.cs.du.edu.  Mention of a product does not constitute an 
  20. endorsement.  Answers to questions closer to the bottom of the list may rely on 
  21. information given in prior answers.  Customers outside the United States should 
  22. not necessarily rely on 800 telephone numbers, part numbers, or upgrade 
  23. policies contained in this list; all prices are listed in United Stated dollars 
  24. unless otherwise specified. 
  25.  
  26. Sometimes you will find a question that has been asked so often that it 
  27. deserves a place in the FAQ, regardless of whether I saw an answer to that 
  28. question or not.  In those cases I will simply put the question in the header 
  29. title, and put "(answer me!)" as the text.  This is a hint to help me find 
  30. someone who can answer this question.  And don't forget...  PLEASE CONTRIBUTE 
  31. ANY INFORMATION YOU CAN. 
  32.  
  33. Many of the answers in this FAQ refer to anonymous ftp site FTP-OS2.NMSU.EDU. 
  34. The name 'ftp-os2' is used as a shorthand to refer to this site.  It has 
  35. become, by default, the Internet storehouse for OS/2 files.  If you cannot get 
  36. files from this site (for whatever reason), then check OS/2 Software Sources 
  37. for a source near you.  What the hell - check it anyway!  You may find a more 
  38. convenient method of getting files than from ftp-os2. 
  39.  
  40.  
  41. Related Information:
  42.  
  43. OS/2 Software Sources
  44. Obtaining this FAQ / Contacting the Author
  45.  
  46.  
  47. ΓòÉΓòÉΓòÉ 3. Release Notes ΓòÉΓòÉΓòÉ
  48.  
  49. This is the brand spanking newly updated version of Barry Jaspan's programming 
  50. FAQ (which he graciously mailed to me).  I (Jeff Garzik) am now the maintainer 
  51. of the programming FAQ, since Barry said he didn't have the time to keep it 
  52. updated.  The FAQ isn't real complete right now since I haven't received and 
  53. tested all of the programs I promised.  I have high hopes for this FAQ - I hope 
  54. to keep it updated with benchmarks of the current compilers for OS/2, and 
  55. reviews of books, etc., etc. 
  56.  
  57.  
  58. ΓòÉΓòÉΓòÉ 4. Questions Covered in this Release ΓòÉΓòÉΓòÉ
  59.  
  60. (1.0) Languages, Compilers, Debuggers
  61.    (1.1) What programming languages come with OS/2 2.x?
  62.    (1.2) What C/C++ development environments are available?
  63.    (1.3) What is the difference between the two GNU C packages?
  64.    (1.4) How can I view the GNU C documentation?
  65.    (1.5) What other programming languages are available for OS/2?
  66.    (1.6) Which of these compilers can be used to generate PM apps?
  67.    (1.7) What is REXX?  How do I write and run a REXX program?
  68.    (1.8) What debuggers are available for OS/2?
  69.    (1.9) Where can I get documentation on the OBJ/LIB/EXE format used by OS/2 2.x?
  70.    (1.10) Please summarize this information, and tell me what I need to do OS/2 development.
  71.    (1.11) GCC/2 crashes with a trap when I try to compile a program.  Why?
  72. (2.0) Tools, Toolkits, Accessories
  73.    (2.1) How do I recompile EPM (easily)?
  74.    (2.2) What programming editors are available for OS/2?
  75.    (2.3) What programming tools/toolkits/accessories are available for OS/2?
  76.    (2.4) What GNU tools are available and where can I find them?
  77.    (2.5) Is a socket library available?  How can I use it?
  78. (3.0) Programming, Porting
  79.    (3.1) How do I change the master environment?
  80.    (3.2) What is the best way to communicate between processes?
  81.    (3.3) What is the best way to communicate between threads?
  82.    (3.4) How do I put bitmaps on buttons?
  83.    (3.5) Can a PM program tell if there's a previous instance of itself running?
  84.    (3.6) Is there an easy way to get printer output?
  85.    (3.7) How can I recompile public domain/shareware source code for OS/2?
  86.    (3.8) How can I port my DOS program to OS/2?
  87.    (3.9) How can I port my Windows program to OS/2?
  88.    (3.10) Is OS/2 suitable for real time programs?
  89.    (3.11) How do I write an OS/2 device driver?
  90.    (3.12) How can I simulate (Unix feature) under OS/2?
  91.    (3.13) How does programming PM compare to programming X?
  92.    (3.14) Why doesn't printf() produce output when I expect it to?
  93. (4.0) Documentation, Help
  94.    (4.1) Where can I get information on OS/2 APIs and programming?
  95.    (4.2) Where can I get sample code?
  96.    (4.3) Are there any OS/2 programming classes or seminars?
  97.    (4.4) What are good reference books for programming in OS/2 and PM?
  98.    (4.5) What are the OS/2 redbooks, and how do I get them?
  99. (5.0) Miscellaneous
  100.    (5.1) What is available for multimedia programming under OS/2?
  101.    (5.2) What is available for AI/neural net programming under OS/2?
  102.    (5.3) Are there any special programming software offers I should know about?
  103.    (5.4) Technical Support
  104.    (5.5) Developer's Assistance Program
  105.  
  106.  
  107. ΓòÉΓòÉΓòÉ 5. (1.0) Languages, Compilers, Debuggers ΓòÉΓòÉΓòÉ
  108.  
  109. This section covers the programming tools currently available for OS/2. 
  110.  
  111.  
  112. ΓòÉΓòÉΓòÉ 5.1. (1.1) What programming languages come with OS/2 2.x? ΓòÉΓòÉΓòÉ
  113.  
  114. The original BASIC and BASICA (for systems with BASIC in ROM), DOS's QBASIC, 
  115. and OS/2's REXX come with OS/2 2.x. 
  116.  
  117.  
  118. Related Information:
  119.  
  120. (1.7) What is REXX?  How do I write and run a REXX program?
  121.  
  122.  
  123. ΓòÉΓòÉΓòÉ 5.2. (1.2) What C/C++ development environments are available? ΓòÉΓòÉΓòÉ
  124.  
  125. Many companies offer C or C++ compilers.  The following list is almost 
  126. guaranteed to be incomplete, somewhat inaccurate, and always out of date. 
  127.  
  128. IBM Workset/2, 1-800-3-IBM-OS2, $895.  Includes the C Set/2 compiler, the IPMD 
  129. multithreaded PM debugger, the Workframe/2 development environment, and the 
  130. Developer's Toolkit (utilities and online documentation).  These pieces are 
  131. also available separately.  The full product announcement is available on 
  132. ftp-os2.  Bug reports for C Set/2 can be mailed to cset2@vnet.ibm.com, for 
  133. Workframe/2 to workframe@vnet.ibm.com and will go straight to the developers. 
  134.  
  135. NOTE:  Workset/2 was available at a promotional rate of $295 in the US and $399 
  136. in Canada, but the originally announced end dates have passed.  I do not know 
  137. if the promotion has been extended, so I assume it has not. 
  138.  
  139. Watcom C 9.0, (519) 886-3700. 
  140.  
  141. JPI C and C++, (415) 967-3200 (USA), +44 234 267500 (UK/Europe), $180. 
  142.  
  143. Glockenspiel C++, (+353)-1-733166. 
  144.  
  145. Microway C++, $595. 
  146.  
  147. Borland C++ for OS/2 
  148.  
  149. GNU C.  Two flavors of the GNU C compiler are available, both on ftp-os2. 
  150. GCC/2 is in /pub/os2/2.x/unix/gnu/gcc2-233, and emx/gcc is in 
  151. /pub/os2/2.x/unix/gnu/emx-0.8f. 
  152.  
  153.  
  154. Related Information:
  155.  
  156. (1.3) What is the difference between the two GNU C packages?
  157.  
  158.  
  159. ΓòÉΓòÉΓòÉ 5.3. (1.3) What is the difference between the two GNU C packages? ΓòÉΓòÉΓòÉ
  160.  
  161. The two versions of GNU C that are available were ported to OS/2 with different 
  162. goals and philosophies in mind and therefore have different characteristics. 
  163. However, both systems include a fairly complete C library and can be used to 
  164. compile useful programs, although their support of Unix-specific semantics 
  165. differs.  Furthermore, both systems are being actively developed and are 
  166. constantly improving. 
  167.  
  168. The goal of GCC/2 is to create a pure, freely redistributable OS/2 2.x 
  169. development environment with no extra baggage for backwards compatibility; it 
  170. is based on the assumption that DOS will die and is not worth worrying about. 
  171. It is based on GNU C 2.3.3, supports C and C++, and can create PM programs.  It 
  172. produces "native" 32 bit .OBJ files that are linked with OS/2's LINK386.EXE, 
  173. and can be linked together with .OBJ files produced by IBM C Set/2 and other 
  174. compatible compilers.  The mailing list os2gcc@charon.mit.edu exists for 
  175. discussion of this port; send mail to os2gcc-request@charon.mit.edu for 
  176. subscription information. 
  177.  
  178. emx/gcc 0.8f, also based on GNU C 2.3.3, supports C, C++, and Objective C and 
  179. can create PM programs.  emx's goal is to make porting Unix programs easier by 
  180. emulating Unix semantics as closely as possible. It produces programs that can 
  181. run both under OS/2 using EMX.DLL and under DOS using the emx DOS extender. 
  182. emx/gcc uses standard Unix development tools like ld and nm, and attempts to 
  183. support Unix-isms like select() and fork().  A version of gdb exists that can 
  184. debug emx/gcc programs. An emx-related mailing list exists; send mail to 
  185. LISTSERV@ludd.luth.se with a message body of "help" for subscription 
  186. information.  (Note that this is a *NEW* address for the emx discussion list.) 
  187.  
  188.  
  189. ΓòÉΓòÉΓòÉ 5.4. (1.4) How can I view the GNU C documentation? ΓòÉΓòÉΓòÉ
  190.  
  191. GNU C/C++ comes with documentation from the Free Software Foundation in texinfo 
  192. (.texi) format.  This documentation is about gcc in general, and has no 
  193. OS/2-specific information. 
  194.  
  195. All utilities needed to compile/view/tex the texinfo files are readily 
  196. available for OS/2.  The GNU texinfo package, available on ftp-os2 in 
  197. pub/os2/all/gnu/gnuinfo.zoo, includes makeinfo.exe for compiling texinfo, 
  198. info.exe for viewing them, and texinfo.tex and texindex.exe for TeXing them. 
  199.  
  200. An ASCII text version of the gcc documentation is also available on ftp-os2, in 
  201. the file pub/os2/2.x/gnu/gcc21/gcctxt.zoo. 
  202.  
  203. An INF hypertext version of the gcc (and related programs) documentation was 
  204. uploaded recently to ftp-os2, but has not been moved out of the /pub/uploads 
  205. directory yet. 
  206.  
  207. emx/gcc includes its own hypertext style reader and texinfo files. 
  208.  
  209.  
  210. ΓòÉΓòÉΓòÉ 5.5. (1.5) What other programming languages are available for OS/2? ΓòÉΓòÉΓòÉ
  211.  
  212. Virtually all of them: Assembler, COBOL, Pascal, Fortran, Smalltalk, Modula-2, 
  213. LISP, Forth, Perl, and more.  The OS/2 Tools Guide on ftp-os2 
  214. (pub/os2/all/info/tinf26.zoo) contains information on these and more. 
  215.  
  216. [Vendors, ftp sites, phone numbers, prices?] 
  217.  
  218. Pascal: Microway ($595), JPI ($180) 
  219. Modula-2: JPI ($180), Stonybrook 
  220. Fortran: 
  221.  
  222.    Microway ($595), Watcom 
  223.    f2c Fortran-to-C translator: ftp-os2 
  224.  
  225. Cobol: IBM Cobol/2 
  226. Smalltalk: Digital Smalltalk/PM V, Parc Place Smalltalk 
  227. Perl 4.0.10: ftp-os2 
  228. LISP: 
  229.  
  230.    Common LISP: ma2s2.mathematik.uni-karlsruhe.de 
  231.    XLisp: ftp-os2 
  232.  
  233. XScheme: ftp-os2 
  234. J: ftp-os2 
  235.  
  236.  
  237. ΓòÉΓòÉΓòÉ 5.6. (1.6) Which of these compilers can be used to generate PM apps? ΓòÉΓòÉΓòÉ
  238.  
  239. IBM C Set/2 can generate PM apps.  Workset/2 includes many sample programs and 
  240. the complete on-line reference. 
  241.  
  242. GNU C/C++ 2.1 can generate PM apps, and includes a sample program that does it. 
  243. emx/gcc can too, with some limitations (what are they?). 
  244.  
  245. Most commercial C and C++ compilers can.  WATCOM C and FORTRAN and all of JPI's 
  246. can, too.  You will probably want the IBM Developer's Toolkit, or similar 
  247. documentation, however. 
  248.  
  249.  
  250. ΓòÉΓòÉΓòÉ 5.7. (1.7) What is REXX?  How do I write and run a REXX program? ΓòÉΓòÉΓòÉ
  251.  
  252. REXX is the IBM SAA (Systems Application Architecture) standard, user-friendly 
  253. programming language.  It is available for IBM mainframes, Unix, the Amiga, DOS 
  254. (Mansfield's Professional REXX), Windows, and many other platforms.  It has 
  255. been a part of standard OS/2 since Version 1.3.  Programs written in REXX that 
  256. do not use system-specific libraries are fully portable. 
  257.  
  258. OS/2 2.x comes with an online REXX reference, and printed REXX documentation is 
  259. available (Mike Cowlinshaw's REXX book, IBM's twin guides).  The Usenet group 
  260. comp.lang.rexx discusses REXX programming. 
  261.  
  262.  
  263. ΓòÉΓòÉΓòÉ 5.8. (1.8) What debuggers are available for OS/2? ΓòÉΓòÉΓòÉ
  264.  
  265. IPMD, a PM-based debugger, ships with C Set/2.  It is capable of source- and 
  266. assembly-level debugging multithreaded 16 bit and 32 bit OS/2 applications 
  267.  
  268. emx comes with gdb, the GNU debugger. 
  269.  
  270. Borland C++/2 comes with a PM-based debugger (Turbo Debugger GX) which has the 
  271. same basic functionality as IPMD. 
  272.  
  273. There are also several commercial debuggers on the market.  WATCOM C and 
  274. FORTRAN come with WVIDEO, a full-screen source or assembly lever debugger that 
  275. handles multithreaded 16 and 32 bit OS/2 programs. Multiscope, others? 
  276.  
  277.  
  278. ΓòÉΓòÉΓòÉ 5.9. (1.9) Where can I get documentation on the OBJ/LIB/EXE format used by OS/2 2.x? ΓòÉΓòÉΓòÉ
  279.  
  280. The .EXE format was described briefly in PC Magazine, Vol 11 No. 12 (June 30, 
  281. 1992?); it was also described in a 1988 issue. 
  282.  
  283. It is also available in text form from ftp-os2 as 
  284. /pub/os2/2.x/programming/lxexe.doc. 
  285.  
  286.  
  287. ΓòÉΓòÉΓòÉ 5.10. (1.10) Please summarize this information, and tell me what I need to do OS/2 development. ΓòÉΓòÉΓòÉ
  288.  
  289. (answer me!) 
  290.  
  291.  
  292. ΓòÉΓòÉΓòÉ 5.11. (1.11) GCC/2 crashes with a trap when I try to compile a program.  Why? ΓòÉΓòÉΓòÉ
  293.  
  294. Because you didn't read the README or INSTALL files, probably.  There are three 
  295. general reasons GCC/2 will crash: 
  296.  
  297.  1. You did not set up the environment variables in CONFIG.SYS properly.  Read 
  298.     doc/INSTALL for instructions. 
  299.  
  300.  2. Some program that gcc expects to be in the PATH is not; unfortunately, gcc 
  301.     crashes instead of just printing an error message.  You may forgotten to 
  302.     install something, or your PATH may be wrong; see above.  Giving gcc the -v 
  303.     option will cause it to print each command line as it executes it; this 
  304.     will tell you which program is missing. 
  305.  
  306.  3. You are trying to get gcc to link your program for you. It cannot because 
  307.     ld does not exist, and so it crashes (see item 2).  You must specify -c, 
  308.     -E, or -S on every invokation of gcc, and then use LINK386.EXE to create an 
  309.     executable.  See the sample makefiles for an example of how to do this. 
  310.  
  311.  
  312. ΓòÉΓòÉΓòÉ 6. (2.0) Tools, Toolkits, Accessories ΓòÉΓòÉΓòÉ
  313.  
  314. This section covers tools, toolkits, and accessories available to OS/2 
  315. programmers. 
  316.  
  317.  
  318. ΓòÉΓòÉΓòÉ 6.1. (2.1) How do I recompile EPM (easily)? ΓòÉΓòÉΓòÉ
  319.  
  320. (answer me!) 
  321.  
  322.  
  323. ΓòÉΓòÉΓòÉ 6.2. (2.2) What programming editors are available for OS/2? ΓòÉΓòÉΓòÉ
  324.  
  325. OS/2 2.x comes with the Enhanced Editor (EPM). 
  326.  
  327. GNU Emacs 18.58 is available.  It requires you to have emx installed on your 
  328. machine, but it comes with all the emx files you will need. Emacs is available 
  329. on ftp-os2 in /pub/os2/2.x/gnu/emacs.  (If you want to recompile emacs, you 
  330. will need the full emx distribution; see question 1.2.) 
  331.  
  332. Several public-domain vi clones are available, including elvis, Stevie and 
  333. levee.  The MKS Toolkit also includes vi. 
  334.  
  335. Many other text editors are available. 
  336.  
  337. Epsilon, by Luguru, (412) 421-5678.  DOS upgrade to OS/2 is $90.  Character 
  338. based editor. 
  339.  
  340. Q-EDIT, by SemWare, (404) 641-9002.  Character based editor, almost identical 
  341. to Q-Edit for DOS.  Does not support long filenames. 
  342.  
  343. Brief, KEDIT, others? [Vendors, phone numbers, prices?] 
  344.  
  345.  
  346. ΓòÉΓòÉΓòÉ 6.3. (2.3) What programming tools/toolkits/accessories are available for OS/2? ΓòÉΓòÉΓòÉ
  347.  
  348. The IBM Programmer's Toolkit, included in Workset/2, includes many tools. 
  349.  
  350. Borland has released ObjectVision for OS/2.  [Details?] 
  351.  
  352. Borland C++ for OS/2 also includes a number of utilities, such as the Resource 
  353. Workshop. 
  354.  
  355. The MKS Toolkit, available from MKS ($349 USD, 800-265-2797 or 
  356. inquiry@mks.com), has over 160 Unix tools, including Korn shell, tar, vi, awk, 
  357. grep, tail, cpio, and so forth.  It also contains a Lex and Yacc capable of 
  358. generating C, C++, and Turbo Pascal code. 
  359.  
  360. There is a product called ARGO/UX which provides a BSD environment for OS/2. 
  361. [details?] 
  362.  
  363.  
  364. ΓòÉΓòÉΓòÉ 6.4. (2.4) What GNU tools are available and where can I find them? ΓòÉΓòÉΓòÉ
  365.  
  366. Nearly all the GNU utilities have been ported to OS/2 2.x - and nearly all of 
  367. those ports are located on ftp-os2 in /pub/os2/2.x/unix/gnu. Other, more 
  368. involved (or independent) ports of GNU software is scattered about ftp-os2, 
  369. including a PM version of GhostView and GhostScript. 
  370.  
  371.  
  372. ΓòÉΓòÉΓòÉ 6.5. (2.5) Is a socket library available?  How can I use it? ΓòÉΓòÉΓòÉ
  373.  
  374. IBM's TCP/IP 1.2.1 ($200, part #02G6968) includes an optional Programmer's 
  375. Toolkit ($500, part #02G6973).  It includes a socket library, and support for 
  376. Sun RPC, NCS RPC, and a limited Kerberos capability.  It requires IBM C Set/2 
  377. or another compiler that understands 16-bit code. 
  378.  
  379. FTP Software, Inc., has an OS/2 version of its TCP/TCP product.  They can be 
  380. reached at (617) 246-0900 or info@ftp.com. 
  381.  
  382. Walt Corey, KZ1F, is porting KA9Q to OS/2 and PM. The current version of his 
  383. code is available for ftp from giskard.uthscsa.edu. This is still a work in 
  384. progress, with rough edges here and there, and in particular there's no 
  385. Ethernet (or anything but async serial, i.e. SLIP, PPP, and KISS) support yet, 
  386. though that's high on the priority list. You can email Walt at 
  387. kz1f@giskard.uthscsa.edu. 
  388.  
  389. If you have the IBM TCP/IP 1.2 base package and IBM C Set/2, you can use the 
  390. TCPIPDLL.DLL directly.  A 32 bit socket library interface to do this for you 
  391. will be available shortly.  It will also be possible to call TCP/IP functions 
  392. from programs generated with gcc.  (Yes, yes, I know I've been promising this 
  393. for a while.  I apologize for the delay; be patient.) 
  394.  
  395.  
  396. ΓòÉΓòÉΓòÉ 7. (3.0) Programming, Porting ΓòÉΓòÉΓòÉ
  397.  
  398. This section covers general programming and porting practices. 
  399.  
  400.  
  401. ΓòÉΓòÉΓòÉ 7.1. (3.1) How do I change the master environment? ΓòÉΓòÉΓòÉ
  402.  
  403. Quick and simple answer: you don't. 
  404.  
  405. In OS/2 it is literally impossible for you to change the master environment 
  406. from one of your programs.  Do be able to do so would fatally disrupt the 
  407. programming paradigm that has existed for ages:  Your program does not alter 
  408. the master environment. Your program is the slave, not the master.  Therefore, 
  409. no capability was built into OS/2 to facilitate this. 
  410.  
  411. There is, however, a kludge. 
  412.  
  413. As you know, a .CMD file can alter the master environment.  This is the nature 
  414. of batch files (ok, so I'm a MS-DOG dinosaur and still call them batch files 
  415. instead of command files or scripts).  Therefore, you can place a sequence of 
  416. commands in the batch file that will take your program's output and alter the 
  417. environment of your current shell. 
  418.  
  419. That's as close as you are gonna get to the master environment.  You can always 
  420. create your own sort of environment variables, in the form of shared memory or 
  421. named pipes. 
  422.  
  423.  
  424. ΓòÉΓòÉΓòÉ 7.2. (3.2) What is the best way to communicate between processes? ΓòÉΓòÉΓòÉ
  425.  
  426. There is more than one way - and you get to decide which is right for you! 
  427.  
  428. Shared Memory 
  429.  
  430. Shared memory is pretty self-explanatory.  It is a memory segment that is 
  431. allocated by one program, and then made available to other programs. When all 
  432. the programs are done with it, then it is disposed of.  You can name shared 
  433. memory.  So if you want two programs to communicate, then let them look for 
  434. memory with the same name and communicate that way. 
  435.  
  436. Named Pipes 
  437.  
  438. Named pipes are a lot like shared memory, but think of a named pipe as a file 
  439. instead of a single block of memory.  Each process can create, read, write, and 
  440. destroy a named pipe, much like you can a file. 
  441.  
  442. The difference between named pipes and shared memory is that a named pipe link 
  443. is hot; With shared memory, data can be left in (as a sleeper, if you will), 
  444. process 1 exits, process 2 accesses the data in memory, then deallocates the 
  445. memory.  With shared memory, a process doesn't even have to exist to leave a 
  446. message for another process. 
  447.  
  448. Queues 
  449.  
  450. I wouldn't really think of these as ways to communicate between processes, but 
  451. some nifty programmer might come up with a good use for queues.  Nevertheless, 
  452. an OS/2 queue is a standard First-In First-Out (FIFO) queue data/operation 
  453. structure.  However, OS/2 makes it really special because more than one process 
  454. (or thread) can write to this queue. 
  455.  
  456.  
  457. Related Information:
  458.  
  459. (3.3) What is the best way to communicate between threads?
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 7.3. (3.3) What is the best way to communicate between threads? ΓòÉΓòÉΓòÉ
  463.  
  464. The best way to communicate between threads is sometimes also (3.2) the best 
  465. way to communicate between processes.  However, when communicating between 
  466. threads you can utilize two (very important) techniques: 
  467.  
  468. Semaphores 
  469.  
  470. In order to share application resources, and not write to the same space at the 
  471. same time, you have to have some kind of flags that tell the thread when it 
  472. should stop, when it should keep on going, and so on. Semaphores provide this 
  473. capability.  Semaphores are not for passing data.  They merely exist as simple 
  474. flags between threads and you should treat them as such.  (It would be nice 
  475. sometimes if semaphores worked across processes, but they don't.) 
  476.  
  477. Global Variables 
  478.  
  479. "Hey Jeff - I thought this was supposed to be about nifty OS/2-specific 
  480. tricks!"  It is!  You can now use those old nasty things, global variables, in 
  481. new ways.  In conjunction with semaphores, you can pass data very easily 
  482. between threads with global variables.  Here's a simple example: 
  483.  
  484.  1. Create a global variable called PassData. 
  485.  2. Create a semaphore called OkToPassData. 
  486.  3. Create a semaphore called DataPassed. 
  487.  4. Have two threads work at the same time: 
  488.  
  489.     a. If the semaphore DataPassed is true: 
  490.  
  491.        1. Set the semaphore OkToPassData to false. 
  492.        2. Read the data in the global. 
  493.        3. Set the semaphore DataPassed to false. 
  494.        4. Set the semaphore OkToPassData to true. 
  495.  
  496.     b. When a thread wants to pass data, wait for the semaphore to be clear. 
  497.     c. Set the semaphore OkToPassData to false. 
  498.     d. Put the data in the global. 
  499.     e. Set the semaphore DataPassed to true. 
  500.     f. Set the semaphore OkToPassData to true. 
  501.  
  502. Of course, there are issues of deadlock and other such nonsense that we 
  503. corporate chaps get paid to consider, but that's beyond the scope of this 
  504. document. 
  505.  
  506.  
  507. Related Information:
  508.  
  509. (3.2) What is the best way to communicate between processes?
  510.  
  511.  
  512. ΓòÉΓòÉΓòÉ 7.4. (3.4) How do I put bitmaps on buttons? ΓòÉΓòÉΓòÉ
  513.  
  514. Stefan Gruendal (Stefan_Gruendel@wue.maus.de) writes: 
  515.  
  516. But to my question:  How do I build my own "smart icons", i.e. bitmaps on 
  517. pushbuttons, that optically "move into the screen"? I didn't find any way to 
  518. achieve this with the Toolkit's Dialog Editor.  But as mentioned above, I know 
  519. there's a way. 
  520.  
  521. Starting with OS/2 2.x, a new button style was added - BS_ICON - which allows 
  522. you to do what you are trying to accomplish.  It works, as far as I know, only 
  523. for pushbuttons, and the icon or bitmap is taken from the resource file, whose 
  524. resource id is specified in the pushbutton text. 
  525.  
  526. For example: 
  527.  
  528. In FOO.H: 
  529.  
  530. #define IDBM_BUTTON 256
  531. #define IDPB_BUTTON 257
  532.  
  533. In FOO.RC: 
  534.  
  535. BITMAP IDBM_BUTTON BUTTON.BMP
  536.  
  537. In FOO.C: 
  538.  
  539. sprintf(achText,"#%d",IDBM_BUTTON);
  540.  
  541. hwndButton=WinCreateWindow(hwndClient,
  542.               WC_BUTTON,
  543.               achText,
  544.               WS_VISIBLE|BS_PUSHBUTTON|BS_ICON,
  545.               10,
  546.               10,
  547.               32,
  548.               32,
  549.               hwndClient,
  550.               HWND_TOP,
  551.               IDPB_BUTTON,
  552.               NULL,
  553.               NULL);
  554.  
  555. The bitmap is stretched or compressed to fill the button. 
  556.  
  557. (Quoted almost directly from EDMI/2 Edition 1) 
  558.  
  559.  
  560. ΓòÉΓòÉΓòÉ 7.5. (3.5) Can a PM program tell if there's a previous instance of itself running? ΓòÉΓòÉΓòÉ
  561.  
  562. Raja Thiagarajan (sthiagar@bronze.ucs.indiana.edu) writes: 
  563.  
  564. Can a PM program tell if there's a previous instance of itself running?  In 
  565. Win3.x (but apparently NOT Win32), there's a hPrevInst handle; is there an OS/2 
  566. 2.x equivalent?  Basically, I'm thinking in terms of a program that would try 
  567. to borrow resources from a previous instance if a previous instance is running. 
  568. (Specifically, if my palette animation program gets started twice, the second 
  569. instance oughta share palettes with the first instance!) 
  570.  
  571. What you're really asking is two questions: 
  572.  
  573.  1. How can I determine if a previous instance of my application is already 
  574.     running? 
  575.  2. How can I share resources between multiple instances of my application? 
  576.  
  577. To answer your first question, you need to enumerate all of the main windows 
  578. present on the desktop, and figure out if any of them are yours. This is 
  579. achieved using the following code: 
  580.  
  581. HWND queryAppInstance(PCHAR pchClassWanted)
  582. {
  583.   HENUM heEnum;
  584.   HWND hwndTop;
  585.   HWND hwndClient;
  586.   CHAR achClass[256];
  587.  
  588.   heEnum=WinBeginEnumWindows(HWND_DESKTOP);
  589.  
  590.   hwndTop=WinGetNextWindow(heEnum);
  591.   while (hwndTop!=NULLHANDLE) {
  592.    hwndClient=WinWindowFromID(hwndTop,FID_CLIENT);
  593.    if (hwndClient!=NULLHANDLE) {
  594.      WinQueryClassName(hwndClient,sizeof(achClass),achClass);
  595.      if (strcmp(achClass,pchClassWanted)==0) {
  596.       WinEndEnumWindows(heEnum);
  597.       return hwndClient;
  598.      } /* endif */
  599.    } /* endif */
  600.  
  601.    hwndTop=WinGetNextWindow(heEnum);
  602.   } /* endwhile */
  603.  
  604.   WinEndEnumWindows(heEnum);
  605.   return NULLHANDLE;
  606. }
  607.  
  608. To answer your second question, the only way that I know of to share resources 
  609. is to place them in a DLL.  The procedure to do this is as follows: 
  610.  
  611. o Create a dummy source file with an empty procedure in it. 
  612. o Compile the source file and link as a DLL. 
  613. o Add your resources to the DLL in the same manner as you would to an 
  614.   executable. 
  615.  
  616. Then, when your application starts, you simply call WinLoadLibrary  (the 
  617. preferred way) or DosLoadModule to load the DLL.  These functions return a 
  618. handle to the DLL which must then be used in any function which loads resources 
  619. (e.g. GpiLoadBitmap, WinLoadPointer, etc.). 
  620.  
  621. Note that this procedure does not require knowing the window handle of any 
  622. previous instance of your application because OS/2 implements DLLs in a shared 
  623. fashion (which I suspect is one of the reasons they were created in the first 
  624. place).  All you need to know is the name of the DLL.  This technique can also 
  625. be used to share resources between different applications. 
  626.  
  627. (Quoted almost directly from EDMI/2 Edition 1) 
  628.  
  629.  
  630. ΓòÉΓòÉΓòÉ 7.6. (3.6) Is there an easy way to get printer output? ΓòÉΓòÉΓòÉ
  631.  
  632. A reader who desires to remain anonymous writes: 
  633.  
  634. Generally:  My understanding was that OS/2 would handle printing for me.  That 
  635. is to say that I wouldn't have to create separate printer drivers for every 
  636. printer under the sun (or any for that matter).  Since I am creating an image 
  637. on the screen that is device independent (well, mostly anyway), is there an 
  638. easy way to get printer output? 
  639.  
  640. PM achieves a level of device independence by defining a logical output space. 
  641. This logical output space is then bound to a physical output space, which 
  642. creates a mapping of logical characteristics to their physical counterparts. 
  643. The logical and physical output spaces are referred to as the presentation 
  644. space and the device context (HPS and HDC) and are bound to one another by 
  645. using either the GpiAssociate function or by specifying GPIA_ASSOC to the 
  646. GpiCreatePS function. 
  647.  
  648. The easiest way to accomplish what you desire is to organize your drawing code 
  649. into one or more functions with a single entrypoint that accepts an HPS as a 
  650. parameter.  Then, when you want to draw to the screen, you can call 
  651. WinGetPS/WinBeginPaint to get an HPS and call the function. When you want 
  652. hardcopy, you call DevOpenDC to get an HDC and GpiCreatePS to get an HPS and 
  653. call the function. 
  654.  
  655. Note that to get hardcopy, you need to perform some additional setup to get 
  656. things to work properly.  The two most important things are that you initialize 
  657. the DEVOPENSTRUC structure properly before calling DevOpenDC and that you send 
  658. the following escape codes (via DevEscape) at the following times: 
  659.  
  660.  hdcPrn=DevOpenDC(...);
  661.  hpsPrn=GpiCreatePS(...);
  662.  
  663.  DevEscape(...,DEVESC_STARTDOC,...);
  664.  
  665.  if (!doDraw(hpsPrn)) {
  666.    DevEscape(...,DEVESC_ABORTDOC,...);
  667.  } /* endif */
  668.  
  669.  DevEscape(...,DEVESC_ENDDOC,...);
  670.  
  671.  GpiDestroyPS(hpsPrn);
  672.  DevCloseDC(hdcPrn);
  673.  
  674. I'm not sure because I can't seem to find my copy anywhere, but I belive that 
  675. the book by Graham Winn (entitled something to the effect of "Building 
  676. applications using the OS/2 Presentation Manager") dedicates a chapter to the 
  677. nuances of printing. 
  678.  
  679. (Quoted almost directly from EDMI/2 Edition 1) 
  680.  
  681.  
  682. Related Information:
  683.  
  684. (4.4) What are good reference books for programming in OS/2 and PM?
  685.  
  686.  
  687. ΓòÉΓòÉΓòÉ 7.7. (3.7) How can I recompile public domain/shareware source code for OS/2? ΓòÉΓòÉΓòÉ
  688.  
  689. Most publicly available OS/2 programs come with binaries (since there is 
  690. currently only one OS/2 architecture).  If you are porting source code from 
  691. another system (for example, Unix), you will first need to acquire a compiler. 
  692. See section 1 for information on compilers; in particular, note that the GNU C 
  693. compiler is available. 
  694.  
  695. You should realize that many publicly available programs have already been 
  696. ported to OS/2.  Check the many FTP sites carrying OS/2 programs before you 
  697. reinvent any wheels (the OS/2 User's FAQ contains information on FTP site). 
  698.  
  699. Most Unix applications (through the use of emx/gcc) port with extreme ease; DOS 
  700. and Windows applications are a tougher problem, and require many changes before 
  701. they can be recompiled as a native OS/2 program. 
  702.  
  703. (It is interesting to note that MicroSoft C v6.0 will compile bound OS/2 
  704. programs, which will run under DOS and OS/2 without modification.) 
  705.  
  706.  
  707. Related Information:
  708.  
  709. (3.8) How can I port my DOS program to OS/2?
  710. (3.9) How can I port my Windows program to OS/2?
  711.  
  712.  
  713. ΓòÉΓòÉΓòÉ 7.8. (3.8) How can I port my DOS program to OS/2? ΓòÉΓòÉΓòÉ
  714.  
  715. To the first approximation, you don't have to --- OS/2 2.x's DOS support is 
  716. excellent, and your DOS program will probably just work; similarly, OS/2 2.x 
  717. supports Windows 3.0 (and soon 3.1) programs.  See the OS/2 User's FAQ for 
  718. details. 
  719.  
  720. [That was Barry Jaspan's opinion.  I believe that you should make every effort 
  721. to recompile your existing DOS programs for OS/2 2.x.  They will run faster in 
  722. many cases, and both (a) use less memory and (b) be able to use more memory 
  723. than their DOS counterparts. - Jeff] 
  724.  
  725. If you truly want to port your DOS program over to OS/2, then study the 
  726. libraries available to you.  The core code (if you wrote it correctly) will 
  727. probably not change much.  You will just have to change the user interface 
  728. stuff. 
  729.  
  730. If your program is a real simple one that uses standard input and output, then 
  731. you will probably not make very many changes to your program when converting it 
  732. to OS/2. 
  733.  
  734. You should also realize that neato and nifty DOS tricks (like grabbing an 
  735. interrupt whenever you feel like it, or writing directly to anywhere) are 
  736. completely out of the question. 
  737.  
  738.  
  739. Related Information:
  740.  
  741. (3.9) How can I port my Windows program to OS/2?
  742.  
  743.  
  744. ΓòÉΓòÉΓòÉ 7.9. (3.9) How can I port my Windows program to OS/2? ΓòÉΓòÉΓòÉ
  745.  
  746. IBM Workset/2 includes Mirrors, a toolkit designed to help port Windows 
  747. applications to OS/2.  [Details?] 
  748.  
  749. There are also several toolkits available that allow you to make calls to a 
  750. common API library, and your source will work across the two platforms without 
  751. any changes at all. 
  752.  
  753. However, if you want to bite the bullet and port it, then be prepared to make a 
  754. lot of changes.  Just like porting regular DOS programs, you will have to scrap 
  755. most, if not all, of your user interface.  Your core code, if modular and 
  756. abstract enough, should come through the port relatively unscathed. 
  757.  
  758.  
  759. Related Information:
  760.  
  761. (3.8) How can I port my DOS program to OS/2?
  762.  
  763.  
  764. ΓòÉΓòÉΓòÉ 7.10. (3.10) Is OS/2 suitable for real time programs? ΓòÉΓòÉΓòÉ
  765.  
  766. Yes!  There is a special priority you can assign your programs 
  767. (ForegroundServer Mode) via DosSetPriority() which will give your process 
  768. (note, not thread, but process) the maximum allowable CPU time. 
  769.  
  770. Another route is to use DosEnterCritSec()/DosExitCritSec().  Calling the former 
  771. will disable thread switching (hopefully for a short period of time), and 
  772. calling the latter will enable thread switching again. 
  773.  
  774.  
  775. ΓòÉΓòÉΓòÉ 7.11. (3.11) How do I write an OS/2 device driver? ΓòÉΓòÉΓòÉ
  776.  
  777. There's a book called Writing OS/2 2.0 Device Drivers in C from 
  778. Van Nostrand-Reinhold.  There's also IBM's flood of printed material. 
  779.  
  780.  
  781. Related Information:
  782.  
  783. (4.4) What are good reference books for programming in OS/2 and PM?
  784.  
  785.  
  786. ΓòÉΓòÉΓòÉ 7.12. (3.12) How can I simulate (Unix feature) under OS/2? ΓòÉΓòÉΓòÉ
  787.  
  788.  1. fork 
  789.  2. fork/exec 
  790.  3. select 
  791.  4. job control 
  792.  
  793. In general, you can't.  select() depends heavily on the fact that all sources 
  794. and sinks of data originate in the filesystem and are identified by a coherent 
  795. set of file descriptors; these assumptions are not true under OS/2.  For 
  796. (almost) any particular kind of data source/sink (files, sockets, pipes) you 
  797. can achieve most of select()'s semantics.  A decent solution to this problem 
  798. requires a C library that maintains its own array of file descriptors and 
  799. information on each one such that it can dispatch to the appropriate module in 
  800. response to library calls.  The C libraries delivered with gcc and emx/gcc will 
  801. have such functionality in the (possibly near) future, but don't yet. 
  802.  
  803. A working version of fork() comes with the emx/gcc libraries.  The author 
  804. cautions that this is not the way to multitask, though, because it eats up a 
  805. lot of resources (since it literally duplicates the current process, leaving 
  806. everything but the PID unchanged).  _beginthread() is the suggested solution if 
  807. at all possible. 
  808.  
  809.  
  810. ΓòÉΓòÉΓòÉ 7.13. (3.13) How does programming PM compare to programming X? ΓòÉΓòÉΓòÉ
  811.  
  812. Many people have said "PM is much cleaner."  Until I hear from someone I trust 
  813. with extensive experience with both (I only know X), however, this FAQ will 
  814. take no position. 
  815.  
  816. There was an unsubstantiated rumor that someone was porting an X library to 
  817. OS/2 (X-Windows, not X-Mode or any other X), I dunno whether this has been 
  818. substantiated or not. 
  819.  
  820.  
  821. ΓòÉΓòÉΓòÉ 7.14. (3.14) Why doesn't printf() produce output when I expect it to? ΓòÉΓòÉΓòÉ
  822.  
  823. For historical reasons, most Unix C libraries' stdio default to using line 
  824. buffered streams, whereas most DOS and OS/2 C libraries' stdio default to using 
  825. fully buffered streams.  ANSI C species that standard output should be line 
  826. buffered when connected to an interactive device, but not all libraries are 
  827. ANSI compliant.  You can control the buffering algorithm used for a particular 
  828. stream with the setvbuf() function. 
  829.  
  830. If you didn't understand that paragraph, read on. 
  831.  
  832. printf() is part of the Standard I/O (stdio) library, which uses buffered 
  833. streams for file IO.  ANSI C specifies three algorithms for deciding when to 
  834. flush the buffer (i.e. when to print buffered data to the file): 
  835.  
  836. o not buffered.  Data is flushed to the file as soon as possible, usually 
  837.   immediately after being received. 
  838. o line buffered.  Data is flushed to the file when a newline is received (and 
  839.   the newline is also flushed). 
  840. o fully buffered.  Data is flushed to the file when the buffer is full. 
  841.  
  842. Buffered data is always flushed when the stream is closed or when fflush() is 
  843. called.  Since standard output is flushed when main() exits, all data printed 
  844. with printf() will appear at that time, if it has not already.  However, ANSI C 
  845. does not require that a stream be flushed when scanf() is called on it. 
  846. Therefore, if you print to a fully buffered stream and then request input on 
  847. it, it is likely that the input will be read before the printed data appears. 
  848.  
  849. You can control the buffering algorithm used for a particular stream with the 
  850. setvbuf() function.  For example, the statement setvbuf(stdout, NULL, _IOLBF, 
  851. BUFSIZ) sets standard output to be line-buffered, which is what most Unix 
  852. programmers expect.  Any decent C reference will cover all of this material. 
  853.  
  854. The gcc 2.1 library will have a line-buffered stdout by default in a future 
  855. release. 
  856.  
  857.  
  858. ΓòÉΓòÉΓòÉ 8. (4.0) Documentation, Help ΓòÉΓòÉΓòÉ
  859.  
  860. This section covers documentation and help available for OS/2 programming. 
  861.  
  862.  
  863. ΓòÉΓòÉΓòÉ 8.1. (4.1) Where can I get information on OS/2 APIs and programming? ΓòÉΓòÉΓòÉ
  864.  
  865. The IBM Programmer's Toolkit, included in Workset/2, includes a complete 
  866. on-line syscall reference. 
  867.  
  868. You can order the seventeen volume IBM OS/2 Technical Library (possibly at a 
  869. discount, see question 1.2) and/or order various volumes individually; the file 
  870. pub/os2/2.x/info/os2pubs.txt lists all (many?) of the IBM OS/2-related 
  871. reference manuals, as of May 20, 1992, along with ordering information. 
  872.  
  873.  
  874. Related Information:
  875.  
  876. (4.4) What are good reference books for programming in OS/2 and PM?
  877. (1.2) What C/C++ development environments are available?
  878.  
  879.  
  880. ΓòÉΓòÉΓòÉ 8.2. (4.2) Where can I get sample code? ΓòÉΓòÉΓòÉ
  881.  
  882. There is a lot of sample code included in the IBM Toolkit, and 4 sample 
  883. programs (with source) included with C Set/2.  GNU C/C++, from ftp-os2, 
  884. includes a sample C, C++, and C++ PM program.  The OS/2 Redbooks also have some 
  885. sample code.  ftp-os2 also has little bits of OS/2 and PM source code lying 
  886. around in the /pub/os2/2.x/programming directory. 
  887.  
  888.  
  889. Related Information:
  890.  
  891. (4.5) What are the OS/2 redbooks, and how do I get them?
  892.  
  893.  
  894. ΓòÉΓòÉΓòÉ 8.3. (4.3) Are there any OS/2 programming classes or seminars? ΓòÉΓòÉΓòÉ
  895.  
  896. Yes.  Call IBM at either 1-800-3-IBM-OS2 in U.S. (or the PS/2 Help Center). 
  897. Local IBM branches frequently hold OS/2 classes and seminars.  I haven't seen 
  898. third party efforts in this regard, but I know they exist. 
  899.  
  900. See pub/os2/2.x/info/ivleague.txt on ftp-os2 for a list of third-party support 
  901. organizations. 
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ 8.4. (4.4) What are good reference books for programming in OS/2 and PM? ΓòÉΓòÉΓòÉ
  905.  
  906. Van Nostrand Reinhold publishes a number of books on OS/2 2.x.  Those that 
  907. relate to programming are: 
  908.  
  909. INTEGRATING APPLICATIONS WITH OS/2 2.0
  910. By William H. Zack
  911. 0-422-01234-9
  912.  
  913. CLIENT SERVER PROGRAMMING WITH OS/2 2.0
  914. By Robert Orfali and Daniel Harkey, IBM Corporation
  915. 0-422-01219-5
  916.  
  917. WRITING OS/2 2.0 DEVICE DRIVERS IN C
  918. By Steven J. Mastrianni; Foreword by John Soyring, IBM Corporation
  919. 0-442-01141-5
  920.  
  921. OS/2 2.0 PRESENTATION MANAGER GPI: A Programming Guide to Text, Graphics, And Printing
  922. By Graham C.E. Winn, IBM Corporation
  923. 0-442-00739-6
  924.  
  925. THE COBOL PRESENTATION MANAGER PROGRAMMING GUIDE
  926. By David M. Dill, Consultant
  927. 0-442-01293-4
  928.  
  929. LEARNING TO PROGRAM OS/2 2.0 PRESENTATION MANAGER BY EXAMPLE: Putting the Pieces Together
  930. By Stephen Knight, IBM Corportaion
  931. 0-442-01292-6
  932.  
  933.  
  934. Related Information:
  935.  
  936. (4.5) What are the OS/2 redbooks, and how do I get them?
  937.  
  938.  
  939. ΓòÉΓòÉΓòÉ 8.5. (4.5) What are the OS/2 redbooks, and how do I get them? ΓòÉΓòÉΓòÉ
  940.  
  941. IBM publishes so-called "redbooks" on many products, including OS/2 2.x.  They 
  942. seem to be a combination of power-user's guides and design information that may 
  943. be of use to both users and programmers [I haven't received my copies yet, so I 
  944. cannot say for sure.]  These are usually intended only for special IBM 
  945. customers and contain documentation that is generally unavailable anywhere 
  946. else.  You can order these books directly from IBM (see below).  All of the 
  947. following names are implicitly preceeded by "OS/2 Version 2.0." 
  948.  
  949. Volume 1: Control Program: GG24-3730, $4.15 
  950.      Technical information on Memory Management, Task Mangement, Support, 
  951.      Installation Considerations, Hardware Considerations, Boot Manager, 
  952.      National Language Considerations, Intel 386 architecture, Channel 
  953.      Architecture and SCSI.  Documents config.sys. 
  954.  
  955. Volume 2: DOS and Windows Environment, GG24-3731, $6.20 
  956.      MVDM,8086 Emulation,MVDM DOS emulation, Device Drivers, Memory Extender 
  957.      Support, Installing and Migrating Applications, Windows Applications, 
  958.      DPMI, Running DOS apps,DOS settings, VMB. 
  959.  
  960. Volume 3:  PM and Workplace Shell GG24-3732, $3.65 
  961.      Available now, but I don't know precisely what's in it. 
  962.  
  963. Volume 4: Application Development GG24-3774, $5.25 
  964.      Technical programming info (includes list in C) Overview, Object-Oriented 
  965.      Apps, PM application model, flat memory model, building PM app, Workplace 
  966.      AOAShell and System Object Model, Direct Manipulation (Drag/drop), PM 
  967.      resources, Multitasking Considerations, SAA CUA considerations, App 
  968.      Migration, Mixing 16 and 32 bit application modules, compiling and link 
  969.      editing (SOM), Adding Online Help, Problem Determination, Managing 
  970.      Development, Naming conventions. 
  971.  
  972. Volume 5: Print Subsystem, GG24-3775, $5.20 
  973.      Not Available yet. 
  974.  
  975. The special part number GBOF-2254 is for all currently available volumes 
  976. (presently 1-4). 
  977.  
  978. ORDERING INFORMATION: 
  979.  
  980. The OS/2 2.x Redbooks are available from IBM's TeleServices customer support 
  981. number.  The number is 1-800-7654-IBM (1-800-765-4426).  You can pay by credit 
  982. card or mail in a check after calling.  The order will take about 2 weeks but 
  983. can be sped up by paying for faster shipping. 
  984.  
  985. You can also order the redbooks from your local IBM Branch Office library. 
  986. Some possibly useful phone numbers are included here. 
  987.  
  988.     IBM Central Library, Los Angeles CA: (213) 621-6710
  989.         P.O. Box 60737
  990.         Los Angeles, CA 90060
  991.     Canada: (800) 465-1234, ext 4205 ($33.52)
  992.     UK: (0256) 478166, (#36.51, credit cards accepted)
  993.     Australia (Victoria): 698-1234 ($46.80 A)
  994.         IBM Australia
  995.         The Library
  996.         211 Sturt Street
  997.         South Melbourne, 3205
  998.         Att: Kate Seeley
  999.     Denmark: 33 32 40 55 (dkk 310)
  1000.  
  1001.  
  1002. ΓòÉΓòÉΓòÉ 9. (5.0) Miscellaneous ΓòÉΓòÉΓòÉ
  1003.  
  1004. This section covers questions not covered in previous sections. 
  1005.  
  1006.  
  1007. ΓòÉΓòÉΓòÉ 9.1. (5.1) What is available for multimedia programming under OS/2? ΓòÉΓòÉΓòÉ
  1008.  
  1009. The OS/2 2.x Multimedia package is now available.  Call the IBM Multimedia 
  1010. office at (800) 426-9402 ext. 150. 
  1011.  
  1012.  
  1013. ΓòÉΓòÉΓòÉ 9.2. (5.2) What is available for AI/neural net programming under OS/2? ΓòÉΓòÉΓòÉ
  1014.  
  1015. LISP and XScheme are available from ftp-os2.  There are also some AI/neural net 
  1016. tools listed in tinf26.zoo. 
  1017.  
  1018.  
  1019. Related Information:
  1020.  
  1021. (1.5) What other programming languages are available for OS/2?
  1022.  
  1023.  
  1024. ΓòÉΓòÉΓòÉ 9.3. (5.3) Special software offers ΓòÉΓòÉΓòÉ
  1025.  
  1026. Here are some of the OS/2 software products that represent particularly good 
  1027. values.  Most prices do not include shipping and handling. 
  1028.  
  1029. o Borland C++ for OS/2.  Available from Below Zero in Calgary (phone 
  1030.   800-461-2777, 403-547-0669, or FAX 403-547-1018) for about $136 U.S., 
  1031.   including shipping.  Add GST in Canada.  Below Zero will export outside North 
  1032.   America. 
  1033.  
  1034. o IBM PL/I.  Not everyone is a PL/I programmer, but IBM is offering free copies 
  1035.   of Workframe/2 with every purchase and free product videos. Phone 
  1036.   800-426-3346 ext. STL10 for more information on the two packages available. 
  1037.  
  1038. (Quoted almost directly from OS/2 General FAQ) 
  1039.  
  1040.  
  1041. ΓòÉΓòÉΓòÉ 9.4. (5.4) Technical Support ΓòÉΓòÉΓòÉ
  1042.  
  1043. How can I get answers to my OS/2 questions? 
  1044.  
  1045. If your question is not answered in this List, post a note to the appropriate 
  1046. Usenet conference: 
  1047.  
  1048. Newsgroup                           Description 
  1049. comp.os.os2.apps                    carries discussions related to finding or 
  1050.                                     using any application running under OS/2 
  1051. comp.os.os2.networking              looks at networking issues 
  1052. comp.os.os2.advocacy                deals with opinions and speculation 
  1053. comp.os.os2.programmer.porting      helps programmers move applications over to 
  1054.                                     OS/2 from other operating systems and 
  1055.                                     environments 
  1056. comp.os.os2.programmer.misc         addresses anything else related to OS/2 
  1057.                                     programming 
  1058. comp.os.os2.beta                    explores beta releases of OS/2 
  1059. comp.os.os2.ver1x                   supports all releases of OS/2 prior to 
  1060.                                     Version 2.0 
  1061. comp.os.os2.announce                carries important OS/2 announcements 
  1062. comp.os.os2.bugs                    discusses possible bugs found in released 
  1063.                                     versions of the operating system 
  1064. comp.os.os2.multimedia              fosters conversation about OS/2 multimedia 
  1065.                                     (including MMPM/2), 
  1066. comp.os.os2.setup                   offers a place to talk about setup and 
  1067.                                     installation issues 
  1068.                                     comp.os.os2.misc is for any other 
  1069.                                     OS/2-related discussion 
  1070. comp.lang.rexx                      discusses REXX programming 
  1071.  
  1072. These groups are also watched closely by OS/2 experts from IBM. 
  1073.  
  1074. A LISTSERVer distributes its own OS/2 conference by mail; send a single line 
  1075. message with the word HELP to listserv@cc1.kuleuven.ac.be for full 
  1076. instructions; or send the same message to listserv@frors12.circe.fr for 
  1077. information on an unedited mailing list.  To subscribe to the Multimedia 
  1078. Presentation Manager/2, send a single line message with the phrase SUBSCRIBE 
  1079. MMOS2-L (Your Name) to mail-server@knex.via.mind.org. 
  1080.  
  1081. Your local FidoNet BBS may carry OS/2 echo conferences and/or OS2NET. If not, 
  1082. ask your system operator to join them.  CompuServe (FIND OS/2) and Prodigy are 
  1083. also excellent resources. 
  1084.  
  1085. The IBM PC Co. BBS's (modem 404-835-6600) message areas, product database, and 
  1086. PS/2 Assistant file(s) are invaluable resources. Information on the new OS/2 
  1087. BBS is included in the OS/2 2.0 package. In the United States IBM has toll free 
  1088. technical support (phone 800-237-5511), an OS/2 Hotline (general information, 
  1089. orders, upgrades, phone 800-3-IBM-OS2; ask about OS/2 videotapes, T-shirts, and 
  1090. other accessories), the HelpWare Center (phone 800-PS2-2227), a software order 
  1091. line (phone 800-IBM-CALL), two FAX information services (phone 800-IBM-4FAX 
  1092. and/or 800-IBM-3395), and an educational inquiries line (phone 800-222-7257). 
  1093. In Canada phone IBM Personal Systems Software at 800-465-1234. 
  1094.  
  1095. Any of the regular DOS or Windows resources (e.g. books, magazines, 
  1096. shareware/freeware sources) will be useful since both environments come with 
  1097. OS/2 2.0. 
  1098.  
  1099. (taken from OS/2 General FAQ) 
  1100.  
  1101.  
  1102. Related Information:
  1103.  
  1104. (5.5) Developer's Assistance Program
  1105.  
  1106.  
  1107. ΓòÉΓòÉΓòÉ 9.5. (5.5) Developer's Assistance Program (DAP) ΓòÉΓòÉΓòÉ
  1108.  
  1109. OS/2 2.0 developers should contact the IBM Developer Assistance Program (phone 
  1110. 407-982-6408); membership is free.  (You may also join on CompuServe with GO 
  1111. OS2DAP.)  The OS/2 Professional Developer's Kit CD-ROM, containing a wide 
  1112. selection of development tools and code, and the OS/2 2.1 Beta CD-ROM are both 
  1113. available from IBM (phone 800-3-IBM-OS2 to order in the United States for 
  1114. between $15 and $20 each, shipping included; in Canada, phone 800-465-1234; in 
  1115. Australia, phone Rohaini Cain or Mike Voris at 13-2426 ext. 7684; elsewhere, 
  1116. contact the International OS/2 User Group by phoning 285-641175 in the U.K.) 
  1117. The OS/2 Device Driver Development Kit CD-ROM is also now available from IBM. 
  1118. To order phone 407-982-4239 (FAX 407-982-4218) in North America, 61-2-354-7684 
  1119. (FAX 61-2-354-7766) in most of the Far East and Pacific Rim, 81-3-5563-5897 
  1120. (FAX 81-3-5563-4957) in Japan, 81-2-528-1548 (FAX 82-2-528-1414) in Korea, or 
  1121. 011-52-627-1846 (FAX 011-52-395-7812) in Latin America. 
  1122.  
  1123. (taken from the OS/2 general FAQ) 
  1124.  
  1125.  
  1126. ΓòÉΓòÉΓòÉ 10. OS/2 Software Sources ΓòÉΓòÉΓòÉ
  1127.  
  1128. The following BBSes hold large OS/2 libraries: 
  1129.  
  1130.  
  1131.  Name                      Number
  1132.  
  1133.  Fernwood                  (203) 483-0348
  1134.  
  1135.  OS/2 Shareware            (703) 385-4325
  1136.  
  1137.  Bay Area OS/2             (510) 657-7948
  1138.  
  1139.  Gateway/2                 (314) 554-9313
  1140.  
  1141.  Greater Chicago Online    (708) 895-4042
  1142.  
  1143.  OS/2 San Diego            (619) 558-9475
  1144.  
  1145.  OS/2 Las Vegas            (702) 433-5535
  1146.  
  1147.  IBM Germany               049-711-785-777
  1148.  
  1149.  IBM Denmark               45-42-88-72-22
  1150.  
  1151.  OS/2 UK                   0454-633197
  1152.  
  1153.  IBM UK                    0256-336655
  1154.  
  1155.  IBM Norway                47-66-99-94-50
  1156.  
  1157.  OS/2 Norway               47-22-38-09-49
  1158.  
  1159.  OS/2 Australia            61-2-241-2466
  1160.  
  1161. (The monthly Worldwide OS/2 BBS Listing, available from these BBSes, lists 
  1162. others.)  The IBM PC Company BBS (modem 404-835-6600) has some 
  1163. shareware/freeware as well, along with CSDs and the PS/2 Assistant (an 
  1164. invaluable resource for locating almost any sort of information on OS/2). For 
  1165. information on IBM's new OS/2 BBS phone 800-547-1283.  IBM Canada maintains 
  1166. several support BBSes: 
  1167.  
  1168.    (416) 946-4255 
  1169.    (514) 938-3022 
  1170.    (604) 664-6464 
  1171.    (416) 946-4244 
  1172.  
  1173. The Usenet conference comp.binaries.os2 carries OS/2 software.  And several 
  1174. sites are available via anonymous ftp.  (No ftp?  Send a single line message 
  1175. with the word HELP to bitftp@pucc.bitnet or ftpmail@decwrl.dec.com to learn 
  1176. about ftp mail servers.)  Some are (with Internet node numbers and 
  1177. subdirectories): 
  1178.  
  1179.  
  1180.  Site                      IP Address      Home OS/2 Directory
  1181.  
  1182.  ftp-os2.nmsu.edu          128.123.35.151  pub/os2
  1183.  hobbes.nmsu.edu
  1184.  
  1185.  software.watson.ibm.com   129.34.139.5    pub/os2
  1186.  
  1187.  mtsg.ubc.ca               137.82.27.1     os2:
  1188.  
  1189.  access.usask.ca           128.233.3.1     pub/archives/os2
  1190.  
  1191.  luga.latrobe.edu.au       131.172.2.2     pub/os2
  1192.  
  1193.  funic.funet.fi            128.214.6.100   pub/os2
  1194.  
  1195.  pdsoft.lancs.ac.uk        148.88.64.2     micros/ibmpc/os2
  1196.  
  1197.  ftp.uni-stuttgart.de      129.69.1.12     soft/os2
  1198.  
  1199.  src.doc.ic.ac.uk          146.169.2.1     computing/systems/os2
  1200.  
  1201.  zaphod.cs.uwindsor.ca     137.207.224.3   pub/local/os2
  1202.  
  1203.  ftp.luth.se               130.240.18.2    pub/pc/os2
  1204.  
  1205. The ftp-os2.nmsu.edu library is available on CD-ROM from Walnut Creek (phone 
  1206. 510-947-5996).  EMS (phone 301-924-3594) offers an OS/2 shareware/freeware 
  1207. library on diskette. 
  1208.  
  1209. Other sources include CompuServe (FIND OS/2) and archive servers (send a single 
  1210. line message with the word HELP to listserv@cc1.kuleuven.ac.be or 
  1211. mail-server@rus.uni-stuttgart.de for more information, or use ftp). TRICKLE 
  1212. servers are also available outside the United States.  For more information on 
  1213. TRICKLE services, including automatic file subscription procedures, send a 
  1214. single line message with the word HELP to any one of the following sites 
  1215. nearest you: 
  1216.  
  1217. Country      Address 
  1218. Austria      TRICKLE@AWIWUW11.BITNET 
  1219. Belgium      TRICKLE@BANUFS11.BITNET 
  1220. Colombia     TRICKLE@UNALCOL.BITNET 
  1221. France       TRICKLE@FRMOP11.BITNET 
  1222. Germany      TRICKLE@DEARN.BITNET 
  1223. Israel       TRICKLE@TAUNIVM.BITNET 
  1224. Italy        TRICKLE@IMIPOLI.BITNET 
  1225. Netherlands  TRICKLE@HEARN.BITNET 
  1226. Sweden       TRICKLE@SEARN.BITNET 
  1227. Turkey       TRICKLE@TREARN.BITNET 
  1228.              TRICKLE@TRMETU.BITNET 
  1229.  
  1230. IBM has been releasing freely distributable employee written software (e.g. 
  1231. Visual REXX) and OS/2 patches to these sites. 
  1232.  
  1233. (The previous was taken almost verbatim from the OS/2 General FAQ) 
  1234.  
  1235.  
  1236. ΓòÉΓòÉΓòÉ 11. Bugs / Obtaining this FAQ / Contacting the Author ΓòÉΓòÉΓòÉ
  1237.  
  1238. Reporting Bugs and Errors in the FAQ 
  1239.  
  1240. With the advent of all this nifty hypertext IPF stuff, there are bound to be 
  1241. bugs and errors in this FAQ, simply by Murphy's Law.  (Anything that can go 
  1242. wrong, will go wrong)  If you find an error, however, insignificant, please 
  1243. send me a note (through one of the ways listed below) telling me what's wrong 
  1244. with the FAQ. 
  1245.  
  1246. Obtaining this FAQ 
  1247.  
  1248. This FAQ is distributed on a regular basis to: 
  1249.  
  1250.  1. ftp-os2.nmsu.edu on the Internet 
  1251.  2. IBM PCC BBS in Atlanta, GA 
  1252.  3. Information Overload in Atlanta, GA (1:133/308 FidoNet, 81:120/103 OS2Net) 
  1253.  
  1254. All other sites should receive this FAQ on a trickle-down basis from these 
  1255. sites. 
  1256.  
  1257. This FAQ is distributed in two versions, ASCII and INF.  The INF version is 
  1258. binary and viewable only by the VIEW.EXE program that comes with OS/2.  The 
  1259. filename is PFAQnnIN.ZIP, where 'nn' is the FAQ version.  The ASCII version is 
  1260. text and is viewable by any program that can view text (which includes most 
  1261. word processors).  The filename is PFAQnnAS.ZIP, where 'nn' is the FAQ version. 
  1262.  
  1263. Contacting the Author 
  1264.  
  1265. I can be contacted in a multitude of ways: 
  1266.  
  1267. o Internet.  This is the preferred method.  E-mail me at jgarzik@nyx.cs.du.edu. 
  1268.   You may see me posting from one of my two Georgia Tech accounts, 
  1269.   gtd543a@cc.gatech.edu and gtd543a@prism.gatech.edu.  Don't be alarmed.  I 
  1270.   have my mail forwarded. I ask people to e-mail me at nyx because my account 
  1271.   there is permanent. My account at GT is contingent on my staying at Tech.  I 
  1272.   lose it when I either get kicked out or graduate. 
  1273.  
  1274. o FidoNet.  I check this one at least one or twice a week. 
  1275.   Jeff Garzik@1:133/103 FidoNet or Jeff Garzik@81:120/103 OS2NET.  This account 
  1276.   is contingent on my staying in Atlanta.  Which I plan to for quite some time. 
  1277.  
  1278. o US Postal Service.  This will stay while I am at Tech also. 
  1279.  
  1280.    Jeff Garzik 
  1281.    25861 Georgia Tech Station 
  1282.    Atlanta, GA  30332 
  1283.  
  1284. o Face to face.  This is the toughest, because no one knows what I look like 
  1285.   and most people reading this FAQ don't hang out at Tech for fun.  (I know I 
  1286.   wouldn't!)  But the next time you are in Atlanta, GA, if you see a 6' guy 
  1287.   with a goatee and a punk rock t-shirt, don't hesitate to ask if it's me... 
  1288.  
  1289.  
  1290. ΓòÉΓòÉΓòÉ 12. Credits ΓòÉΓòÉΓòÉ
  1291.  
  1292. The following people have contributed in numerous and not-so-numerous ways to 
  1293. this document to make it what it is today, and what it will be tomorrow.  Give 
  1294. a big round of applause for... 
  1295.  
  1296. o Barry Jaspan <bjaspan@athena.mit.edu> 
  1297. o Jeff Garzik <jgarzik@nyx.cs.du.edu> 
  1298. o Byers R E James <zoorejb@nusunix2.nus.sg> 
  1299. o Stefan Gruendal <Stefan_Gruendel@wue.maus.de> 
  1300. o Raja Thiagarajan <sthiagar@bronze.ucs.indiana.edu> 
  1301. o Larry Saloman <os2man@panix.com> 
  1302. o Timothy Sipples <sip1@ellis.uchicago.edu> 
  1303.  
  1304. Ok, so the list is a little short right now.  If you contributed to Barry's FAQ 
  1305. and you are not listed here, then please send me your name and I'll be glad to 
  1306. include you in this list. 
  1307.  
  1308. I have obtained some information from sources other than people also. Besides 
  1309. being credited above, here is another list: 
  1310.  
  1311. o OS/2 Frequently Asked Questions List v2.0l  (Available from ftp-os2 in 
  1312.   /pub/os2/all/info/faq/faq20l.zip) 
  1313.  
  1314. o Electronic Developers' OS/2 Magazine  (Available from ftp-os2 in 
  1315.   /pub/os2/all/info/edmi/*) 
  1316.