home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / docs / devcon1.inf (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1993-10-12  |  209.5 KB  |  2,998 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Cover ΓòÉΓòÉΓòÉ
  3.  
  4. The Developer Connection News 
  5.  
  6. The Developer Connection for OS/2  Γûá  Volume 1 
  7.  
  8. "The complete source of information for all of your OS/2 development efforts." 
  9.  
  10.  
  11. ΓòÉΓòÉΓòÉ 2. Publisher's Note ΓòÉΓòÉΓòÉ
  12.  
  13. The Developer Connection News 
  14. August 1993 
  15. Volume 1 
  16. Number 1 
  17.  
  18. Publisher                                    Barbara Britt 
  19.  
  20. Editor, The Developer Connection News        Stacey Miller 
  21.  
  22. Editorial Advisor                            Suzanne Gagnon 
  23.  
  24. Technical Advisors                           David Kenner, Jay Tunkel 
  25.  
  26. Art Director                                 Brian Black 
  27.  
  28. The Developer Connection News is published quarterly by the Personal Systems 
  29. Line of Business of International Business Machines Corp., Boca Raton, Florida, 
  30. U.S.A., Stacey Miller, Editor.  The terms OS/2, OS/2 2.0, and OS/2 2.1 are used 
  31. in this publicatio n as abbreviations for the full term OS/2 operating system. 
  32. OS/2 is a registered trademark of the IBM Corporation. Titles and abstracts, 
  33. but no other portions, of information may be copied and distributed by 
  34. computer-based and other information service systems. Permission to republish 
  35. information from this publication in any other publication of computer-based 
  36. information systems must be obtained from the Editor. 
  37.  
  38. IBM believes the statements contained herein are accurate as of the date of 
  39. publication of this document.  All specifications are subject to change without 
  40. notice.  However, IBM, hereby disclaims all warranties, either expressed or 
  41. implied, including with out limitation any implied warranty of merchantability 
  42. or fitness for a particular purpose.  In no event will IBM be liable to you for 
  43. any damages, including any lost profits, lost savings, or other incidental or 
  44. consequential damage arising out of the u se or inability to use any 
  45. information provided through this publication even if IBM has been advised of 
  46. the possibility of such damages, or for any claim by any other party. 
  47.  
  48. Some states do not allow the limitation or exclusion of liability for 
  49. incidental or consequential damages so the above limitation or exclusion may 
  50. not apply to you. 
  51.  
  52. This publication may contain technical inaccuracies or typographical errors. 
  53. Also, illustrations contained here may show prototype equipment.  Your 
  54. configuration may differ slightly. 
  55.  
  56. This publication may contain articles by non-IBM authors.  These articles 
  57. represent the views of their authors.  IBM does not endorse any non-IBM 
  58. products that may be mentioned.  Questions should be directed to the authors. 
  59.  
  60. This information is not intended to be an assertion of future action.  IBM 
  61. expressly reserves the right to change or withdraw current products that may or 
  62. may not have the same characteristics or codes listed in this publication. It 
  63. is possible that this material may contain reference to, or information about, 
  64. IBM products (machines and programs), programming or services that are not to 
  65. be construed to mean that IBM intends to announce such products, programming, 
  66. or services in your country. 
  67.  
  68. IBM takes no responsibility whatsoever with regard to the selection, 
  69. performance, or use of the products advertised herein.  All understanding, 
  70. agreements, or warranties must take place directly between the software vendors 
  71. and perspective users. 
  72.  
  73. To correspond with the IBM Developer Connection News, please write to the 
  74. Editor at IBM Corp., PO Box 1328, Internal ZIP 1510, Boca Raton, Florida 33431. 
  75. IBM may use or distribute any of the information you supply in any way it 
  76. believes appropriate without incurring any obligation whatever. 
  77.  
  78. IBM, OS/2, PS/2, Micro Channel, Presentation Manager, Workplace Shell, AS/400, 
  79. and ES/3090 are registered trademarks of IBM Corp. 
  80.  
  81. AIX, C/2, CUA, SAA, WIN-OS/2, AS/400, ES/390, AS/400, C Set/2, WorkSet/2, 
  82. WorkFrame/2 , Pen for OS/2, MMPM/2, and Multimedia Presentation Manager/2, 
  83. Ultimotion, and M-Audio Capture are trademarks of IBM Corp. 
  84.  
  85. MS-DOS and Code View are registered trademarks of Microsoft Corp. 
  86.  
  87. CompuServe is a registered trademark of CompuServe Incorporated. 
  88.  
  89. UNIX is a registered trademark of AT&T Bell Laboratories. 
  90.  
  91. Apple and Macintosh are registered trademarks, and System 7 is a trademark of 
  92. Apple Computer, Inc. 
  93.  
  94. Borland is a registered trademark of Borland International, Inc. 
  95.  
  96. Intel, DVI, Indeo, and Pentium are registered trademarks of Intel Corporation. 
  97.  
  98. SmallTalk is a trademark of the Digitalk Corporation. 
  99.  
  100. HockWare and VisPro/REXX are trademarks of HockWare, Inc. 
  101.  
  102. WATCOM and Vx_Rexx are trademarks of WATCOM. 
  103.  
  104. Kurta is a trademark of Kurta Corporation. 
  105.  
  106. Wacom is a trademark of Wacom Co., Ltd. 
  107.  
  108. Hitachi is a trademark of Htachi Ltd. 
  109.  
  110. NEC is a trademark of NEC Corporation. 
  111.  
  112. Panasonic is a trademark of Matsushita Electric Industrial Co., Ltd. 
  113.  
  114. Pioneer is a trademark of Sony Corporation. 
  115.  
  116. Toshiba is a trademark of Toshiba Corporation. 
  117.  
  118. Future Domain is a trademark of Future Domain Corporation. 
  119.  
  120. Adaptec is a trademark of Adaptec, Inc. 
  121.  
  122. Kodak is a trademark of Eastman Kodak Company. 
  123.  
  124. Taligent is a trademark of Taligent, Inc. 
  125.  
  126.  
  127. ΓòÉΓòÉΓòÉ 3. IBM Ships Premiere Issue of The Developer Connection for OS/2 ΓòÉΓòÉΓòÉ
  128.  
  129. by David Kenner 
  130.  
  131. Welcome to The Developer Connection for OS/2!  Your participation in this 
  132. program ensures that you'll receive the latest and the best in development 
  133. information from IBM's own OS/2 development team.  But not just information, 
  134. The Developer Connection for OS/2 is a real product.  On the CD-ROM,  look for 
  135. internal, pre-release tools, APIs, sample code, and pre-release versions of the 
  136. new operating system technologies. 
  137.  
  138.  
  139. ΓòÉΓòÉΓòÉ 3.1. So How Did It Begin? ΓòÉΓòÉΓòÉ
  140.  
  141. It all began about a year ago, as a group of OS/2 developers asked themselves, 
  142. "How can we make a difference?  What is needed?"  They asked those questions at 
  143. the technical conferences, and really listened to the responses.  You said you 
  144. needed tools, samples of code, APIs, and accurate information.  You said you 
  145. needed it delivered on a regular basis, so you could have access to the latest 
  146. and the best.  This team brainstormed and came up with a product called the 
  147. Professional Developer Kit (or the PDK).  They delivered it at multiple OS/2 
  148. technical conferences. The response was overwhelmingly positive. You liked what 
  149. you saw, and we liked answering your needs. 
  150.  
  151. The  PDK has since matured into a new product, The Developer Connection for 
  152. OS/2.  And that small team has also grown.  Over 18 folks in Boca Raton 
  153. participated in this release of the Developer Connection (and that number keeps 
  154. growing).  Our colleagues at the IBM Labs in Vienna, Austria and Santa Teresa, 
  155. California also helped in the direct development.  So, the development of The 
  156. Developer Connection for OS/2 really was a worldwide team effort. 
  157.  
  158.  
  159. ΓòÉΓòÉΓòÉ 3.2. What Exactly Do You Get? ΓòÉΓòÉΓòÉ
  160.  
  161. Each CD-ROM contains a powerful search browser that lets you, with the click of 
  162. a mouse, locate any desired piece of information.  It's front-end is an 
  163. easy-to-use GUI.  Each item on the CD-ROM is catalogued into a specific 
  164. category.  When you want to see the contents of that category all you need to 
  165. do is select it. The category expands, allowing you to view its contents. 
  166.  
  167. The premiere issue of the CD-ROM is particularly exciting as it contains a 
  168. limited-use demo copy of OS/2 2.1, a demo of IBM's GIK/2 (a toolkit for the 
  169. graphical representation and manipulation of data),  many internal IBM tools 
  170. that previously were unavaiable, plus many other tools and products.  As new 
  171. versions of OS/2 become available, we plan to include them on subsequent issues 
  172. of the CD-ROM. 
  173.  
  174. But the CD-ROM doesn't stop there, it includes the complete reference library 
  175. for OS/2 2.1 Toolkit, as well as the technical documentation for the Multimedia 
  176. and Pen for OS/2 products. 
  177.  
  178.  
  179. ΓòÉΓòÉΓòÉ 3.3. The Developer Connection News ΓòÉΓòÉΓòÉ
  180.  
  181. The Developer Connection News is your source for fast-breaking, 
  182. up-to-the-minute information.  This month, we feature Future Directions and 
  183. Strategy columns by Sam Kahn and Paul Giangarra.  You might also want to browse 
  184. the articles from Borland, HockWare, and WATCOM to learn about some of the 
  185. latest OS/2 applications. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 3.4. Summary ΓòÉΓòÉΓòÉ
  189.  
  190. So, turn on your  computer, insert the CD-ROM, and enjoy.  This is your 
  191. product, it was designed by developers for developers.  And, we believe it 
  192. really will give you The power of the future... delivered to your door. 
  193.  
  194.  
  195. About the Author 
  196.  
  197. David Kenner has been with IBM since 1990 and is currently the Project Lead for 
  198. The  Developer Connection for OS/2.   David has had many different roles at 
  199. IBM, including working on the OS/2 Toolkit, Virtual Device Driver Design, and 
  200. OS/2 Install.  Before joining IBM, David was a computer consultant. 
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ 4. Workplace OSs: Doors to the Future ΓòÉΓòÉΓòÉ
  204.  
  205. by Paul Giangarra 
  206.  
  207. The Workplace Operating Systems (Workplace OSs) will change the way you think 
  208. about your computer.  They're  a whole new concept in operating system 
  209. architecture.  By unifying the worlds of multiple operating systems, and 
  210. providing a new base for common services, scalable and flexible systems are 
  211. born. Workplace OSs protect your current investment, as well as bring you into 
  212. the future.  A key feature of Workplace OSs is their support for 32-bit 
  213. applications. 
  214.  
  215. With the roll-out of OS/2 2.1, we have provided you with a true 32-bit 
  216. operating system that extends the features of OS/2 2.0 by providing significant 
  217. new features.  OS/2 2.1 truly takes advantage of the capabilities of the 
  218. increased power of the new generations of Intel-based processors, including 
  219. Pentium. 
  220.  
  221. Having chosen OS/2, what exactly do you get?  You get the bestselling 32-bit 
  222. operating system.  This is because your operating system is designed to handle 
  223. the increased requirement of complex programs, such as multitasking and 
  224. object-oriented programming (OOP).  You are also working in a protected 
  225. environment, so if one application fails, the system continues to function. 
  226.  
  227. Internally, OS/2 provides support for even more including, but not limited to, 
  228. the following: 
  229.  
  230. o Preemptive multitasking so you can run several programs at one time. 
  231.  
  232. o A protection model that isolates the operating system from errant 
  233.   applications, as well as applications from each other. 
  234.  
  235. o A System Object Model (SOM) that provides a language-neutral mechanism for 
  236.   object management services. 
  237.  
  238. o A Workplace Shell, implemented on SOM, that provides a powerful, 
  239.   object-oriented user interface. 
  240.  
  241. o Dynamic link libraries (DLLs) that allow for interchangeable software 
  242.   components. 
  243.  
  244. o A 32-bit presentation driver model that lets you add and install such items 
  245.   as printers and displays, as needed, and without a needing a complete 
  246.   reinstallation. 
  247.  
  248. o Installable file systems that allow the addition of new types of file 
  249.   systems, such as CD-ROMs. 
  250.  
  251. o Multimedia audio and video players. 
  252.  
  253. In addition, OS/2 can support the enterprise-wide, LAN-based client/server 
  254. applications of the future, such as SQL databases, CICS, and REXX.  OS/2 2.1 
  255. continues to be IBM's mainstream desktop offering for Intel x386 and 80x86 
  256. processors and will continue to be enhanced and optimized for that platform. 
  257.  
  258.  
  259. ΓòÉΓòÉΓòÉ 4.1. What Lies Ahead? ΓòÉΓòÉΓòÉ
  260.  
  261. What lies ahead are exciting, new technologies that we are ready to exploit. 
  262. Some of these technologies include: 
  263.  
  264. o New hardware architecture and platforms that will provide a significant 
  265.   increase in computing power 
  266.  
  267. o Object-oriented programming that results in productivity gains making it 
  268.   possible to fully exploit the power and features of this new hardware 
  269.  
  270. o New devices, such as speech, wireless, and enhanced video, that will provide 
  271.   exciting and new functions 
  272.  
  273. So how do we get to this future?  We are developing a new operating system 
  274. foundation that will take advantage of all these emerging technologies. It will 
  275. include features, such as a higher security level and the use of multiple 
  276. processors (MP). 
  277.  
  278. This operating system foundation will let you move forward to the future, while 
  279. preserving your current investment. 
  280.  
  281. Figure 1.  Doors to the future 
  282.  
  283.  
  284. ΓòÉΓòÉΓòÉ 4.2. And What Is That New Operating System? ΓòÉΓòÉΓòÉ
  285.  
  286. Workplace OSs are the operating systems that will prepare you for the future. 
  287. Taking the  best, most elegant features of multiple operating systems, 
  288. Workplace OSs combine them with the flexibility to run on unlimited platforms. 
  289.  
  290. Workplace OSs do not replace OS/2; rather, they compliment OS/2 by providing 
  291. for: 
  292.  
  293. o More applications than any other operating system 
  294. o Increased and varied hardware support 
  295. o Open system architecture providing for increased potential in a scalable 
  296.   environment 
  297. o Increased quality and flexibility 
  298.  
  299. The products that make up Workplace OSs are: 
  300.  
  301. o The IBM Microkernel 
  302. o Common (cross-personality) services 
  303. o Multiple personalities 
  304.  
  305.  
  306. ΓòÉΓòÉΓòÉ 4.2.1. The IBM Microkernel ΓòÉΓòÉΓòÉ
  307.  
  308. The IBM Microkernel provides the base mechanisms required for building 
  309. operating systems.  It is not tied to any operating system-specific functions. 
  310.  
  311. The Microkernel is pure, simple, and minimal.  It isolates all the critical, 
  312. machine-dependent services from the operating environments outside of it. 
  313. Operating environment policies are set by the operating environment 
  314. personality. 
  315.  
  316. The Microkernel is based on Carnegie Mellon University's (CMU's) Mach 
  317. technology that provides for: 
  318.  
  319. o Task management (tasks, threads, and dispatching) 
  320.  
  321. o Interprocess communications (IPC) 
  322.  
  323. o Memory management 
  324.  
  325. o Interrupt management 
  326.  
  327. The Microkernel does not enforce policy; rather, it executes whatever policy is 
  328. set externally.  Using Microkernel technology greatly enhances the value of 
  329. Workplace OSs.  The Microkernel embraces future technology by providing for the 
  330. current 32-bit technology, but allowing for 64-bit and beyond extensibility. It 
  331. provides for flexibility, integrity, and scalability. The design of the 
  332. Microkernel encourages modular client/server design; therefore, reducing 
  333. complexity. 
  334.  
  335. Figure 2.  The Workplace look 
  336.  
  337. Each point of control within the Microkernel is a thread having access to all 
  338. of the elements in the task that contains it.  A task is a container for the 
  339. system resources for the threads contained within it.  A task does not have a 
  340. life of its own...it is governed by the threads it contains.  Only threads can 
  341. execute instructions.  All threads contained in a specific task share all of 
  342. that task's resources.  Tasks exist as separate entities; for example, they 
  343. cannot share any resources without taking explicit action. Tasks resemble UNIX 
  344. processes and, in fact, are the mechanisms by which UNIX processes are created 
  345. by the UNIX personality. 
  346.  
  347. Each task contains an associated memory map that is also known as an address 
  348. space.  As with most virtual memory systems, a mechanism must exist to use 
  349. physical memory as a cache for the virtual addresses of tasks. Because this is 
  350. a generic Microkernel, the operating system personalities must participate in 
  351. this mechanism.  The Microkernel's memory management provides the mechanisms of 
  352. memory objects and functions to manipulate all this. Mach IPC (ports) manage 
  353. client/server communication.  The requesting thread (client) accesses services 
  354. by sending messages to the owning task (servers).  These messages are sent over 
  355. communication channels, called ports. 
  356.  
  357. Mach provides first level interrupt management services that rely on device 
  358. support to provide specific second level interrupt handlers.  The Microkernel 
  359. sees the device drivers as tasks and threads that are external to itself. The 
  360. device drivers can inject interrupt handlers into the Microkernel, where 
  361. necessary. 
  362.  
  363.  
  364. ΓòÉΓòÉΓòÉ 4.3. Common (Cross-Personality) Services ΓòÉΓòÉΓòÉ
  365.  
  366. Common services include default paging services, security, device driver 
  367. frameworks, and file servers. 
  368.  
  369. The file server framework provides support for multiple, installable file 
  370. systems and conforms to the industry-standard VNODE interface.  The file server 
  371. also provides memory-mapped file support and allows for logical volume 
  372. management.  The device driver framework provides for hardware resource 
  373. management and a common framework to build base device drivers.  Interrupt 
  374. service routines (ISRs) get interrupts from first-level Microkernel interrupt 
  375. management and reflect interrupts to the device drivers that are executing in 
  376. user space.  The default pager handles page faults that are reflected by the 
  377. Microkernel. 
  378.  
  379.  
  380. ΓòÉΓòÉΓòÉ 4.4. Multiple Personalities ΓòÉΓòÉΓòÉ
  381.  
  382. External to the Microkernel and common services are personalities that provide 
  383. the specific services for the operating systems.  Personalities are actually 
  384. application loaders and launchers.  They let you run operating system-specific 
  385. applications on multiple operating systems.  Personality specific services work 
  386. with the personality server and personality neutral services to map application 
  387. requests to the correct services with the proper semantics. 
  388.  
  389. Personalities reflect particular operating environments, such as UNIX, DOS, 
  390. OS/2, and more.  You can run one or more of these person alities on top of the 
  391. Microkernel and the common services.  You can choose which personality is 
  392. dominant and which personality is alternate.  The dominant personality provides 
  393. the look and feel of the system (that is, the user interface).  It provides the 
  394. default runtime semantics, as well as the runtime and execution environment. 
  395. The alternate personalities will respond to a set of requests from the dominant 
  396. personality. For example, the UNIX dominant personality looks to the other 
  397. personalities to recognize, load, and launch anything other then an UNIX 
  398. application. However, the UNIX personality will handle all UNIX applications 
  399. itself. 
  400.  
  401. So, whatever your dominant personality is, your operating systems will look 
  402. just like your system does today.  Adding alternate personalities will grant 
  403. you the enhanced flexibility of running additional operating system 
  404. applications, such as UNIX. 
  405.  
  406.  
  407. ΓòÉΓòÉΓòÉ 4.5. So, What Does All This Mean to Me? ΓòÉΓòÉΓòÉ
  408.  
  409. What this means to you, as a developer, is that using multiple personalities, 
  410. you are going to have a flexible environment in which you can run not just one, 
  411. but multiple applications across system platforms.  It also means that you will 
  412. be able to develop and test different flavors of your application on one 
  413. machine in a uniform programming environment. 
  414.  
  415. And, each personality will share a common look and feel...the Workplace Shell 
  416. look.  Workplace OSs are your key to a whole new level of computing. This 
  417. reason is why they are your door to the future. 
  418.  
  419.  
  420. About the Author 
  421.  
  422. Paul Giangarra has been with IBM since 1977 and is currently a member of IBM's 
  423. Senior Technical Staff.  Paul has had many different roles at IBM, including 
  424. Chief Designer for OS/2 during OS/2 1.2, OS/2 1.3, and OS/2 2.0.  He is 
  425. currently Lead Architect for Workplace OS.  Paul is a member of the PSP Line of 
  426. Business Software Architecture board. 
  427.  
  428.  
  429. ΓòÉΓòÉΓòÉ 5. An Open Letter from the Publisher and Product Manager of The Developer Connection for OS/2 ΓòÉΓòÉΓòÉ
  430.  
  431. This CD-ROM and Newsletter  mark the  kick off of The Developer Connection for 
  432. OS/2 product.  My team and  I are dedicated to providing tools, information, 
  433. and the latest pre-release products to you.  As Product Manager for The 
  434. Developer Connection for OS/2, I am dedicated to providing you with the best 
  435. possible tools for developing applications, the latest information to help you 
  436. develop applications that exploit new functions on the operating system, and 
  437. pre-release products of new operating system functions.  We believe that being 
  438. a member of The Developer Connection will give you a tremendous edge in 
  439. creating your OS/2 applications. 
  440.  
  441. In The Developer Connection News, you will find technical articles about the 
  442. latest strategic directions for Personal Software Products (PSP) Operating 
  443. Systems.  You will learn about the importance of Microkernel technology, and 
  444. how it will let you port your applications across multiple platforms.  You will 
  445. also hear directly from the developers of OS/2 and future technologies.  They 
  446. will be providing you with technical information about features in the 
  447. operating system, as well as programming tips and techniques. 
  448.  
  449. Because this product is for you, your feedback is critical to our success. I 
  450. would like to hear your comments on our program.  Tell us the types of articles 
  451. you would like to see in the Newsletter and the types of tools and information 
  452. you need on the CD-ROM.  We promise to go out there and do what we can to 
  453. deliver them to you.  If we can do it, we will! Our goal is to make your job 
  454. easier.  So let us know what we're doing right; but maybe even more 
  455. importantly, let us know if we need to change. 
  456.  
  457. I hope you enjoy using this product as much my team and I have had in 
  458. delivering it to you! 
  459.  
  460. Sincerely, 
  461.  
  462. Barbara  J. Britt 
  463.  
  464. Barbara J. Britt 
  465.  
  466. Product Manager 
  467.  
  468. OS/2 Software Development Tools 
  469.  
  470.  
  471. About Barbara: 
  472.  
  473. Brarbara Britt has been with IBM since 1984 and is currently the Product 
  474. Manager for OS/2 Software Development Tools, which includes the OS/2 Toolkit, 
  475. Device Driver Source Kit for OS/2, and The Developer Connection for OS/2. 
  476. Barbara has had many different roles at IBM, from Programming positions to 
  477. various Software Development Management positions. 
  478.  
  479.  
  480. ΓòÉΓòÉΓòÉ 6. A Snapshot of the IBM Personal Operating Systems Strategy ΓòÉΓòÉΓòÉ
  481.  
  482. by Sam Kahn 
  483.  
  484. As OS/2 developers, you are likely to be rolling out your own applications that 
  485. exploit OS/2 2.1.  These applications might range from personal productivity 
  486. and vertical applications developed for resale, to internally developed 
  487. line-of-business applications for large enterprises. 
  488.  
  489. At the same time, we are all making investment decisions on our next wave of 
  490. products.  This article is intended to be a brief description of the IBM 
  491. Personal Operating System (POS) decisions with respect to OS/2 2.x, the 
  492. microkernel-based Workplace Operating Systems (Workplace OSs), and Taligent. 
  493. IBM is keenly interested in how you're planning to invest in its platforms, 
  494. versus other current and emerging alternatives. 
  495.  
  496. All of us are making these decisions in tight economic times and in an 
  497. environment of fierce competition; so we both need an investment strategy that 
  498. balances our immediate and long-term needs. 
  499.  
  500. We are investing in enhancements to OS/2 2.x because that is where the largest 
  501. immediate opportunity is. At the same time, we recognize that RISC 
  502. price/performance will soon make it very attractive in the PC market, and that 
  503. Intel architecture products are becoming much more powerful and are driving 
  504. into the workstation market.  We need an operating system base that wil let our 
  505. customers take advantage of both RISC and CISC (Intel) architectures.  The 
  506. Microkernel-based Workplace OSs will be our solution. 
  507.  
  508. However, Microkernel and related technologies provide much more than just 
  509. portability.  They enable a new level of modularity within the operating 
  510. systems that dramatically reduces the overall system complexity.  They will let 
  511. us be more responsive to our customers at an affordable development expense; 
  512. and allow other vendors to more easily add or enhance parts of the operating 
  513. system, such as device drivers, file systems, emulators, and much more. 
  514.  
  515. We have featured OS/2 as The Integrating Platform, based on its ability to run 
  516. OS/2 2.x, OS/2 1.x, DOS, and Windows applications concurrently. At the same 
  517. time, we are recommending that all OS/2 applications be fully 32-bit to take 
  518. full native advantage of both RISC and Intel 32-bit architectures.  We also 
  519. encourage you to consider moving or creating functions as Personality Neutral 
  520. Servers. This lets your code run directly on the Microkernel, and be 
  521. independent of the operating system (personality).  One way to think of this 
  522. environment is the notion of client/server within a single system. This has 
  523. some obvious advantages for applications such as databases, which service users 
  524. in one or more application environments.  Other applications, such as key 
  525. functions of a spreadsheet package or word processor, can be separated as 
  526. servers that operate asynchronously and are independent of the user interface. 
  527. These portions of applications are good candidates for Personality Neutral 
  528. Servers, while the user interface itself runs in the personality and conforms 
  529. to its style. 
  530.  
  531. As IBM concentrate on the internal structure of Workplace OSs, we also must 
  532. concentrate on user-visible functions.  IBM is investing heavily in object 
  533. technology, because it has reached a level of maturity where it can contribute 
  534. very significantly to both application development productivity and end-user 
  535. ease of use.  We are currently in Beta test with enhancements to our System 
  536. Object Model (SOM), frameworks, class libraries, and a visual builder.  We will 
  537. enhance our offerings in stages over the next 12 -18 months with technology 
  538. developed by Taligent. 
  539.  
  540. We are focused on two complementary, but distinct, directions in exploiting 
  541. object technology.  We are expanding the object-oriented infrastructure by 
  542. extending SOM to be distributed (DSOM), to be CORBA compliant, and support more 
  543. languages.  We're working with major players in the industry to develop an 
  544. industrial-strength, full-function, interapplication communication vehicle. 
  545.  
  546. At the same time, we will deliver frameworks and class libraries that provide a 
  547. dramatic increase in productivity for today's applications and the tools to 
  548. develop tomorrow's more sophisticated applications, such as 
  549. cooperative/collaborative computing and true client/server computing. 
  550.  
  551. This high-function object layer and its prerequisite infrastructure will be 
  552. delivered on many, if not all, of the operating system platforms that can 
  553. effectively support it.  These will include, but not be limited to, OS/2 2.x, 
  554. Workplace OSs, AIX, and other flavors of UNIX. 
  555.  
  556. In parallel, Taligent is developing a fully object-oriented system in contrast 
  557. to the layered approach just described.  We in POS are developing the 
  558. capability to run current and future OS/2 2.x 32-bit applications concurrently 
  559. with native Taligent applications. 
  560.  
  561. We're also continuing to look at ways to help you port source code to or from 
  562. other platforms to reduce your overall development expense, while at the same 
  563. time allowing you to optimize your applications for the unique capabilities of 
  564. our products. 
  565.  
  566. We're continuing to build on DOS for small systems and emerging form-factors or 
  567. devices, such as Personal Digital Assistants (PDAs).  We're investing in a 
  568. number of areas within Multimedia such as, compression and decompression 
  569. algorithms, authoring tools, servers for time-dependent media (such as, motion 
  570. video with synchronized audio), and much more.  We're also investing in Pen- 
  571. and Speech-Recognition technologies.  We're enhancing our support for various 
  572. forms of clients and native system management; and integrating them with 
  573. products developed by our colleagues in LAN systems, in order to provide a 
  574. complete foundation for the next generation of client/server applications. 
  575.  
  576. Now, given what I've told you about our strategy, what are your key decisions? 
  577. The first is how much to continue to invest in our platforms.  We hope that the 
  578. combination of our success with OS/2 2.x and our strategy lead you to the 
  579. conclusion that continued investment is an excellent business decision.  You 
  580. also must decide on how quickly you want to shift your development emphasis 
  581. from procedural to object.  We believe that the benefits of object-oriented 
  582. development will be compelling, and that we can offer you the best technology 
  583. in the industry.  But, we recognize that developers will adopt object 
  584. technology at varying rates.  So we'll continue to offer and enhance the best 
  585. 32-bit APIs in the industry. 
  586.  
  587. We believe that this strategy will deliver the best combination of short- and 
  588. long-term value to our current and potential customers, investment partners 
  589. like yourselves, and us.  We hope that you agree and will continue to make the 
  590. appropriate complement ary investments to share in its success. 
  591.  
  592.  
  593. About the Author 
  594.  
  595. Sam Kahn has been with IBM since 1967 and is currently the Manager of Strategy 
  596. and Technology, where he is responsible for strategy, Workplace OSs, and being 
  597. the Taligent interface.  Sam has had many different roles at IBM, including 
  598. project management in the DB2 and Callpath areas.  In the mid-1980's, Sam was a 
  599. member of the IBM Corporation Technical Committee that concentrated on future 
  600. directions. 
  601.  
  602.  
  603. ΓòÉΓòÉΓòÉ 7. Pen for OS/2 ΓòÉΓòÉΓòÉ
  604.  
  605. by Judy Schwait 
  606.  
  607. Pen for OS/2 (Pen) is a system-software extension to the IBM OS/2 2.1 operating 
  608. system that provides support for the pen as an input device in the desktop and 
  609. portable computing arenas.  With a Workplace Shell interface, Pen uses 
  610. Presentation Manager (PM) for pen-based input and recognition 
  611.  
  612. Pen currently supports pen digitizers from Kurta, Wacom, and Calcomp that are 
  613. designed for using the pen as the primary input device.  Pen for OS/2 has 
  614. complete mouse emulation for use with OS/2 and existing applications. 
  615.  
  616. Pen for OS/2 offers the pen as the primary source of input; however, Pen will 
  617. support existing applications, without modification.  This is done through the 
  618. Pen C ompatibility Layer.  The Compatibility Layer maps the pen movement to an 
  619. event, such as a mouse or keyboard.  The set of applications that were not 
  620. designed for use with the pen are called pen-unaware.  Compatibility support is 
  621. provided for OS/2, DOS, and Windows sessions in a PM environment. 
  622.  
  623. With the pen, you use gestures, which are sets of points that are translated 
  624. into specific commands or command sequences.  Pen contains predefined gestures 
  625. or lets you customize gestures. 
  626.  
  627. Pen-aware and pencentric applications take advantage of the new controls, APIs, 
  628. and messages defined in the Pen for OS/2 Developer's Toolkit.  A developer can 
  629. use the Pen functions to various degrees.  Minimally, a developer can create a 
  630. pen-aware application, using Pen to detect gestures or pen proximity in their 
  631. application development.  For a full-blown pencentric application, a developer 
  632. can use all the features contained in the Toolkit to manipulate processing and 
  633. interpretation of the pen input for the application.  Programs can also be 
  634. selective in the context of character recognition in order to increase 
  635. accuracy. 
  636.  
  637. The degree to which a program uses the capabilities of Pen determines its 
  638. pen-awareness.  Pen has a variety of components to enhance the pen, as follows: 
  639.  
  640. o Gesture Practice lets you view and practice drawing predefined shapes. 
  641.  
  642. o The Sketch Pad is an application that collects strokes and captures images 
  643.   that the user can manipulate through the clipboard. 
  644.  
  645. o Telepen is a LAN-aware application that allows for communication through 
  646.   handwritten notes and graphics across the LAN. 
  647.  
  648. o The Pen Tool Bar provides easy access to functions that you might want to 
  649.   perform, such as emulating the right mouse button, starting the Handwriting 
  650.   Pad, or displaying the Pop-Up Keyboard. 
  651.  
  652. Pen's Workplace Shell interface lets you change system-wide values using either 
  653. the Customization or Device object.  In addition, the Customization object lets 
  654. you train the system for your particular style of handwriting and to change 
  655. system-wide ges ture assignments. 
  656.  
  657. You can also configure gestures on a per object basis through the Gesture page 
  658. in the Settings notebook of Program object and Program File object.  Pen 
  659. settings also have been added to the Mouse object and Sound objects. 
  660.  
  661. Pen for OS/2 provides device-independence that shields the programmer from the 
  662. differences in hardware devices.  During installation, the device driver 
  663. (furnished by the manufacturer) registers itself and defines all events and 
  664. device capabilities with the IBM Pen for OS/2 Device Services.  The Device 
  665. Services layer provides a consistent programming interface to software 
  666. developers. 
  667.  
  668. Pen for OS/2 extends the functions of the existing PM input subsystem by 
  669. providing new APIs. 
  670.  
  671. The Virtual Keyboard Playback APIs provide control over the Pop-Up Keyboard 
  672. tool. 
  673.  
  674. New Window Control APIs provide an interface to the new controls supplied with 
  675. the Pen extensions, handwriting input control and the sketch control.  Use 
  676. these APIs to customize and manipulate data flows.  Two new tools that use 
  677. these contr ols are the Handwriting Input Pad and the Sketch Pad. 
  678.  
  679. The Pen Writing Subsystem APIs encompass the arena of seeing and controling the 
  680. pen and stroke data and interfacing with the pen subsystem facilities.  New 
  681. OS/2 messages, such as WM_TOUCHDOWN, WM_LIFTOFF, WM_EXIT_PROXIMITY, and WM_RECO 
  682. report the various asynchronous events and state changes associated with Pen. 
  683. These messages are sent to applications with the standard mouse-event messages. 
  684.  
  685. The Writing Subsystem APIs handle receiving stroke data from the input queue 
  686. and the internal cache, determining which window gets the data, and sending PM 
  687. messages to that window.  Pen maintains a stroke buffer that collects all 
  688. points in the movement of the pen between the touch-down point and the lift-off 
  689. point. On stroke completion, Pen sends a WM_STROKE message to the application. 
  690. At this point, the application can access the stroke data through an API. 
  691.  
  692. The main function of the Compatibility Layer is to convert pen events to mouse 
  693. and keyboard events or to invoke special-purpose command handlers that can be 
  694. registered with the system.  This Layer provides the interface to the 
  695. pen-unaware applications that are designed to work with mouse and keyboard 
  696. input.  It allows programs to work in the pen environment without being altered 
  697. for use with the pen. 
  698.  
  699. Some examples of mapping of pen operations to mouse events are: 
  700.  
  701. Touch down and pause          Mouse button down 
  702.  
  703. Touch down, pause, move       Begin drag or selection 
  704.  
  705. Lift off                      Mouse button up 
  706.  
  707. Tap                           Mouse button single click 
  708.  
  709. Double-tap                    Mouse button double click 
  710.  
  711. Move pen                      Mouse move 
  712.  
  713. For these unaware applications, the Compatibility Layer will collect strokes 
  714. and build a doodle on behalf of the application.  When this doodle is complete, 
  715. the Layer tries to resolve the points as a gesture.  If a shape is matched, an 
  716. event is sent to the Recognition Event Delivery (RED) component. 
  717.  
  718. The RED component assists developers in the interpretation of 
  719. command-recognition events, such as gestures.  Its purpose is deliver 
  720. recognition results to applications.  The RED component maps these recognition 
  721. results to assignments de fined by the system or user.  These assignments are 
  722. accessed through the Program or Program File objects settings and the Pen 
  723. Customization object settings.  Assignments can be predefined commands packaged 
  724. with Pen, such as Close Window, o r they can be the name of a program to be 
  725. started.  The predefined command, Send Keystrokes, lets you play back a set of 
  726. keystrokes when drawing a gesture. 
  727.  
  728. Pen for OS/2 provides an open architecture with a number of well-defined socket 
  729. interfaces for device and recognition providers.  The pen opens up features in 
  730. the operating system and applications that were not previously available with 
  731. th e keyboard and the mouse.  It allows for freehand drawing, gives a more 
  732. natural input device, and interprets ink as handwriting and gestures. 
  733.  
  734. We believe that Pen for OS/2 will launch the pen into becoming the primary 
  735. source of input for OS/2. 
  736.  
  737.  
  738. About the Author 
  739.  
  740. Judy Schwait has been with IBM since 1989 and is currently a Senior Associate 
  741. Programmer with the Mobile, Voice, and Pen team.  Judy's previous position with 
  742. IBM was in the OS/2 Workplace Shell department. 
  743.  
  744.  
  745. ΓòÉΓòÉΓòÉ 8. Snap! Crack! Bang! With OS/2 2.1 Multimedia Support ΓòÉΓòÉΓòÉ
  746.  
  747. by Gary G. Allran 
  748.  
  749. OS/2 2.1 provides the richest multimedia platform of any PC-based operating 
  750. system currently available.  With everything from built-in System Sound support 
  751. to Software Motion Video Playback, IBM has covered all the bases. 
  752.  
  753. This article looks at the user interface aspect of the audio support features 
  754. of OS/2's multimedia support.  Look to the next issue of this Newsletter for 
  755. information about the Video interface of the multimedia platform.  More 
  756. detailed information for sof tware developers can be found in the OS/2 2.1 
  757. Toolkit product found on your CD-ROM. 
  758.  
  759. After you install the multimedia support, a new folder appears on your desktop, 
  760. Multimedia. 
  761.  
  762.  
  763. ΓòÉΓòÉΓòÉ 8.1. Audio Support ΓòÉΓòÉΓòÉ
  764.  
  765. OS/2's audio support provides a variety of methods for including audio in your 
  766. applications.  Major features include System Sounds, Compact Disc, Digital 
  767. Audio, and MIDI support.  Let's take a closer look at each of these. 
  768.  
  769.  
  770. ΓòÉΓòÉΓòÉ 8.2. System Sounds ΓòÉΓòÉΓòÉ
  771.  
  772. The System Sound support lets you associate sounds with a variety of system 
  773. events, such as opening or closing a folder or shredding an object. Multimedia 
  774. currently defines 13 system sound events (.WAV files); however, a total of 23 
  775. sound files are included with the product. 
  776.  
  777. The System Sound application, included in the OS/2 System Setup folder, 
  778. provides an easy method for associating a particular sound file with a system 
  779. event.  If you want to change one of the .WAV files associated with a system 
  780. event, you simply click on the system event, such as End Drag, and then click 
  781. on a new .WAV file.  In addition to selecting from the different .WAV files 
  782. that are shipped with OS/2, you also can create your own using the Digital 
  783. Audio application.  More about that later. 
  784.  
  785. The System Sound application has a volume control that lets you adjust the 
  786. audio level for a particular system sound or for all of the system sounds. For 
  787. example, you might choose to soften the volume for things like opening and 
  788. closing folders (so they don't drive you crazy!).  You could also specify that 
  789. other events, such as errors and warnings, have a higher volume level to get 
  790. your attention. 
  791.  
  792.  
  793. ΓòÉΓòÉΓòÉ 8.3. Compact Disc ΓòÉΓòÉΓòÉ
  794.  
  795. Another very popular aspect of OS/2 multimedia support is the compact disc 
  796. player.  Most CD-ROM drives also play CD Digital Audio (CD-DA) discs.  The 
  797. Compact Disc application helps control a standard CD-ROM drive in much the same 
  798. way as a home or car CD player.  You will recognize some of the familiar 
  799. buttons, such as PLAY, FAST FORWARD, and EJECT. 
  800.  
  801. This application also has a feature known as a track calendar display.  This 
  802. display presents a numbered button for each of the tracks on the disc, allowing 
  803. direct selection of any track.  At startup, the first fourteen tracks appear. 
  804. Step through the entire disc using the up and down buttons beside the calendar 
  805. display. 
  806.  
  807. Click the right mouse button to access a variety of features, such as the 
  808. capability to edit the CD-ROM's title.  As you might know, a CD-ROM is actually 
  809. a digital storage device with a capacity of over 600MB.  Amazingly, with over 
  810. 600MB of storage, the designers of the CD-DA format didn't include the title of 
  811. the disc!  If you choose Edit Title from the CD-ROM Player, you can type in any 
  812. title you like (up to 32 characters).  The CD-ROM Player associates that title 
  813. with the unique disc number in a very simple database. Now, every time you 
  814. insert that disc, its title appears in the title bar of the CD-ROM Player. 
  815.  
  816. The CD-ROM Player also supports a track-shuffle feature.  Selecting this option 
  817. causes all the tracks in the music-calendar display to be shuffled. The disc 
  818. then plays in this random order, giving a whole new sound to a very familiar 
  819. disc. 
  820.  
  821.  
  822. ΓòÉΓòÉΓòÉ 8.4. Digital Audio ΓòÉΓòÉΓòÉ
  823.  
  824. OS/2 with MMPM/2 installed has very powerful Digital-Audio support.  With the 
  825. addition of a simple audio card, you now have the ability to record, playback, 
  826. and edit a wide variety of Digital-Audio sounds. 
  827.  
  828. An interesting example of how you can use the OS/2 Digital-Audio subsystem is 
  829. in the Digital-Audio application.  This application is unusual in that it 
  830. provides two personalities or views.  One view is that of a Digital-Audio 
  831. player and recorder.  The other, slightly more complicated view, allows editing 
  832. of digital audio. 
  833.  
  834. In the player/recorder view, this application displays simple features, such as 
  835. rewind, play, and record.  Also displayed are a volume-control and 
  836. media-position information.  To play an existing Digital-Audio file (typically 
  837. found with the .WAV extension), simply open the file and press PLAY. 
  838.  
  839. If you choose to create a new audio file, simply make sure that your audio 
  840. source is connected to your system, and press the RECORD button.  The red 
  841. RECORD button blinks, and recording continues until you press the STOP button. 
  842. This action creates a temp orary file containing the audio data.  You, then, 
  843. can specify a name and save the file, or discard it and record again. 
  844.  
  845. The Editor view of the Digital-Audio application is slightly more complicated. 
  846. In addition to the features described previously, a graphic representation of 
  847. the Digital-Audio file can now be seen.  The scale of this representation can 
  848. be changed using the Zoom slider, located to the right of the View window. 
  849. Moving this slider down lets you zoom in on a specific portion of the audio 
  850. file. 
  851.  
  852. Sections of the Digital-Audio file can now be marked by holding down the right 
  853. mouse button and swiping across the view window.  After you mark an area, you 
  854. then can use a variety of editing functions, such as cut, copy, and paste. 
  855. Specialized features, such as fade in and out, echo, reverb, and reverse are 
  856. also availble.  And, if you don't like what you've done, discard the changes, 
  857. and start over! 
  858.  
  859.  
  860. ΓòÉΓòÉΓòÉ 8.5. MIDI ΓòÉΓòÉΓòÉ
  861.  
  862. Musical instrument digital interface (MIDI) is a lot like a simple local area 
  863. network (LAN) definition.  Various electronic musical devices, such as 
  864. keyboards, synthesizers, and drum machines use MIDI to communicate with one 
  865. another. 
  866.  
  867. For example, when you press middle C on a keyboard, a 3-byte note-on MIDI 
  868. message is generated.  This message contains the ID of the key pressed, as well 
  869. as the velocity or speed at which the key was pressed.  When the key is 
  870. released, a note-off message is generated.  These messages can then be 
  871. interpreted by another device, such as a synthesizer to generate the actual 
  872. sound of a piano note. 
  873.  
  874. Thanks to this message-based design, MIDI is a very compact method for storing 
  875. music content.  MIDI is very popular among game developers for this reason. 
  876. They can deliver a complete audio track for a game, without worrying about the 
  877. great deal of storage that would be required using standard digital-audio 
  878. recording. 
  879.  
  880. The OS/2 support for MIDI currently is restricted to playback only.  It allows 
  881. use of certain digital-audio cards that can emulate MIDI synthesizers.  For 
  882. example, the M-Audio card from IBM, which is built around a Texas Instruments 
  883. C25 Digital Signal Proce ssor (DSP) can be used to emulate a four-voice 
  884. synthesizer. 
  885.  
  886. The MIDI player application lets you select any of the included MIDI files for 
  887. playback. 
  888.  
  889. Note:  It is important to understand that MIDI implementations vary quite a bit 
  890.        from one audio card to another, so files that sound great on one audio 
  891.        card might sound a little funny on others. 
  892.  
  893.  
  894. ΓòÉΓòÉΓòÉ 8.6. Summary ΓòÉΓòÉΓòÉ
  895.  
  896. This sums up the Audio Support for OS/2 Multimedia.  Look in the next issue of 
  897. The Developer Connection News for Video Support for OS/2 Multimedia. 
  898.  
  899.  
  900. About the Author 
  901.  
  902. Gary G. Allran has been with IBM since 1982 and is currently the Manager of OS 
  903. Technical Marketing and Support.  Gary has held a variety of roles at IBM, 
  904. including OS/2 Multimedia Evangelist, Development Manager, Audio Subsystem 
  905. Architect, and IBM DOS Lead Architect. 
  906.  
  907.  
  908. ΓòÉΓòÉΓòÉ 9. Multithreading Presentation Manager Applications ΓòÉΓòÉΓòÉ
  909.  
  910. by Monte Copeland 
  911.  
  912. Over the years, many different styles have emerged to multithread Presentation 
  913. Manager (PM) applications. 
  914.  
  915. The approach presented in this article is the start-a-thread, keep-it-around, 
  916. and give-it-work  approach and is based on PM message queues.  It is a good 
  917. choice, because PM applications must have message queues already. 
  918. Additionally, this choice lets you achieve multithreading without using 
  919. semaphores. 
  920.  
  921.  
  922. ΓòÉΓòÉΓòÉ 9.1. Why Multithreaded PM Applications Are a Must ΓòÉΓòÉΓòÉ
  923.  
  924. PM applications, like all OS/2 applications, call into the operating system for 
  925. services using the OS/2 APIs.  However, PM applications must provide functions, 
  926. called window procedures, for PM to call. 
  927.  
  928. PM delivers messages to a PM application by calling window procedures.  For 
  929. example, these messages include menu selections, mouse clicks, and 
  930. termination-notification messages.  In addition, PM sends a message to the 
  931. application when it is time to repaint the window or it can deliver 
  932. user-defined messages. 
  933.  
  934. For PM to stay synchronized with all the applications on the desktop, it 
  935. delivers messages one at a time.  These are sent messages.  In other words, 
  936. when PM sends a message to your window procedure, it stops sending messages 
  937. elsewhere until your procedure returns. 
  938.  
  939. Therefore, PM applications must respond to all sent messages in a timely 
  940. manner.  The often-cited response time is 1/10th second; hence, the 
  941. 1/10th-second rule.  When an application takes too long to respond to messages, 
  942. unacceptable behavior can occur. 
  943.  
  944. This article describes a robust, two-threaded PM application architecture. 
  945. Applications coded in this style obey the 1/10th second rule, and yet, can 
  946. perform long tasks.  A second thread in PM applications is created to bust the 
  947. 1/10th-second rule, and perform long tasks, such as diskcopy, upload/download, 
  948. file input/output, or SQL queries. 
  949.  
  950.  
  951. ΓòÉΓòÉΓòÉ 9.2. Thread Responsibilities ΓòÉΓòÉΓòÉ
  952.  
  953. Thread 1 is responsible for presentation.  It operates the first message queue 
  954. that the application creates.  This message queue gets and dispatches messages 
  955. to one or more application windows on the desktop. 
  956.  
  957. Thread 1 presents the client window, as well as the dialog and message boxes. 
  958. It reacts to command messages from menus and child controls.  It processes 
  959. messages that the frame-window controls generate.  In fact, thread 1 is devoted 
  960. to the operation of all the application's visible windows on the desktop. 
  961.  
  962. Thread 2 operates a second message queue that is created by thread 2 of the 
  963. application.  This message queue delivers messages to an object window and its 
  964. window procedure.  Object windows are invisible, that is, they do not appear on 
  965. the desktop.  More importantly, they are not bound by the 1/10th-second rule. 
  966.  
  967. When object-window procedures run on thread 2, they are perfect for doing any 
  968. time-consuming tasks required by the application.  While the object window is 
  969. busy working on a task, the main-window procedure continues to get and dispatch 
  970. messages in a time ly manner-as it must. 
  971.  
  972.  
  973. ΓòÉΓòÉΓòÉ 9.3. Post a Message, Do Some Work ΓòÉΓòÉΓòÉ
  974.  
  975. Thread 1 creates thread 2, and thread 2 creates its own message queue for its 
  976. object window.  Then it blocks in the call to the API, WinGetMsg, in the 
  977. message loop.  (See the OBJECT.C file in the sample code that follows this 
  978. article.) 
  979.  
  980. The object window stays blocked until there is work to do.  For example, a user 
  981. selects a task from a pull-down menu.  PM sends a menu message to the client 
  982. window procedure on thread 1. Thread 1 calls the API, WinPostMsg, and posts a 
  983. user-defined messa ge to the object window on thread 2. Thread 2 performs the 
  984. task in the object-window procedure.  When the task is complete, thread two 
  985. posts an acknowledgement back to the originating window. 
  986.  
  987. client/dialog                         object window
  988. window on thread 1                    on thread 2
  989. ---------------                       ---------------      |
  990. |             |                       | waiting in  |      |
  991. | user        | WinPostMsg(           | WinGetMsg   |      |
  992. | requests    |     hwndObject,       |             |      |
  993. | a lengthy   |     WM_USER_WORKITEM, |             |      |
  994. | workitem    |     hwndToAck,        |             |      |
  995. |             |     null )            |             |      |
  996. |             | --------------------> |             |
  997. | window      |                       | perform     |     time
  998. | disabled    |                       | lengthy     |      |
  999. | while       |                       | task        |      |
  1000. | busy        |                       |             |      |
  1001. |             | WinPostMsg(           |             |      |
  1002. |             |    hwndToAck,         |             |      |
  1003. |             |    WM_USER_ACK,       |             |      |
  1004. |             |    WM_USER_WORKITEM,  | task        |      |
  1005. |             |    result code )      | complete    |      |
  1006. |             | <-------------------- |             |      |
  1007. | enable      |                       |             |      |
  1008. | again       |                       |             |      |
  1009. ---------------                       ---------------      |
  1010.                                                            |
  1011.                                                           \ /
  1012.                                                            .
  1013.  
  1014. The following convention exists with the two message parameters of the API, 
  1015. WinPostMsg, when posting a user-defined work message to the window: 
  1016.  
  1017. Message parameter one is the window handle of the originating window.
  1018.  
  1019. By having the window handle of the originator, the object window knows which 
  1020. window to acknowledge when the task completes. 
  1021.  
  1022. The sample file, APP.C, only shows the client-window procedure originating 
  1023. tasks; however, dialog boxes also can originate tasks. 
  1024.  
  1025.  
  1026. ΓòÉΓòÉΓòÉ 9.4. Disable While Busy ΓòÉΓòÉΓòÉ
  1027.  
  1028. In the sample code, the application disables its client and selected menu item, 
  1029. and then posts a message to the object window to perform the lengthy task. 
  1030. These actions prevent the user from initiating another work item, while the 
  1031. object window is busy.  (See the message WM_USER_DISABLE_CLIENT in the file, 
  1032. APP.C, which is sent before the application posts the work request to the 
  1033. object window.) 
  1034.  
  1035. Note:  When the application disables the client window, its message queue does 
  1036.        not stop working. 
  1037.  
  1038. Click on the client window, while the object window is busy.  The beep you hear 
  1039. is proof that the client window's message queue continues to process messages. 
  1040.  
  1041. The frame window is not disabled; therefore, the user can minimize the frame 
  1042. window or switch to another application while the application is busy. 
  1043.  
  1044. The mouse pointer changes to an hourglass when it passes over the window of the 
  1045. busy application.  When the mouse pointer leaves the application window, it 
  1046. changes back to a normal pointer.  The application keeps a busy flag and 
  1047. references it during proce ssing of WM_MOUSEMOVE in the client-window 
  1048. procedure. 
  1049.  
  1050. This approach is simplistic (if not rigid), but it is one that you can modify 
  1051. by choosing which items are grayed on which menus.  If a given thread/object 
  1052. window pair (there could be many) was responsible for tasks A and B, you would 
  1053. gray items A and B, while the object window was busy working on either A or B. 
  1054.  
  1055.  
  1056. ΓòÉΓòÉΓòÉ 9.5. Object Window Acknowledges Completion ΓòÉΓòÉΓòÉ
  1057.  
  1058. When the lengthy task completes, the object window posts a user-acknowledgment 
  1059. message to the window that originated the task.  This message informs the 
  1060. originating window that the task is complete, and that it can re-enable itself 
  1061. and any menu items, as required. 
  1062.  
  1063. Use the following convention with message parameters on the acknowledgment 
  1064. message: 
  1065.  
  1066. Message parameter one is the user-defined message posted to the object window.
  1067.  
  1068. With this parameter, the originating window can discern which activity is now 
  1069. complete; the second message parameter is a result code. 
  1070.  
  1071.  
  1072. ΓòÉΓòÉΓòÉ 9.6. Closing Considerations ΓòÉΓòÉΓòÉ
  1073.  
  1074. The act of closing the application is like a chain reaction between the two 
  1075. threads.  Usually, client windows post a WM_QUIT message to themselves when 
  1076. they receive a WM_CLOSE message-not in multithreaded PM applications. 
  1077.  
  1078. When the client window receives a WM_CLOSE message, it posts a WM_QUIT message 
  1079. to the object window, then it returns.  When the object window receives the 
  1080. WM_QUIT message, it leaves its message loop, cleans up, posts a WM_QUIT message 
  1081. to thread 1. Thread 1 leaves its message loop, waits for thread 2 to exit, and 
  1082. then exits itself (and the process). 
  1083.  
  1084. The object-window thread calls the API, WinCancelShutdown.  If the user shuts 
  1085. down the system while the application is still running, this API tells PM not 
  1086. to send a WM_CLOSE message to the object-window message queue. PM sends a 
  1087. WM_CLOSE message to the client-window message queue, then the chain reaction 
  1088. starts. 
  1089.  
  1090.  
  1091. ΓòÉΓòÉΓòÉ 9.7. Common Data ΓòÉΓòÉΓòÉ
  1092.  
  1093. Both threads share a common data space.  This space is defined by the GLOBALS 
  1094. structure in the app.h file.  WM_CREATE processing allocates this space and 
  1095. passes the pointer to thread 2 on the call to _beginthread.  The client- and 
  1096. object-window procedures keep a pointer to this memory in their window words. 
  1097. The number of extra words for each window is set by the API, WinRegisterClass. 
  1098. Both the client and object windows have 4 extra bytes of window words. 
  1099.  
  1100. When dialog-box procedures initialize, they must obtain the pointer to shared 
  1101. memory, and store it in their window words.  By default, dialog boxes have 
  1102. enough window words to hold a 32-bits-long pointer. 
  1103.  
  1104.  
  1105. ΓòÉΓòÉΓòÉ 9.8. pmassert ΓòÉΓòÉΓòÉ
  1106.  
  1107. The pmassert macro is a debugging tool.  It works much like the C-language 
  1108. assert macro.  Anywhere in the source code, you can assert that a Boolean 
  1109. expression is true.  At runtime, nothing happens if the expression is true. If 
  1110. the expression is false, the macro displays the failed assertion in a message 
  1111. box along with the line number and the C source file name where the assertion 
  1112. failed. 
  1113.  
  1114. Because pmassert is a macro, it is easy to redefine it to be a no operation, 
  1115. after you debug the application.  In the C-language tradition, you accomplish 
  1116. this by defining the symbol, NDEBUG.  This approach to program building 
  1117. produces both debug and ret ail versions of your program.  See the pmassert.h 
  1118. file in the sample code. 
  1119.  
  1120.  
  1121. ΓòÉΓòÉΓòÉ 9.9. Acknowledgments ΓòÉΓòÉΓòÉ
  1122.  
  1123. By now you might have recognized this architecture from the OS/2 Toolkit Print 
  1124. Sample (PRTSAMP.EXE) on the CD-ROM.  It is the same. 
  1125.  
  1126.  
  1127. ΓòÉΓòÉΓòÉ 9.10. Sample Code ΓòÉΓòÉΓòÉ
  1128.  
  1129. Use the following sample code to create your own multithreaded PM applications. 
  1130.  
  1131. // start of file app.h -------------------------------------------------------
  1132.  
  1133. // strings
  1134. #define APP_TITLE               "Object Window Application"
  1135. #define APP_CLASS_CLIENT        "APPClient"
  1136. #define APP_CLASS_OBJECT        "APPObject"
  1137.  
  1138. // identifiers
  1139. #define ID_APP             3
  1140. #define IDM_SLEEP         303
  1141. #define IDM_ACTIONS       304
  1142.  
  1143. // lengths
  1144. #define LEN_WORKSTRING              256
  1145. #define LEN_STACK                 18000
  1146.  
  1147. // structure to hold globals variables common to both threads
  1148. struct _globals {
  1149.   BOOL           fBusy;
  1150.   HAB            hab;
  1151.   HWND           hwndClient;
  1152.   HWND           hwndFrame;
  1153.   HWND           hwndTitlebar;
  1154.   HWND           hwndMenubar;
  1155.   HWND           hwndObject;
  1156.   TID            tidObject;
  1157. };
  1158. typedef struct _globals GLOBALS, *PGLOBALS;
  1159.  
  1160. // user-defined messages for work items and acknowlegements
  1161. #define WM_USER_ACK                      (WM_USER+0)
  1162. #define WM_USER_SLEEP                    (WM_USER+1)
  1163. #define WM_USER_ENABLE                   (WM_USER+2)
  1164. #define WM_USER_DISABLE                  (WM_USER+3)
  1165.  
  1166. // function prototypes -- _Optlink is a IBM C SET/2 modifier
  1167. void _Optlink threadmain( void *  );
  1168. PGLOBALS Create( HWND hwnd );
  1169. MRESULT EXPENTRY ObjectWinProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  1170. MRESULT EXPENTRY ClientWinProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  1171.  
  1172. // end of file app.h ----------------------------------------------------------
  1173.  
  1174. //-------------------------------------------------------------------
  1175. // pmassert.h
  1176. #ifndef NDEBUG
  1177. #define pmassert(hab,exp)\
  1178. {\
  1179. if(!(exp)) {\
  1180.   char ebuff[ 64 ]; unsigned long errorid; unsigned short shortrc;\
  1181.   errorid = WinGetLastError( hab ); \
  1182.   sprintf( ebuff, "Line %d\nFile %s\nLast Error %p\nExpression %s\n",\
  1183.                  __LINE__, __FILE__, errorid, #exp );\
  1184.   shortrc = WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, ebuff,\
  1185.                  "Assertion failed. Continue?", 0, MB_YESNO  );\
  1186.   if( shortrc == MBID_NO ) exit( 1 );\
  1187. }\
  1188. }
  1189. #else
  1190.   #define pmassert(hab,exp)
  1191. #endif
  1192. // end of file pmassert.h
  1193.  
  1194. // start of file app.c -------------------------------------------------------
  1195. // A sample PM application showing use of an object window operated by
  1196. // thread 2 for time-consuming tasks.
  1197.  
  1198. // os2 includes
  1199. #define INCL_DOSPROCESS
  1200. #define INCL_WIN
  1201. #include <os2.h>
  1202. // c includes
  1203. #include <stdio.h>
  1204. #include <stdlib.h>
  1205. #include <string.h>
  1206. #include <assert.h>
  1207. // app includes
  1208. #include "app.h"
  1209. #include "pmassert.h"
  1210.  
  1211. // ----------------------------------------------------------------------
  1212. // main entry point for thread 1
  1213. int main ( void )
  1214. {
  1215.   APIRET   rc;
  1216.   BOOL     fSuccess;
  1217.   HAB      hab;
  1218.   HMQ      hmq;
  1219.   HWND     hwndClient;
  1220.   HWND     hwndFrame;
  1221.   QMSG     qmsg;
  1222.   ULONG    flCreate;
  1223.   PGLOBALS pg;
  1224.  
  1225.   // PM application init
  1226.   hab = WinInitialize( 0 );
  1227.   hmq = WinCreateMsgQueue( hab, 0 );
  1228.   assert( hmq );
  1229.  
  1230.   // register client window class
  1231.   // with 4 bytes of window words to hold a pointer to globals
  1232.   fSuccess = WinRegisterClass( hab, APP_CLASS_CLIENT, (PFNWP)ClientWinProc,
  1233.                       CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof( PGLOBALS ) );
  1234.   pmassert( hab, fSuccess );
  1235.  
  1236.   flCreate = FCF_SYSMENU | FCF_SIZEBORDER    | FCF_TITLEBAR |
  1237.              FCF_MINMAX  | FCF_SHELLPOSITION | FCF_TASKLIST |
  1238.              FCF_MENU    | FCF_ICON;
  1239.  
  1240.   // standard window create; returns after WM_CREATE processing finishes
  1241.   hwndFrame = WinCreateStdWindow( HWND_DESKTOP, WS_VISIBLE, &flCreate,
  1242.                APP_CLASS_CLIENT, APP_TITLE, 0, 0, ID_APP, &hwndClient );
  1243.   pmassert( hab, hwndFrame );
  1244.   pmassert( hab, hwndClient );
  1245.   pg = (PGLOBALS) WinQueryWindowULong( hwndClient, QWL_USER );
  1246.  
  1247.   // dispatch user input messages
  1248.   while( WinGetMsg( hab, &qmsg, 0, 0, 0 ))
  1249.   {
  1250.     WinDispatchMsg( hab, &qmsg );
  1251.   }
  1252.  
  1253.   // wrap up
  1254.   WinDestroyWindow ( hwndFrame );
  1255.   WinDestroyMsgQueue ( hmq );
  1256.   WinTerminate ( hab );
  1257.  
  1258.   rc = DosWaitThread( &pg->tidObject, DCWW_WAIT );
  1259.   assert( rc == 0 );
  1260.  
  1261.   // exit the process
  1262.   return 0;
  1263. }
  1264.  
  1265. // ----------------------------------------------------------------------
  1266. // client window procedure
  1267. MRESULT EXPENTRY ClientWinProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
  1268. {
  1269.   HAB           hab;
  1270.   HPS           hps;
  1271.   PGLOBALS      pg;
  1272.   RECTL         rectl;
  1273.   ULONG         ulWork;
  1274.  
  1275.   switch( msg ) {
  1276.   case WM_CLOSE:
  1277.     // get pointer to globals from window words
  1278.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1279.     // tell object window to quit, then exit its thread
  1280.     WinPostMsg( pg->hwndObject, WM_QUIT, 0, 0 );
  1281.     return (MRESULT) 0;
  1282.  
  1283.   case WM_COMMAND:
  1284.     // get pointer to globals from window words
  1285.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1286.     switch( SHORT1FROMMP( mp1 )) {
  1287.     case IDM_SLEEP:
  1288.       // disable client for this lengthy task
  1289.       WinSendMsg( hwnd, WM_USER_DISABLE, 0L, 0L );
  1290.       // object window is busy now
  1291.       pg->fBusy = TRUE;
  1292.       // tell object window to perform lengthy task
  1293.       WinPostMsg( pg->hwndObject, WM_USER_SLEEP, (MPARAM)hwnd, 0 );
  1294.       // wait for ack
  1295.       break;
  1296.     }
  1297.     return (MRESULT) 0;
  1298.  
  1299.   case WM_CREATE:
  1300.     hab = WinQueryAnchorBlock( hwnd );
  1301.     // allocate memory for global variables; see GLOBALS struct in app.h
  1302.     pg = (PGLOBALS) malloc( sizeof( GLOBALS ));
  1303.     pmassert( hab, pg );
  1304.     // initialize globals to zero
  1305.     memset( pg, 0, sizeof( GLOBALS ));
  1306.     // store globals pointer into client window words; see WinRegisterClass
  1307.     WinSetWindowULong( hwnd, QWL_USER, (ULONG) pg );
  1308.     // disable until object window initializes
  1309.     WinSendMsg( hwnd, WM_USER_DISABLE, 0, 0 );
  1310.     // initialize globals with important data
  1311.     pg->hab          = hab;
  1312.     pg->hwndClient   = hwnd;
  1313.     pg->hwndFrame    = WinQueryWindow( hwnd, QW_PARENT );
  1314.     pg->hwndTitlebar = WinWindowFromID( pg->hwndFrame, FID_TITLEBAR );
  1315.     pg->hwndMenubar  = WinWindowFromID( pg->hwndFrame, FID_MENU );
  1316.     // create thread 2 for object window; pass pointer to globals
  1317.     pg->tidObject = _beginthread( threadmain, NULL, LEN_STACK, (void *)pg );
  1318.     pmassert( hab, pg->tidObject );
  1319.     return (MRESULT) 0;
  1320.  
  1321.   case WM_MOUSEMOVE:
  1322.     // if busy, display the wait pointer, else the arrow pointer
  1323.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1324.     ulWork = pg->fBusy ? SPTR_WAIT : SPTR_ARROW;
  1325.     WinSetPointer(HWND_DESKTOP,WinQuerySysPointer(HWND_DESKTOP,ulWork,FALSE));
  1326.     return (MRESULT) TRUE;
  1327.  
  1328.   case WM_PAINT:
  1329.     hps = WinBeginPaint( hwnd, 0, &rectl );
  1330.     WinFillRect( hps, &rectl, SYSCLR_WINDOW );
  1331.     WinEndPaint( hps );
  1332.     return (MRESULT) 0;
  1333.  
  1334.   case WM_USER_ACK:
  1335.     // get pointer to globals from window words
  1336.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1337.     // object window has completed which task?
  1338.     switch( (ULONG) mp1 ) {
  1339.     case WM_USER_SLEEP:
  1340.       WinMessageBox(HWND_DESKTOP,pg->hwndFrame,"Done.",APP_TITLE,0,MB_CANCEL);
  1341.       break;
  1342.     }
  1343.     WinSendMsg( hwnd, WM_USER_ENABLE, 0, 0 );
  1344.     // object window is not busy anymore
  1345.     pg->fBusy = FALSE;
  1346.     return (MRESULT) 0;
  1347.  
  1348.   case WM_USER_DISABLE:
  1349.     // get pointer to globals from window words
  1350.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1351.     // this message sent by client
  1352.     WinEnableWindow( pg->hwndClient, FALSE );
  1353.     // this is a macro defined in pmwin.h
  1354.     WinEnableMenuItem( pg->hwndMenubar, IDM_SLEEP, FALSE );
  1355.     return (MRESULT) 0;
  1356.  
  1357.   case WM_USER_ENABLE:
  1358.     // get pointer to globals from window words
  1359.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1360.     // this message sent by client
  1361.     WinEnableWindow( pg->hwndClient, TRUE );
  1362.     // this is a macro defined in pmwin.h
  1363.     WinEnableMenuItem( pg->hwndMenubar, IDM_SLEEP, TRUE  );
  1364.     return (MRESULT) 0;
  1365.   }
  1366.   // default
  1367.   return WinDefWindowProc( hwnd, msg, mp1, mp2 );
  1368. }
  1369. // end of file app.c ---------------------------------------------------------
  1370.  
  1371. // start of file object.c ---------------------------------------------------
  1372. // the object window thread and procedure on thread 2
  1373.  
  1374. // os2 includes
  1375. #define INCL_DOSPROCESS
  1376. #define INCL_WIN
  1377. #include <os2.h>
  1378. // crt includes
  1379. #include <stdio.h>
  1380. #include <stdlib.h>
  1381. #include <string.h>
  1382. // app includes
  1383. #include "app.h"
  1384. #include "pmassert.h"
  1385.  
  1386. //----------------------------------------------------------------------
  1387. // thread 2 entry point: gets and dispatches object window messages
  1388. // _Optlink is an IBM C Set/2 function modifier
  1389. void _Optlink threadmain( void * pv  )
  1390. {
  1391.   BOOL       fSuccess;
  1392.   HAB        hab;
  1393.   HMQ        hmq;
  1394.   PGLOBALS   pg;
  1395.   QMSG       qmsg;
  1396.  
  1397.   // cast and set pointer to globals
  1398.   pg = (PGLOBALS) pv;
  1399.  
  1400.   // thread initialization
  1401.   hab = WinInitialize( 0 );
  1402.   hmq = WinCreateMsgQueue( hab, 0 );
  1403.  
  1404.   // prevent system from posting object window a WM_QUIT
  1405.   // I'll post WM_QUIT when it's time.
  1406.   fSuccess = WinCancelShutdown( hmq, TRUE );
  1407.   pmassert( hab, fSuccess );
  1408.  
  1409.   fSuccess = WinRegisterClass( hab, APP_CLASS_OBJECT,
  1410.                   (PFNWP)ObjectWinProc, 0, sizeof( PGLOBALS ));
  1411.   pmassert( hab, fSuccess );
  1412.  
  1413.   pg->hwndObject = WinCreateWindow( HWND_OBJECT, APP_CLASS_OBJECT, "",
  1414.              0, 0, 0, 0, 0, HWND_OBJECT, HWND_BOTTOM, 0, (PVOID)pg, NULL );
  1415.   pmassert( hab, pg->hwndObject );
  1416.  
  1417.   // created OK, ack client
  1418.   WinPostMsg( pg->hwndClient, WM_USER_ACK, 0, 0 );
  1419.  
  1420.   // get/dispatch messages; user messages, for the most part
  1421.   while( WinGetMsg ( hab, &qmsg, 0, 0, 0 ))
  1422.   {
  1423.     WinDispatchMsg ( hab, &qmsg );
  1424.   }
  1425.  
  1426.   // tell client window to quit
  1427.   WinPostMsg( pg->hwndClient, WM_QUIT, 0, 0 );
  1428.  
  1429.   // clean up
  1430.   WinDestroyWindow( pg->hwndObject );
  1431.   WinDestroyMsgQueue( hmq );
  1432.   WinTerminate( hab );
  1433.   return;
  1434. }
  1435.  
  1436. // --------------------------------------------------------------------------
  1437. // object window procedure; mp1 is the window to acknowledge upon completion
  1438. MRESULT EXPENTRY ObjectWinProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
  1439. {
  1440.   PGLOBALS      pg;
  1441.   HWND          hwndToAck;
  1442.  
  1443.   // store the handle of the window to ack upon task completion;
  1444.   hwndToAck = (HWND)mp1;
  1445.  
  1446.   switch( msg ) {
  1447.   case WM_CREATE:
  1448.     // for the create case, mp1 is pointer to globals;
  1449.     // save it in object window words; dependency on WinRegisterClass
  1450.     pg = (PGLOBALS) mp1;
  1451.     WinSetWindowULong( hwnd, QWL_USER, (ULONG) pg  );
  1452.     return (MRESULT) 0;
  1453.  
  1454.   case WM_USER_SLEEP:
  1455.     // get pointer to globals from window words
  1456.     pg = (PGLOBALS) WinQueryWindowULong( hwnd, QWL_USER );
  1457.     // sleep as though this were a time-consuming task
  1458.     DosSleep( 20000 );
  1459.     DosBeep( 500, 150 );
  1460.     // tell originating window that the task is complete
  1461.     WinPostMsg( hwndToAck, WM_USER_ACK, (MPARAM) msg, 0 );
  1462.     return (MRESULT) 0;
  1463.   }
  1464.  
  1465.   // default:
  1466.   return WinDefWindowProc( hwnd, msg, mp1, mp2 );
  1467. }
  1468. // end of file object.c ------------------------------------------------------
  1469.  
  1470. /* start of file app.rc ----------------------------------------------*/
  1471.  
  1472. #include "os2.h"
  1473. #include "app.h"
  1474.  
  1475. POINTER ID_APP THREADS.ICO
  1476.  
  1477. MENU ID_APP
  1478. BEGIN
  1479.   SUBMENU    "Actions",                 IDM_ACTIONS,            MIS_TEXT
  1480.   BEGIN
  1481.     MENUITEM "Sleep & Beep",            IDM_SLEEP,              MIS_TEXT
  1482.   END
  1483. END
  1484.  
  1485. /* end of file app.rc -------------------------------------------------*/
  1486.  
  1487. ; ---------------------------------------------------------------------
  1488. ; app.def
  1489.  
  1490. NAME app WINDOWAPI
  1491.  
  1492. STUB    'OS2STUB.EXE'
  1493.  
  1494. DATA    MULTIPLE
  1495.  
  1496. STACKSIZE  12192
  1497. HEAPSIZE    8200
  1498.  
  1499. PROTMODE
  1500. EXPORTS
  1501.   OBJECTWINPROC
  1502.   CLIENTWINPROC
  1503.  
  1504. ; end of file app.def -------------------------------------------------
  1505.  
  1506. #-------------------------------------------------------------------
  1507. # makefile for APP.EXE, the 2-threaded PM sample
  1508.  
  1509. CC   = icc /c /gd- /re /ss /ms /gm+ /ti+ /q+ /Sm /kb+
  1510. LINK = link386 /nod /cod /map
  1511. LIBS = dde4mbs + os2386
  1512. H    = app.h
  1513. OBJ  = app.obj object.obj
  1514.  
  1515. all: app.exe
  1516.  
  1517. app.exe: $(OBJ) app.res app.def
  1518.   $(LINK)  $(OBJ) ,,, $(LIBS) , $*
  1519.   rc app.res
  1520.  
  1521. app.res: $*.rc threads.ico app.h
  1522.   rc -r $*.rc
  1523.  
  1524. app.obj: $*.c $(H)
  1525.   $(CC) $*.c
  1526.  
  1527. object.obj: $*.c $(H)
  1528.   $(CC) $*.c
  1529.  
  1530.  
  1531. # end of file makefile ---------------------------------------------
  1532.  
  1533.  
  1534. About the Author 
  1535.  
  1536. Monte Copeland has been with IBM since 1987 and is currently a staff Programmer 
  1537. in OS/2 Print Driver development.  Monte has contributed to the OS/2 print 
  1538. sample program in the OS/2 Toolkit.  He also occasionally speaks about OS/2 
  1539. programming at IBM's OS/2 Technical Interchanges. 
  1540.  
  1541.  
  1542. ΓòÉΓòÉΓòÉ 10. Tips 'N Techniques ΓòÉΓòÉΓòÉ
  1543.  
  1544. Tip:  Use the new command-line option, /RUNFROMVDM, in the LINK386 linker 
  1545. provided in OS/2 2.1 to enable your OS/2 applications to run from either an 
  1546. OS/2 or DOS prompt. 
  1547.  
  1548. Technique:  Doesn't it seem unfair that DOS applications can be executed from 
  1549. either an OS/2 or DOS command prompt, while OS/2 applications can be executed 
  1550. from an OS/2 command prompt only.  In the past, the only way to give your OS/2 
  1551. application the same advantage as DOS applications was to BIND your 
  1552. application.  This binding lengthened and complicated the build process and 
  1553. produced much larger programs. 
  1554.  
  1555. OS/2 2.1 provides a way to level the playing field that makes starting your 
  1556. OS/2 application just as easy as starting a DOS application. 
  1557.  
  1558. Don't believe us?  Okay, try this exercise:  Start a DOS command prompt under 
  1559. OS/2 2.1, and attempt to run an OS/2 application that was not built with the 
  1560. /RUNFROMVDM option (like ICONEDIT.EXE).  The following message:  appears: 
  1561.  
  1562. This program cannot be run in a DOS session.
  1563.  
  1564. Now run an application that was linked using the /RUNFROMVDM option (like 
  1565. VIEW.EXE) . You guessed it--no error message!  OS/2 just launches the program 
  1566. in protected mode, and better yet, the user no longer needs to remember whether 
  1567. the application is a DOS or OS/2 program. 
  1568.  
  1569. Why does this work?  An OS/2 application is actually two programs, a DOS 
  1570. program and an OS/2 program.  Offset 3Ch within the DOS header contains a 
  1571. pointer to the OS/2 header. 
  1572.  
  1573. If the OS/2 application is executed from a DOS command line (either the real 
  1574. DOS, a DOS session of OS/2 1.x, or a DOS session of OS/2 2.x), the DOS stub 
  1575. program is executed.  This program is a fully-functional DOS program, whose 
  1576. default is to display an e rror message and terminate in this circumstance. If, 
  1577. however, the application is executed from an OS/2 command line, the OS/2 2.x 
  1578. program is executed. 
  1579.  
  1580. The /RUNFROMVDM option causes LINK386 to include an alternate DOS stub program. 
  1581. When this DOS stub is executed (when the OS/2 application is executed from a 
  1582. DOS command line), it starts an OS/2 protected-mode session and runs the 
  1583. application.  The DOS command line of OS/2 2.1 contains this function; while 
  1584. real DOS and earlier versions of OS/2 do not. 
  1585.  
  1586. By linking an OS/2 application with the /RUNFROMVDM LINK386 option, you improve 
  1587. usability without adding complexity, increasing size, or reducing performance. 
  1588.  
  1589.  
  1590. ΓòÉΓòÉΓòÉ 10.1. Tip 2 ΓòÉΓòÉΓòÉ
  1591.  
  1592. Tip:  Keep a backup copy of the OS2.INI and OS2SYS.INI files. 
  1593.  
  1594. Technique:  You can protect you INI files by having them automatically backed 
  1595. up each time you start your system.  Add the following lines to your CONFIG.SYS 
  1596. file to backup your current .INI files, as well as the .INI files as they 
  1597. existed at the previou s system statup: 
  1598.  
  1599. CALL=x:\OS2\XCOPY.EXE x:\OS2\*.INI x:\OS2\*.INY
  1600. CALL=x:\OS2\XCOPY.EXE x:\OS2\OS2*.INI x:\OS2\*.INX
  1601.  
  1602. where x is the drive on which you have OS/2 installed. 
  1603.  
  1604. Copying .INI files this way allows you to always recover a recent version of 
  1605. these files...just in case! 
  1606.  
  1607.  
  1608. ΓòÉΓòÉΓòÉ 10.2. Tip 3 ΓòÉΓòÉΓòÉ
  1609.  
  1610. Tip:  Display your directories in alphabetical order; with the subdirectories 
  1611. listed first. 
  1612.  
  1613. Technique:  Add the following line to your CONFIG.SYS file: 
  1614.  
  1615. SET DIRCMD=\O:GN
  1616.  
  1617. For this to take affect you must shudown, then, restart your system. 
  1618.  
  1619. Note:  If you wish the same thing for your DOS sessions, add the same line to 
  1620.        your AUTOEXEC.BAT file. 
  1621.  
  1622.  
  1623. ΓòÉΓòÉΓòÉ 10.3. Tip 4 ΓòÉΓòÉΓòÉ
  1624.  
  1625. Tip:  Use the DosLoadModule API only when appropriate 
  1626.  
  1627. Technique:  The DosLoadModule API is a very expensive API call to make, so take 
  1628. care! 
  1629.  
  1630. Appropriate uses of this API are: 
  1631.  
  1632. o At Build time when you do not know the name of the DLL that you need to call. 
  1633.   For example, if it is a user-configurable DLL. 
  1634.  
  1635. o The system (not just your code or just your thread!)  will not use that DLL 
  1636.   during normal operation.  An example DLL is hlpmgr.dll. 
  1637.  
  1638. o The DLL might not be present, and you have to handle the case where it is not 
  1639.   present. 
  1640.  
  1641. Inappropriate uses of this API are: 
  1642.  
  1643. o You need the module handle of your own DLL.  In this case, you should use the 
  1644.   module handle that is pased to the DLL at INIT time. 
  1645.  
  1646. o You need the module handle of another DLL that is already loaded by the 
  1647.   system.  In this case, the module handle should have been saved by the first 
  1648.   load, so you can just use the existing handle. 
  1649.  
  1650.  
  1651. ΓòÉΓòÉΓòÉ 10.4. Tip 5 ΓòÉΓòÉΓòÉ
  1652.  
  1653. Tip:  Tweak OS/2 2.1 for maximum performance 
  1654.  
  1655. Technique:  You can perform several basic functions to maximize your OS/2 2.1 
  1656. performance: 
  1657.  
  1658.  1. Tweak the MAXWAIT, TIMESLICE, PRIORITY, PRIORITY_DISK_IO, PROTECTONLY, and 
  1659.     cache settings (DISKCACHE (for FAT); IFS (for IPFS)) in the CONFIG.SYS.  In 
  1660.     addition, place the swap file on the most used partition on the least used 
  1661.     disk.  Control the location of the swap file using the SWAPPATH line in the 
  1662.     CONFIG.SYS file.  The online OS/2 Command Reference provides the details 
  1663.     for setting these parameters. 
  1664.  
  1665.  2. Drag shadows of most often-used items to the desktop or to folders close 
  1666.     the the surface of the Workplace Shell.  Disable animation.  Use the faster 
  1667.     Details View when opening drive and folder objects. 
  1668.  
  1669.  3. Try reducing the number of on-screen colors or dropping down in screen 
  1670.     resolution.  Close (not just minimize!)  unnecessary objects and 
  1671.     applications. Use the Monochrome scheme from the Scheme palette. 
  1672.  
  1673.  
  1674. ΓòÉΓòÉΓòÉ 11. Creating Multithreaded Applications with WATCOM VX Γûá REXX ΓòÉΓòÉΓòÉ
  1675.  
  1676. by Brian Vink 
  1677.  
  1678. The integrated graphical user interface (GUI) and multithreading capability of 
  1679. the OS/2 operating system are two of its key advantages.  The integrated GUI 
  1680. provides the framework necessary for rich, graphical applications. 
  1681. Multithreading enables simultaneous running of many applications.  WATCOM's VX 
  1682. REXX provides an easy-to-use development environment for creating applications 
  1683. that exploit both the GUI capabilities and multithreading of OS/2 2.x.  In this 
  1684. article we focus on multithreading.  We briefly discuss threads and then show 
  1685. how to create a simple multithreaded application using WATCOM VX Γûá REXX. 
  1686.  
  1687.  
  1688. ΓòÉΓòÉΓòÉ 11.1. Why Threads? ΓòÉΓòÉΓòÉ
  1689.  
  1690. A thread is a unit of execution.  It has its own instructions, related CPU 
  1691. register values, and a stack.  A thread does not own system resources, but it 
  1692. shares the resources owned by the process that created it.  A program that uses 
  1693. threads will appear to be able to do more than one thing at a time. 
  1694.  
  1695. The IBM OS/2 Application Design Guide states "The most efficient use of your 
  1696. system will be achieved if you structure your application so that one thread 
  1697. remains responsive to user input while others continue processing work."  An 
  1698. example of this occurs in any OS/2 application that uses the Presentation 
  1699. Manager (PM) GUIs.  These applications, if properly designed, have a minimum of 
  1700. two threads.  One thread handles the processing for your application, while the 
  1701. other remains responsive to user input.  If this is not done, your application, 
  1702. as well as all other PM applications, will be blocked. That is, they will be 
  1703. unable to receive any user interface messages. VX Γûá  REXX  automatically 
  1704. creates applications having two threads to properly handle PM. 
  1705.  
  1706. Many applications require more than the minimum number of threads.  For 
  1707. instance, a process might create a thread to perform a lengthy database query 
  1708. or to write data to a disk or to display a movie in a multimedia presentation. 
  1709. The creation of this thread frees the rest of the application so that it can 
  1710. continue to do other things, like process user input.  The following example 
  1711. shows how to develop this kind of multithreaded application in VX Γûá REXX. 
  1712.  
  1713.  
  1714. ΓòÉΓòÉΓòÉ 11.2. A Multithreaded  Application ΓòÉΓòÉΓòÉ
  1715.  
  1716. The sample application has a main window running on a single thread.  By 
  1717. pressing the Spawn New Thread button, you can start multiple child windows 
  1718. (each running on a separate thread).  Once started, each child window can send 
  1719. text messages to the main wi ndow.  Figure 1 shows the sample application begin 
  1720. created in the WATCOM VX Γûá REXX visual-design environment.  This is the same 
  1721. visual design environment used when creating any VX Γûá REXX application. 
  1722.  
  1723. Figure 1.  Sample VX Γûá REXX application 
  1724.  
  1725.  
  1726. ΓòÉΓòÉΓòÉ 11.3. Starting a New Thread ΓòÉΓòÉΓòÉ
  1727.  
  1728. Figure 2 shows the main window of the application running.  The main thread of 
  1729. the application is called thread 1. From the main window we can create any 
  1730. number of additional threads. 
  1731.  
  1732. Figure 2. Main thread of the application 
  1733.  
  1734. To spawn the new thread, we defined a procedure in the Main window to execute 
  1735. the following set of instructions: 
  1736.  
  1737.         call VRMethod "Application", "StartThread", "Window2", threadID
  1738.         if( result = 0 )then do
  1739.                         call VRMessage VRWindow(), "Could not spawn thread", "Spawn
  1740.                 Error"
  1741.         end
  1742.  
  1743. This code tells VX Γûá REXX to start a new thread running the previously-defined 
  1744. Window2 code.  The value of the variable thread ID is passed to the Window2 
  1745. REXX code as an argument, just as if it had been started from the OS/2 command 
  1746. line.  Figure 3 sho ws the result of running the previous code segment by 
  1747. pressing the Spawn New Thread button shown on the application screen. 
  1748.  
  1749. ce Figure 3. The result of pressing the Spawn New Thread button 
  1750.  
  1751.  
  1752. ΓòÉΓòÉΓòÉ 11.4. Communication between Threads ΓòÉΓòÉΓòÉ
  1753.  
  1754. To synchronize the operation of the threads, we need a way for them to 
  1755. communicate. Using a method called posting, messages can be sent to a 
  1756. particular thread.  For example, if we would like Window2 to pass a message to 
  1757. the main window, we post a message from Window2 as follows: 
  1758.  
  1759.         text = VRGet( "input_window", "value" )
  1760.         // Concatenation of quotes forms the string to pass  //
  1761.         text = '"' || text || '"'
  1762.         call VRMethod "Application", "Post", mainThread, "call ShowMessage"
  1763.         text
  1764.  
  1765. The VRGet function retrieves the text from the input box in Window2.  The 
  1766. function posts a message to the main window.  The message is a REXX command 
  1767. that is executed in the main window.  In this case, the message is: 
  1768.  
  1769.                 call ShowMessage text
  1770. As in all PM applications, there is an event loop that receives and dispatches 
  1771. messages.  The message posted to the Main window is queued so that the 
  1772. procedure, ShowMessage, is automatically called the next time the event loop is 
  1773. executed. 
  1774.  
  1775. The ShowMessage procedure of Window1 is: 
  1776.  
  1777.                 ShowMessage:
  1778.                     text = Arg( 1 )
  1779.                     call VRMethod "message_list", "addstring", text
  1780.                     return
  1781. In this example, ShowMessage simply lists the message that has been passed to 
  1782. it in its message box.  Figure 4 shows a message that was passed to the main 
  1783. thread from thread 2. Figure  4.  Message passed to the main thread 
  1784.  
  1785. The method described previously is not the only method of communicating between 
  1786. threads.  Other methods, such as using process-wide global variables, are also 
  1787. supported by WATCOM VX Γûá REXX. 
  1788.  
  1789. In summary, an integrated GUI and support of multithreading are two of the many 
  1790. benefits offered by OS/2 2.x.  WATCOM VX Γûá REXX exploits both of these key 
  1791. features of OS/2 in one cost effective package.  VX Γûá REXX is ideal for both 
  1792. simple development projects and the creation of advanced applications requiring 
  1793. the advanced features of OS/2 2.x 
  1794. Watcom History 
  1795.  
  1796. Founded in 1974, WATCOM supplies high-performance programming and information 
  1797. tools for a wide range of computing environments.  For more information on 
  1798. WATCOM or VX Γûá REXX, contact WATCOM at: 
  1799.  
  1800. WATCOM International 
  1801. 415 Phillip Street 
  1802. Waterloo, Ontario 
  1803. Canada N2L3X2 
  1804. 519-886-3700 
  1805. 519-747-4971 
  1806.  
  1807. or 
  1808.  
  1809. WATCOM Europe 
  1810. PO Box 64 
  1811. LIVINGSTON 
  1812. West Lothian 5H547AE 
  1813. 44 506 460112 (phone) 
  1814. 44 506 460115 (fax) 
  1815.  
  1816.  
  1817. ΓòÉΓòÉΓòÉ 12. Discovery Search Engine ΓòÉΓòÉΓòÉ
  1818.  
  1819. by Dale Torres 
  1820.  
  1821. Have you ever wondered if something you needed was available?  Is a table of 
  1822. contents or an index enough to figure out if what you need is in a document? 
  1823. What questions do you ask to determine if that module is one you could use? If 
  1824. you have ever asked these questions or others like them, read on. 
  1825.  
  1826. This article describes some of the technology that was used in the Discovery 
  1827. Search Engine developed by IBM Santa Theresa.  A subset of the Discovery Search 
  1828. Engine is used in the Developer Connection CD-ROM. 
  1829.  
  1830.  
  1831. ΓòÉΓòÉΓòÉ 12.1. Today ΓòÉΓòÉΓòÉ
  1832.  
  1833. Different types of search technologies are used for different types of work. 
  1834.  
  1835. You can spend a lot of time is spent browsing source (text or otherwise) to 
  1836. determine what information is available, how something works, or whether or not 
  1837. you can reuse some or all of what you are looking at.  To find things, a simple 
  1838. search mechanism pe rforms a pattern-match with what you are looking for by 
  1839. scanning the source.  There might be a few optional features, but generally 
  1840. browsers or editors are only good for a particular source with a particular 
  1841. tool. 
  1842.  
  1843. The rest of this article descrives some of the search technologies available 
  1844. today to help you find words, source code, test cases, or other items. 
  1845.  
  1846.  
  1847. ΓòÉΓòÉΓòÉ 12.2. Free Text Search ΓòÉΓòÉΓòÉ
  1848.  
  1849. Free text search engines let the user pick their own identifiers to look for, 
  1850. as opposed to a sometimes arbitrary table of contents or index.  Most search 
  1851. engines allow for a free text search, based on a technology that scans the 
  1852. source file.  An index file is built that contains the primal elements found in 
  1853. the source file, along with offsets when duplicates are found.  This file is 
  1854. used by the search engine to locate items of interest.  An optional feature 
  1855. might exist to allow the file creator to ignore such noise words as a, to, or 
  1856. the. 
  1857.  
  1858. When compiling such a index for multiple source files an additional piece of 
  1859. information may be necessary.  This information consists of an indicator that 
  1860. identifies what information is found in which source file.  An additional 
  1861. header is appended.  The extra indicators would help the search engine identify 
  1862. in which which source files the desired information might be found. The file a 
  1863. bit larger now, perhaps up to 15%.  This type of search also might take longer. 
  1864.  
  1865.  
  1866. ΓòÉΓòÉΓòÉ 12.3. Keyword Search ΓòÉΓòÉΓòÉ
  1867.  
  1868. Keyword search engines provide a different type of capability for the end user. 
  1869. By associating source information with selected keywords, the user can obtain 
  1870. information quickly and easily.  This association of keywords allows for 
  1871. combinations not availa ble with free text searches andis very useful when 
  1872. there are many source files to be examined for specific information.  The use 
  1873. of boolean expressions is a valuable part of this search technique.  Verbs such 
  1874. as AND, OR, and NOT help combine these keywords into extended search arguments. 
  1875. Faceted arguments may also be used, as well as additional qualifiers.  Sounds 
  1876. pretty good so far, doesn't it? 
  1877.  
  1878. There are several areas that limits keyword search.  Many of these types of 
  1879. keyword search engines are implemented in a relational database, with a great 
  1880. number of tables that would need to be maintained.  It can also be terribly 
  1881. slow.  As many of you prob ably already know, when you are looking for 
  1882. something and you are distracted or annoyed (in this case with slow response 
  1883. time), the tool isn't very valuable. 
  1884.  
  1885.  
  1886. ΓòÉΓòÉΓòÉ 12.4. Artificial Intelligence ΓòÉΓòÉΓòÉ
  1887.  
  1888. Artificial Intelligence (AI) allows for new, additional opportunities.  It 
  1889. allows for specialized searches, such as elements that meet a special category, 
  1890. parameter values for example.  AI provides capabilities for not only free text 
  1891. searches and keyword s earch arguments but also specific context searches 
  1892. within facets.  Say you wanted to know of elements within a library that 
  1893. contain length fields of less than 1,000 bytes, or an arrangement where when 
  1894. this condition is satisfied, list all associated compon ents called by these 
  1895. modules.  AI allows for wild-card searching as well.  AI is beginning to look 
  1896. pretty good. 
  1897.  
  1898. Of course, there is no free lunch with AI either.  Someone has to generate the 
  1899. semantic nets and the rules.  Someone also has to decide a bunch of other stuff 
  1900. as well.  It can be a bit of a maintenance nightmare.  Besides, such an AI 
  1901. index may be as large as 75% of the original library, a real space hog.  It is 
  1902. also questionable when it comes to response time. 
  1903.  
  1904.  
  1905. ΓòÉΓòÉΓòÉ 12.5. Structured Search ΓòÉΓòÉΓòÉ
  1906.  
  1907. Structured searches let you navigate through the subdirectories and other 
  1908. similar structures that make up libraries.  They present information that might 
  1909. not be available with the other search technologies, such as when a file was 
  1910. last updated, ownership, and security issues. 
  1911.  
  1912. When combined with a keyword type of search the results can be of immense 
  1913. benefit for maintenance programmer.  When a maintenance programmer wants to 
  1914. make an enhancement to an existing application program this type of search may 
  1915. be of great benefit. 
  1916.  
  1917.  
  1918. ΓòÉΓòÉΓòÉ 12.6. Summary ΓòÉΓòÉΓòÉ
  1919.  
  1920. What would be the optimum search tool?  I propose combininng the best of all 
  1921. those described.  A Keyword Search capability combined with a Structured 
  1922. approach that included the ability to search for intelligent answers, such as 
  1923. the ones sought with AI.  It would also be lightning fast, and build an index 
  1924. smaller than 10% and provide automated method of accumulating the keywords, the 
  1925. structure, the rules and the semantic nets, without the need for human 
  1926. intervention.  It would have provisions for self-maintenance as well as the 
  1927. capability of tailoring it to suit individual needs. 
  1928.  
  1929. The prototype of such a tool is used in The Developer Connection Browser, 
  1930. providing the ability to search through the volumes of technical documentation 
  1931. on the CD-ROM. 
  1932.  
  1933.  
  1934. ΓòÉΓòÉΓòÉ 13. VisPro/REXX Is Visual Programming with REXX ΓòÉΓòÉΓòÉ
  1935.  
  1936. by Dave Hock 
  1937.  
  1938. HockWare Inc.'s VisPro/REX lets seasoned and novice PM programmers quickly 
  1939. create powerful graphical applications using REXX.  VisPro/REXX uses the 
  1940. features of OS/2 2.1 and the Workplace Shell, and demonstrates the power of the 
  1941. OS/2 2.1 environment. 
  1942.  
  1943. Many OS/2 programmers are using it to quickly construct applications that are 
  1944. critical to their business.  Others are taking advantage of the OS/2 REXX 
  1945. support for database manager, HLLAPI, and APPC in building their applications. 
  1946.  
  1947. VisPro/REXX looks and feels just like the Workplace Shell, making it extremely 
  1948. easy to learn.  It employs direct editing, pop-up menus, multiple views, and 
  1949. settings notebooks.  In addition, VisPro/REXX supports the OS/2 font and color 
  1950. palettes, making it easy to change the font or color of the application you are 
  1951. creating. 
  1952.  
  1953. The fact that VisPro/REXX conforms to CUA '91 standardshas another benefit: 
  1954. because developers often design by example when creating an application, 
  1955. programmers use design aspects of their favorite applications.  Therefore, 
  1956. VisPro/REXX helps programmers design proper CUA '91 applications by acting as 
  1957. an example. 
  1958.  
  1959. VisPro/REXX provides drag and drop capabilities throughout the product.  The 
  1960. most distinctive of these is drag and drop programming.  Using drag and drop, 
  1961. VisPro/REXX users literally have the option of programming a window with very 
  1962. little use of the keyb oard.  This capability is made possible by automatically 
  1963. generating REXX code for all object interactions. 
  1964.  
  1965. VisPro/REXX has defined a series of powerful REXX calls to interface with GUI 
  1966. objects.  These calls free the programmer from having to deal with the 
  1967. multitude of ways of accessing information on controls by using the object 
  1968. oriented programming (OOP) concept, overloading. 
  1969.  
  1970. For example, consider the chore of getting the value of an OS/2 control.  A 
  1971. VisPro/REXX programmer can use the VpGetItemValue function.  In contrast, an 
  1972. OS/2 programmer would have to deal with many different types of calls, which 
  1973. vary from control to contr ol.  The following shows the programming constructs 
  1974. that are replaced by a single call to the function, VpGetItemValue: 
  1975.  
  1976. To get the text for a push button, radio button, entry field, or check box: 
  1977.  
  1978.       WinQueryWindowText(hwnd,sizeof(value),value)
  1979.  
  1980. To get the text for a menu item: 
  1981.  
  1982.       WinSendMsg(hwndMenu, MM_QUERYMENUTEXT,
  1983.            MPFROM2SHORT(item,sizeof(value), value)
  1984.  
  1985. To get the position of a slider arm: 
  1986.  
  1987.       value=WinSendMsg(hwnd, SLM_QUERYSLIDERINFO,
  1988.               MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE),0)
  1989.  
  1990. To get the text of the selected item in a list box or combo box: 
  1991.  
  1992.       sTemp=SHORT1FROMMR(WinSendMsg(hwnd,LM_QUERYSELECTION,
  1993.                  MPFROMSHORT(LIT_FIRST), 0));
  1994.       if (sTemp!=LIT_NONE)
  1995.          WinSendMsg(hwnd,LM_QUERYITEMTEXT,
  1996.                  MPFROM2SHORT(sTemp,value),
  1997.                  MPFROMP(value));
  1998.  
  1999. To get the contents of a spin button: 
  2000.  
  2001.       WinSendMsg(hwnd,SPBM_QUERYVALUE,
  2002.                  MPFROMP(value),
  2003.                  MPFROM2SHORT(sizeof(value),SPBQ_UPDATEIFVALID))
  2004.  
  2005. To get the contents of a selected value set cell: 
  2006.  
  2007.       mr=WinSendMsg(hwnd,VM_QUERYSELECTEDITEM,0,0);
  2008.       usRow=SHORT1FROMMR(mr);
  2009.       usColumn=SHORT2FROMMR(mr);
  2010.       vsText.pszItemText=value;
  2011.       vsText.ulBufLen=sizeof(value);
  2012.       WinSendMsg(hwnd,VM_QUERYITEM,
  2013.                 MPFROM2SHORT(usRow,usColumn),MPFROMP(&vsText))
  2014.  
  2015. To get the text for a selected container icon: 
  2016.  
  2017.       pRecord=(PMINIRECORDCORE)PVOIDFROMMR(WinSendMsg(hwnd,CM_QUERYRECO
  2018.   RDEMPHASIS,
  2019.      MPFROMP(CMA_FIRST), MPFROMSHORT(CRA_SELECTED)));
  2020.      if (pRecord)
  2021.       if(WinSendMsg(hwnd,CM_QUERYRECORDINFO,
  2022.             MPFROMP(&pRecord), MPFROMSHORT(1)))
  2023.             strcpy(value,pRecord->pszIcon);
  2024.  
  2025. Who wants to do all this just to get the value of the object?  VisPro/REXX does 
  2026. the equivalent operations with the single function, VpGetItemValue, and because 
  2027. of the drag and drop programming interface, programmers don't even have to type 
  2028. any code to achieve this. 
  2029.  
  2030.  
  2031. ΓòÉΓòÉΓòÉ 13.1. Creating a Program using VisPro/REXX ΓòÉΓòÉΓòÉ
  2032.  
  2033. To start working on a program, the VisPro/REXX user drags a new project from 
  2034. the Project template icon.  Once open, the project displays a Main icon that 
  2035. represents the main window for the application being created. 
  2036.  
  2037. From a pop-up menu, the VisPro/REXX user can open a Layout view of the Main 
  2038. icon.  The WYSIWYG Layout view lets the user lay out the user-interface objects 
  2039. for the window..  To add an object, drag the corresponding icons from the Tool 
  2040. bar, and drop them at the desired location in the canvas within the Layout 
  2041. view. 
  2042.  
  2043. Figure 1.  Lyout view of VisPro/REXX
  2044.  
  2045. The objects you add behave just like Workplace Shell objects, including pop-up 
  2046. menus, support direct editing, and have a Settings view to modify attributes of 
  2047. the object.  All objects can be dragged to the Shredder or to a Workplace Shell 
  2048. folder where they can be made into file objects.  Objects can also be copied by 
  2049. holding down the Control key while dragging. 
  2050.  
  2051. Add menus to the application using the Menu page of the Settings notebook.  To 
  2052. add a menu, simply select Add menu from the Menu page.  An icon appears for the 
  2053. menu; use direct editing to provide a name for it.  Menu items can be added 
  2054. under the menu by selecting Add item; again, use direct editing to provide a 
  2055. name. 
  2056.  
  2057. To define what happens when an object is used (for example, a button is 
  2058. clicked), you can either remain in the Layout view, or switch to the Event tree 
  2059. view.  This view provides a split window, showing the objects the user added as 
  2060. well as the events the user chose on the left.  On the right, the REXX 
  2061. statements for the selected event appear.  If, for example, you want to specify 
  2062. what happens when a push button is clicked, select the When Clicked/Selected 
  2063. item from the push button's pop-up menu.  The code for the event appears on the 
  2064. right side of the Event tree view. 
  2065.  
  2066. The Event tree view is also handy for drag and drop programming.  For example, 
  2067. to set the value of an entry field when the previously-described push button is 
  2068. selected, use drag and drop programming to drag the entry field to the right 
  2069. side (containing the code).  At this point, linking emphasis is shown by a 
  2070. rubber-band line from the source of the drag to the current position of the 
  2071. mouse pointer.  When the drag operation is ended, a window appears containing a 
  2072. list, in plain English, of all the things that can be done to the entry field. 
  2073. After the user selects the appropriate choice, the REXX statements used to set 
  2074. the value of the entry field are generated.  See figure 2. 
  2075.  
  2076. Figure 2.  Event tree view showing drag and drop capabilities 
  2077.  
  2078. After programming an initial application, test it by selecting the Test 
  2079. function.  This function immediately runs the application, and places the 
  2080. programmer into an interactive debugger.  While this debugger runs, the 
  2081. programmer can modify the code on the fly to correct any problems encountered. 
  2082. After the application is complete, the programmer can select the Build function 
  2083. to generate a small, stand-alone executable (.EXE) file.  This file can be 
  2084. distributed to anyone free of charge. 
  2085.  
  2086.  
  2087. HockWare History 
  2088.  
  2089. HockWare, Inc.  was formerly UCANDU Software.  HockWare, Inc.  is a software 
  2090. company specializing in OS/2 products.  Dave Hock is a former member of IBM's 
  2091. CUA '91 Architecture group.  He was a member of the programming team that 
  2092. developed the OS/2 2.0 Workplace Shell.  To find out more about Vispro/REXX or 
  2093. HockWare, Inc, contact: 
  2094.  
  2095. HockWare, Inc. 
  2096. P.O. Box 336 
  2097. Cary, NC 27512 
  2098. (919) 387-7391 (sales) 
  2099. (919) 380-0616 (technical support) 
  2100. (919) 380-0757 (fax) 
  2101.  
  2102.  
  2103. ΓòÉΓòÉΓòÉ 14. Graphics Interface Kit/2 Brings Ease to Creating GUIs ΓòÉΓòÉΓòÉ
  2104.  
  2105. IBM (Vienna, Austria) recently announced the IBM Graphics Interface Kit/2 
  2106. (GIK/2) product.  GIK/2 is a product that lets programmers focus on application 
  2107. logic, rather than graphic programming. 
  2108.  
  2109. With the advent of GUI-based integrated environments, such as IBM's OS/2 
  2110. Presentation Manager (PM), market demand has increased for products providing 
  2111. graphical front-ends.  Many tools on the market let you develop standard GUI 
  2112. interfaces.  The GIK/2 product is different--it is a toolkit that assists you 
  2113. in creating abstract graphical front-ends for applications.  An example of an 
  2114. abstract front-end is shown in figure 1. 
  2115.  
  2116. Figure 1. Abstract GUI front-end
  2117.  
  2118. Previously when a programming shop wanted to implement GUIs in their 
  2119. applications, they had to make a substantial financial and personnel 
  2120. commitment. Today, with the help of IBM GIK/2, you can rapidly develop 
  2121. prototypes of your data objects and create skeleton C-language files.  GIK/2 
  2122. also provides you with an interface to 300+ functions, which links the 
  2123. prototype to your application code.  These functions consists of event and 
  2124. action handlers, as well as API calls. 
  2125.  
  2126. This article describes creating a GUI application using GIK/2. 
  2127.  
  2128.  
  2129. ΓòÉΓòÉΓòÉ 14.1. Development Overview ΓòÉΓòÉΓòÉ
  2130.  
  2131. For most of your development, you will use GIK/2's easy-to-use, menu-driven 
  2132. design tool.  The design tool lets you create a design program quickly, by 
  2133. letting you define the parameters that characterize your GUI.  Then, GIK/2 
  2134. generates a source-code skele ton for your customizing C code, based on these 
  2135. parameters.  All of the parameters are saved in the .DF file; your custom C 
  2136. program uses them during runtime. 
  2137.  
  2138.  
  2139. ΓòÉΓòÉΓòÉ 14.1.1. Defining Symbol Types ΓòÉΓòÉΓòÉ
  2140.  
  2141. Symbols are the application building blocks.  GIK/2 defines two kinds of 
  2142. symbols---nodes and links.  Nodes are the objects that the end-user can 
  2143. manipulate; links are the relationship connecting either other links or nodes. 
  2144. Symbols can consist of different parts, just as a car consists of an engine, 
  2145. tires, and wheels.  The symbol part is the smallest unit that can be acted on. 
  2146.  
  2147. In addition to defining multiple forms for each symbol, GIK/2 lets you define 
  2148. multiple shapes for each form.  While you must specify a standard shape, you 
  2149. also optionally can specify a palette or drag shape. 
  2150.  
  2151. Whether you define one or many symbol parts and forms, GIK/2 uses the same 
  2152. application code for each single symbol. 
  2153.  
  2154. Symbols can take on many shapes.  Use the GIK/2 shape definition window to 
  2155. develop the shape's graphical elements.  Associate one or more elements with 
  2156. each symbol part.  The shape definition window is a WYSIWYG editor.  In 
  2157. addition to drawing polylines, arcs, or boxes, GIK/2 lets you import icons, bit 
  2158. maps, and pointers. 
  2159.  
  2160.  
  2161. ΓòÉΓòÉΓòÉ 14.2. Defining the Rest of Your Interface ΓòÉΓòÉΓòÉ
  2162.  
  2163. Use the GIK/2 graphics editor to define the look of your windows.  For example: 
  2164.  
  2165. o Define symbol palettes 
  2166. o Customize menu bars 
  2167. o Specify overview windows 
  2168. o Specify colors 
  2169. o Define context-sensitive help panels 
  2170.  
  2171. After you specify how the windows look, specify the things you will let the 
  2172. end-user to do to the object, called editing characteristics.  For example, you 
  2173. might restrict the actions on some objects. 
  2174.  
  2175. Finally, tell the GIK/2 design tool to generate skeleton files for customizing 
  2176. code.  Customizing code consists of action and event handlers.  GIK/2 generates 
  2177. the following files: 
  2178.  
  2179. o Include files 
  2180. o Action handlers 
  2181. o Event handlers 
  2182. o Definition files 
  2183. o Make files 
  2184.  
  2185.  
  2186. ΓòÉΓòÉΓòÉ 14.2.1. Runtime Overview ΓòÉΓòÉΓòÉ
  2187.  
  2188. The runtime component of GIK/2 contains a small starter program, as well as 
  2189. DLLs having over 300 APIs, events, and actions.  Running GIK/2's starter 
  2190. program gives you access to a powerful and generic graphics editor.  This 
  2191. editor provides you with a set of windows, menus, and supporting features. The 
  2192. characteristics of the graphics editor are dependent on the definitions in your 
  2193. .DF file and can be customized using either the design tool or by writing 
  2194. customizing code.  During runtime, the design file populates the interface with 
  2195. symbols, the customizing code synchronizes the interface with the application, 
  2196. and the help library provides context-sensitive help. 
  2197.  
  2198. The runtime window is where the action takes place...it is where you check to 
  2199. see whether or not your objects do what they're supposed to do.  Use the 
  2200. runtime window to see if symbols can be moved, added, or deleted as planned. 
  2201. Actions 
  2202.  
  2203. The GIK/2 program comes with approximately 50 standard, generic actions.  Even 
  2204. though they are functional, you must write customizing code to conform them to 
  2205. your specific needs. 
  2206.  
  2207. Explicit actions are actions that you invoke from the menu bar.  Implicit 
  2208. actions are actions that you invoke using the mouse.  The association between a 
  2209. menu choice and an explicit action must be defined in the design file. 
  2210.  
  2211. If, however, you want to add your own actions invoked from the menu bar, you 
  2212. must associate these menu choices with action handlers (a C function that is 
  2213. called when the user selects one of these menu choices).  Each action handler 
  2214. contains a switch st atement; while each menu choice associated with that 
  2215. action handler consists of a case statement. 
  2216. Events 
  2217.  
  2218. Events are predefined points in GIK/2 processing where you can define user-exit 
  2219. routines, called event handlers, which let you customize the behavior of the 
  2220. graphic interface and link the graphics interface to the application code. 
  2221.  
  2222. Event handler functions provide the key link between the graphic created with 
  2223. the GIK/2 design tool and the application data.  When you register each event 
  2224. handler in the design tool, GIK/2 creates code templates for each handler. 
  2225. Graphics Library Functions 
  2226.  
  2227. With the GIK/2 program, you get 300+ high-level graphics functions.  Call these 
  2228. functions within your C-language program to change the default behavior of 
  2229. GIK/2.  Functions are available to connect graphical symbols to the application 
  2230. code that they repre sent, initialize and quit GIK/2 windows from the 
  2231. application main code, and process events. 
  2232.  
  2233. Again, the purpose of using a GUI programming tool remains clear.  Instead of 
  2234. concentrating on graphic programming and associations, you are now free to 
  2235. concentrate on your application logic. 
  2236.  
  2237.  
  2238. ΓòÉΓòÉΓòÉ 14.2.2. Customizing with C Code ΓòÉΓòÉΓòÉ
  2239.  
  2240. After using the GIK/2 design tool to create your design and register your event 
  2241. handlers, you are finally ready to work on the customizing code to build a 
  2242. running application.  Your customizing code adds the application logic that 
  2243. links the application da ta to your graphical interface.  The collection of 
  2244. event and action handlers is your customized C code and will reside in an OS/2 
  2245. DLL. 
  2246.  
  2247.  
  2248. ΓòÉΓòÉΓòÉ 14.3. Summary ΓòÉΓòÉΓòÉ
  2249.  
  2250. So there you have it...  all the necessary components of the complete graphics 
  2251. programming toolkit: 
  2252.  
  2253. o A graphics editor with all the basic features needed by any graphics 
  2254.   interface. 
  2255.  
  2256. o A design tool that enables you to quickly adapt the graphics editor to 
  2257.   specific application needs A powerful graphics library that allows you to 
  2258.   link your graphics interface to your application code. 
  2259.  
  2260. Now that you've read about it, use it!.  Your accompanying Developer Connection 
  2261. CD-ROM contains a demo version of the GIK/2 product.  Use the demo to create 
  2262. your own GUI applications, and find out how easy using the GIK/2 product really 
  2263. is. 
  2264.  
  2265.  
  2266. Related Information 
  2267.  
  2268. This article was based on the paper Graphics Interface Kit/2 A toolkit for 
  2269. graphical visualization and Manipulation of Data by Sylvia Hansjakob (Manager 
  2270. of the GIK/2 Development Team) and Roland Hatschka (GIK/2 team programmer). It 
  2271. was edited for this publication by Stacey Miller, the Editor of The Developer 
  2272. Connection News. 
  2273.  
  2274.  
  2275. ΓòÉΓòÉΓòÉ 15. Graphics Interface Kit/2 and The Developer Connection for OS/2 ΓòÉΓòÉΓòÉ
  2276.  
  2277. by Seth Eilbott 
  2278.  
  2279. So, how does one go about choosing a product to develop a graphical user 
  2280. interface for a new product?  We did it by accessing our needs and researching 
  2281. our options.  Our tool of choice was the IBM Graphics Interface Kit/2 (GIK/2) 
  2282. product.  This article gives some perspectives on a real-life use of GIK/2. 
  2283.  
  2284. One of the great features of GIK/2 is its ability to separate the handling of 
  2285. the graphics from the handling of the code.  Here are two examples: 
  2286.  
  2287. o GIK/2 was able to handle all of the aspects of graphics manipulation, which 
  2288.   freed up the User Interface team from worrying about the details of the 
  2289.   graphics.  That meant we could concentrate on writing the code to implement 
  2290.   features.  For example, a collapsed (closed) category is shown as a closed 
  2291.   CD-ROM jewel case, while an expanded category is shown as an open jewel case. 
  2292.   Both images first were created as standard OS/2 icons.  Then, GIK/2's design 
  2293.   tool let us import these icons into separate parts of the category symbol. 
  2294.   To change a category graphic from one state to the other, The Developer 
  2295.   Connection user-interface code simply had to tell GIK/2 to hide one part and 
  2296.   to show the other.  No PM calls were required of our code; GIK/2 magically 
  2297.   handled the code details. 
  2298.  
  2299. o GIK/2 was able to hide the details of the product icon manipulation in a 
  2300.   similar manner to the graphics manipulation.  Even though different icons are 
  2301.   shown for the different products, we actually used only a single symbol 
  2302.   definition.  At runtime, we issue a single GIK/2 call that loads a different 
  2303.   icon for each product and shows that icon in the window. 
  2304.  
  2305. Another feature we liked was the ability to use our interface as an editor. 
  2306. While this mode is not part of the distributed interface, we used this mode of 
  2307. GIK/2 to create the catalog that you see.  In edit mode, we have incorporated 
  2308. drag-and-drop support, so that we can place the categories and product in the 
  2309. exact order we want.  We can also use edit mode to enter all the details for 
  2310. each of the categories. 
  2311.  
  2312. In a nutshell, IBM's GIK/2 drastically reduced our development time.  It 
  2313. allowed us to concentrate on the internal processing of The Developer 
  2314. Connection user interface, without worrying on the external processing. 
  2315.  
  2316.  
  2317. About the Author 
  2318.  
  2319. Seth Eilbott has been with IBM since 1982 and is currently an Advisor Program 
  2320. responsible for The Developer Connection for OS/2's User Interface.  Seth has 
  2321. had many differennt roles at IBM, including working on the Blockbuster and 
  2322. ImagePlus/2 products. 
  2323.  
  2324.  
  2325. ΓòÉΓòÉΓòÉ 16. Borland C++ for OS/2 Means Business ΓòÉΓòÉΓòÉ
  2326.  
  2327. by Michael Hyman 
  2328.  
  2329. Object-oriented programming (OOP) has revolutionized the way people develop 
  2330. software.  This technological breakthrough enables software developers to 
  2331. quickly and easily develop more graphical, functional, and intuitive software, 
  2332. as evidenced by Borland's own use of OOP technology to many of their own 
  2333. products. 
  2334.  
  2335. The acceptance of OOP is a growing industry trend, and Borland is one of the 
  2336. leading suppliers of OOP languages and tools.  With the release of Borland C++ 
  2337. for OS/2, Borland brings its expertise to bear on a product that will become 
  2338. the standard for dev elopment of OS/2 2.x applications.  Whether you are using 
  2339. OS/2 to run DOS and Windows applications, or to take advantage of the 32-bit 
  2340. multithreaded capabilities of native OS/2, Borland has a C++ compiler to meet 
  2341. your needs. 
  2342.  
  2343. Borland C++ for OS/2 provides users with a GUI-based integrated development 
  2344. environment, global optimization, support for C++ 3.0, object-oriented 
  2345. debugging, precompiled headers, and smart project management.  Borland C++ for 
  2346. OS/2 takes advantage of the OS/2 operating system to provide integrated and 
  2347. stand-alone GUI debugging, as well as support for multiple threads and 
  2348. background compilation. 
  2349.  
  2350.  
  2351. ΓòÉΓòÉΓòÉ 16.1. Fast 32-Bit Optimizing Compiler ΓòÉΓòÉΓòÉ
  2352.  
  2353. Borland C++ for OS/2 runs under OS/2 host systems and creates 32-bit 
  2354. applications for OS/2 2.x.  The compiler produces 32-bit object code, supports 
  2355. development of multithreaded applications and mixed-mode programming in OS/2 
  2356. (16-bit calls from within 32-b it executables), and supports the OS/2 calling 
  2357. convention.  This allows developers to create OS/2 2.x executables, libraries, 
  2358. and DLLs, as well as text-mode programs and Presentation Manager (PM) 
  2359. applications. 
  2360.  
  2361. Borland C++ for OS/2 offers programmers state-of-the-art global optimizations 
  2362. for 386 and 486 processors, such as dead-storage elimination, local-common 
  2363. subexpression elimination, global-register allocation, and intrinsic expansion. 
  2364. These optimizations h elp developers create fast, tight code. 
  2365.  
  2366. Plus, Borland C++ for OS/2 is a 32-bit application that lets you deliver 
  2367. solutions quickly.  It lets programmers develop in C++ (compatible with AT&T's 
  2368. cfront C++ 3.0) or in 100% ANSI-compatible C. The combination of C++ and C lets 
  2369. developers program in either or both languages, and eases the transition from C 
  2370. to C++.  The included Turbo Assembler for OS/2 lets programmers easily include 
  2371. assembly-language routines in their applications. 
  2372.  
  2373.  
  2374. ΓòÉΓòÉΓòÉ 16.2. Easy-to-Use Development Environment ΓòÉΓòÉΓòÉ
  2375.  
  2376. Borland C++ for OS/2 features Borland's productivity enhancing integrated 
  2377. development environment (IDE), which runs as a PM application.  The GUI 
  2378. development environment integrates features, such as a SpeedBar that 
  2379. graphically presents commonly-used comma nds, integrated debugging, pull-down 
  2380. menus, color-syntax highlighting, multiple-edit windows, and dialog boxes that 
  2381. greatly increase productivity by reducing the time necessary to edit, compile, 
  2382. and debug a program. 
  2383.  
  2384. The IDE takes advantage of the multithread capability of OS/2 2.x and permits 
  2385. compilation of source files in the background, letting the developer perform 
  2386. other activities, such as editing, without stopping to wait for the compilation 
  2387. to finish.  This capability results in higher programmer productivity. 
  2388.  
  2389. Help for all components of Borland C++ for OS/2 and for PM API is available 
  2390. on-line. 
  2391.  
  2392. Borland's IDE contains a powerful program editor.  In addition to providing 
  2393. completely customizable color-syntax highlighting, and the normal editor 
  2394. features, such as cut, paste, search, and replace, the editor includes column 
  2395. blocking, variable indent an d outdent, case conversion, single keystroke 
  2396. recording, and regular expression matching.  These features make creating and 
  2397. editing code a pleasure. 
  2398.  
  2399.  
  2400. ΓòÉΓòÉΓòÉ 16.3. Integrated GUI Debugging ΓòÉΓòÉΓòÉ
  2401.  
  2402. Borland C++ for OS/2 provides full-featured, integrated GUI debugging, allowing 
  2403. developers to debug applications under PMwithout leaving the development 
  2404. environment.  This provision makes it easy to catch and fix bugs. 
  2405.  
  2406. Figure 1. The IDE is a high-productivity environment that lets you edit, 
  2407. compile, debug, and run your applications.
  2408.  
  2409.  
  2410. ΓòÉΓòÉΓòÉ 16.4. Turbo Debugger GX ΓòÉΓòÉΓòÉ
  2411.  
  2412. Borland C++ for OS/2 includes a stand-alone debugger, in addition to the 
  2413. integrated debugger.  Turbo Debugger GX offers users a graphical, source-level 
  2414. solution for debugging applications running on OS/2 host systems.  Developers 
  2415. can debug single and mult ithread OS/2 and PM applications.  The debugger 
  2416. offers programmers the maximum flexibility to debug a wide range of 
  2417. applications in a convenient environment. 
  2418.  
  2419. The debugger provides full support for C and C++, as well as for debugging 
  2420. optimized code.  Executable lines are graphically distinguished from comments, 
  2421. declarations, and code removed by the optimizer, making it much easier to 
  2422. understand code as you trace through it. 
  2423.  
  2424. Turbo Debugger makes special use of screen real estate, intelligently showing 
  2425. more information as you expand the size of the debugger windows.  Object 
  2426. inspectors are used throughout.  You can simply click on any line of code to 
  2427. inspect variables, set breakpoints, change values, or get more information 
  2428. about a structure.  And glyphs in the source windows display additional 
  2429. information about code properties. 
  2430.  
  2431. Figure 2. Turbo Debugger GX offers developers a sophisticated, easy-to-use debugger.
  2432.  
  2433. You can view source code (Source, Modules), data (Watch, Variable, Evaluator), 
  2434. hardware information (Disassembly, Register, Stack, Numeric Processor), memory 
  2435. (Heap, Memory), and operating system details (Exceptionpoint).  All are 
  2436. accessible with simple mouse clicks. 
  2437.  
  2438. There is full support for traditional breakpoints, which perform an action 
  2439. (such as a break, log, or expression evaluation) when a particular point is 
  2440. encountered in code, as well as messagepoints (which act on encountering a PM 
  2441. message or messages), datapoints (which act when the contents of a memory 
  2442. address change), and exceptionpoints (which act when an exception is received 
  2443. from the OS/2 kernel). 
  2444.  
  2445. Turbo Debugger GX also supports hard- and soft-mode debugging.  With hard-mode 
  2446. debugging, when the debugger has control, only the debugger receives messages 
  2447. from PM.  In this situation, the debugger traps the messages to all other 
  2448. processes.  Soft-mode debugging lets other processes receive PM messages, as 
  2449. during normal operation. 
  2450.  
  2451.  
  2452. Borland History 
  2453.  
  2454. Borland International Incorporated is one of the leading developers and 
  2455. marketers of business application software and programming products.  Borland 
  2456. is one of the industry's largest personal computer companies, and a premeir 
  2457. supplier of database software.  In addition to its prominence in the United 
  2458. States, Borland is a global competitor with subsidiaries, sales offices, and 
  2459. distributors worldwide.  Michael Hyman is a Senior Product Manager for Borland 
  2460. International Incorporated. 
  2461.  
  2462.  
  2463. ΓòÉΓòÉΓòÉ 17. IBM Device Driver Source Kit for OS/2 ΓòÉΓòÉΓòÉ
  2464.  
  2465. by Judith A. Courter 
  2466.  
  2467. Does your hardware support the OS/2 operating system?  Are you writing device 
  2468. drivers for your own or other company's hardware?  Now, writing device drivers 
  2469. for OS/2 has been made easier with the release of the IBM Device Driver Source 
  2470. Kit for OS/2 (DDK). 
  2471.  
  2472. Imagine a kit containing over 80MB of complete, buildable source code of actual 
  2473. OS/2 2.1 device drivers--not just samples!  Then imagine that this code comes 
  2474. with great support directly from the OS/2 Driver Development Support Center. 
  2475. Well, that's exactly what the DDK program provides for you. 
  2476.  
  2477. This article describes the contents of Version 1.0.  The next update is planned 
  2478. to be release within the next 2 months. 
  2479.  
  2480.  
  2481. ΓòÉΓòÉΓòÉ 17.1. Device Driver Source Code Contained in the DDK ΓòÉΓòÉΓòÉ
  2482.  
  2483. The DDK contains the full source code for OS/2 2.1 drivers for the following 
  2484. devices: 
  2485.  
  2486. Displays                           Printers 
  2487. CD-ROMs                            DASD 
  2488. SCSI                               Diskettes 
  2489. Keyboards                          Mouse 
  2490. Serial Communications              8516 Touch Devices 
  2491. Pen for OS/2                       MMPM/2 
  2492.  
  2493.  
  2494. ΓòÉΓòÉΓòÉ 17.2. Verification Test Tools Contained in the DDK ΓòÉΓòÉΓòÉ
  2495.  
  2496. In addition to all the device driver source code, the DDK gives you the 
  2497. following verification test tools: 
  2498.  
  2499. PALDISP             Displays the hardware palette in a PM window.  Used to 
  2500.                     debug palette manager enabled PM display drivers. 
  2501.  
  2502. PALTEST             Performs general palette manager testing for PM display 
  2503.                     drivers. 
  2504.  
  2505. DTT                 Display test tool that performs tests for all mandatory 
  2506.                     graphics rendering engine (GRE) functions for display 
  2507.                     drivers. 
  2508.  
  2509. PTT                 Printer test tool that performs tests for all mandatory GRE 
  2510.                     functions for printer drivers. 
  2511.  
  2512. PENTL               Pen for OS/2 test tool that is used to call and test the 
  2513.                     Pen for OS/2 device driver.  It provides a means to control 
  2514.                     and query all aspects of the Pen for OS/2 device driver. 
  2515.  
  2516. ADDE                MMPM/2 audio device driver exerciser tool that allows 
  2517.                     exercising the functions in MMPM/2 Audio Device Drivers at 
  2518.                     the stream programming interface (SPI) API level. 
  2519.  
  2520. P2STRING            MMPM/2 P2 string test tool that allows testing of the 
  2521.                     MMPM/2 system at the media control interface (MCI) API 
  2522.                     level. 
  2523.  
  2524.  
  2525. ΓòÉΓòÉΓòÉ 17.3. Online Documentation Contained in the DDK ΓòÉΓòÉΓòÉ
  2526.  
  2527. Use the OS/2 VIEW command or open the IBM DDK folder to view the many books 
  2528. that are available online.  Take a few moments to browse through all the 
  2529. information that is shipped with the product.  We provide everything from 
  2530. general information to references on all the supported device drivers.  If, 
  2531. however, you would like a hardcopy of any of the books, simply order them 
  2532. through the DDK order number. 
  2533.  
  2534.  
  2535. ΓòÉΓòÉΓòÉ 17.4. Ease of Installation ΓòÉΓòÉΓòÉ
  2536.  
  2537. The IBM Device Driver Source Kit for OS/2 is available on a CD-ROM.  Install 
  2538. the DDK directly from your CD-ROM root directory.  The installation allows for 
  2539. selected installation or installation of the entire kit.  For example, you can 
  2540. install just the prin ter drivers, the common files, build tools, or printer 
  2541. documentation.  As components are selected from the Install directories  panel, 
  2542. the bytes needed  appear by the installation program that identifies an 
  2543. approximation of the number of bytes of free space, including Installation 
  2544. program work files, that will be required to perform an installation on a drive 
  2545. formatted FAT.  When installing on an HPFS formatted drive, significantly less 
  2546. space is required. 
  2547.  
  2548.  
  2549. ΓòÉΓòÉΓòÉ 17.5. OS/2 Driver Development Support ΓòÉΓòÉΓòÉ
  2550.  
  2551. Signing up for the IBM DDK entitles you to become a member of the OS/2 Driver 
  2552. Development Support Center (DDSC).  Do this by connecting to the IBM DDSC Team. 
  2553. This team provides worldwide support for all device driver developers. Send 
  2554. your technical development questions using a PC and modem. 
  2555.  
  2556. You can reach the DDSC computer system by dialing up (407) 982-3217.  After 
  2557. self-registration, you have limited access to the system.  Additional 
  2558. information on DDSC operations and system operations are presented on the 
  2559. system.  Within 24 hours, you are contacted and, following verification of the 
  2560. registration information, are granted full access to the system. 
  2561.  
  2562.  
  2563. ΓòÉΓòÉΓòÉ 17.6. Future Plans ΓòÉΓòÉΓòÉ
  2564.  
  2565. It doesn't end here!  This is not just a kit, it is a program.  As new OS/2 
  2566. device drivers become available, and as enhancements and fixes to existing 
  2567. drivers are made, they will be packaged and distributed to those who sign up 
  2568. for the program.  The program entitles you to all updates made available within 
  2569. one year from ordering the DDK. 
  2570.  
  2571.  
  2572. ΓòÉΓòÉΓòÉ 17.7. Special Promo Offer ΓòÉΓòÉΓòÉ
  2573.  
  2574. Don't miss out!  For a limited time you can acquire the DDK CD-ROM for a 
  2575. one-time charge of ony $149.00 as a program product or $59.00 as a single 
  2576. issue.  (The $149.00 price includes all updates for one year.)  This is a 
  2577. savings from the $499.00 regular price.  This offer ends September 22, 1993. 
  2578. Call today to become a member of the DDK program: 
  2579.  
  2580. 1-800-6DEVCON
  2581.  
  2582.  
  2583. ΓòÉΓòÉΓòÉ 18. Conference Column ΓòÉΓòÉΓòÉ
  2584.  
  2585. Look to this column each issue for the most up-to-the-minute information on 
  2586. OS/2 conferences.  Be sure to register for these conferences early, as you 
  2587. don't want to be left out! 
  2588.  
  2589.  
  2590. ΓòÉΓòÉΓòÉ 18.1. PSP OS/2 Technical Interchanges ΓòÉΓòÉΓòÉ
  2591.  
  2592. The wave of the future is coming to the next OS/2 Technnical Interchange! This 
  2593. conference will be extremely valuable to the following groups: 
  2594.  
  2595. o Software Designers 
  2596. o Independent and Corporate Developers 
  2597. o Technical Coordinators 
  2598. o LAN Experts 
  2599. o MIS Managers 
  2600. o Consultants 
  2601. o Training Executives 
  2602. And, let's not forget all the premiums!  Registering for this conference brings 
  2603. with it many extra that are actually worth more than the conference fee.  So 
  2604. make your reservations today! 
  2605.  
  2606. Where          Lake Buena Vista (Orlando), Florida at the Walt Disney World 
  2607.                Dolphin Hotel 
  2608.  
  2609. When           August 29  to September 2 
  2610.  
  2611. Contact        US & Canada: 1-800-872-7109 
  2612.                 All other Countries: 1-508-443-4990 
  2613.  
  2614.  
  2615. ΓòÉΓòÉΓòÉ 18.2. OS/2 Professional Interchange ΓòÉΓòÉΓòÉ
  2616.  
  2617. Sponsered by OS/2 Professional and IBM's Independent Vendor League, the annual 
  2618. OS/2 Professional Interchange will bring you together with the people who are 
  2619. shaping the future of OS/2 computing. 
  2620.  
  2621. Where          Palm Desert, California at the Marriot's Desert Springs Resort 
  2622.                and Spa 
  2623.  
  2624. When           October 17 to October 20 
  2625.  
  2626. Contact        US: 1-800-438-6700 
  2627.                All other countries: 1-203-261-6227 
  2628.                1-203-261-3884  (fax) 
  2629.  
  2630.  
  2631. ΓòÉΓòÉΓòÉ 18.3. ColoradOS/2 Developer's Conference ΓòÉΓòÉΓòÉ
  2632.  
  2633. Wayne Kovsky is holding "the only conference put on by a software engineer for 
  2634. software engineers."  So, expect topics to range from IBM C Set ++ to SOM to 
  2635. object-oriented REXX. 
  2636.  
  2637. Where          Colorado Springs, Colorado at the Cheyenne Mountain Resort 
  2638.  
  2639. When           October 31 to  November 5 
  2640.  
  2641. Contact        Wayne Kovsky at 1-719-481-3389 (phone) 
  2642.                1-719-481-8069 (fax) 
  2643.  
  2644.  
  2645. ΓòÉΓòÉΓòÉ 18.4. Trade Shows ΓòÉΓòÉΓòÉ
  2646.  
  2647. The following are some of the major trade shows for the remainder of the year. 
  2648.  
  2649. What           CAMP 
  2650. Where          Chicago, Illinois 
  2651. When           September 9 
  2652. Contact        1-708-291-1360 
  2653.  
  2654. What           NetWorld 
  2655. Where          Dallas, Texas 
  2656. When           October 5 to October 8 
  2657. Contact        1-800-829-3976 
  2658.  
  2659. What           PC Expo 
  2660. Where          Chicago, Illinois 
  2661. When           October 19 to October 21 
  2662. Contact        1-800-829-3976 
  2663.  
  2664. What           Fall '93 /COMDEX 
  2665. Where          Las Vegas, Nevada 
  2666. When           November 15 to November 19 
  2667. Contact        US: 1-617-449-6600 Ext. 4023 
  2668.                1-617-444-0165  (fax) 
  2669.                174273  (telex) 
  2670.  
  2671.  
  2672. ΓòÉΓòÉΓòÉ 19. Question and Answers ΓòÉΓòÉΓòÉ
  2673.  
  2674. Q.  Which CD-ROM drives does OS/2 2.1 support? 
  2675.  
  2676. A.  Although the list of OS/2 2.1-supported CD-ROM drives is constantly 
  2677. growing, the following list is accurate as of press time: 
  2678.  
  2679. o CD Technology (Model T3301) 
  2680. o Hitachi (Models CDR-1650S, CDR-1750S, CDR-3650, and CDR-3750) 
  2681. o IBM (All  models) 
  2682. o NEC (Models CDR-25, CDR-36, CDR-37, CDR-38, CDR-72, CDR-73, CDR-74, CDR-82, 
  2683.   CDR-83, CDR-84, Multispin 38, Multispin 74, and Multispin 84) 
  2684. o Panasonic (Models CR-501, LK-MC501S, MC501B, and MC521) 
  2685. o Pioneer (Models DRM-600 and DRM-604X) 
  2686. o Sony (Models CDU-541, CDU-561, CDU-6111, CDU-6211, and CDU-7211) 
  2687. o Texel (Models DM-3021, DM-3024, DM-5021, and DM-5024) 
  2688. o Toshiba (Models XM-3201, XM-3301, and XM-3401) 
  2689. These CD-ROM drives must be attached to IBM, Future Domain, Adaptec, DPT, or 
  2690. other SCSI adapters with native OS/2 2.1 support. 
  2691.  
  2692. Additionally, OS/2 2.1 CD-ROM support includes audio, ISO 9660/High Sierra, 
  2693. CD-ROM/XA, and Kodak Photo CD-compatibility for those drives that support these 
  2694. standards. 
  2695.  
  2696. Note:  You also can obtain a list of the CD-ROM drives that are supported by 
  2697.        your version of OS/2 by performing the following: 
  2698.  
  2699.  1. Double-click on the OS/2 System folder.  The folder opens displaying a 
  2700.     number of additional folders. 
  2701.  
  2702.  2. Double-click on the System Setup folder. The folder opens displaying a 
  2703.     number of objects. 
  2704.  
  2705.  3. Double click on the Selective Install object.  The System Configuration 
  2706.     pop-up window appears. 
  2707.  
  2708.  4. Use your mouse to put a checkmark in the CD-ROM Device Support box. 
  2709.  
  2710.  5. Click on OK.  A pop-up window appears showing the list of supported CD-ROM 
  2711.     drives Use the scroll arrows to see if your CD-ROM drive is supported. 
  2712.  
  2713. Q.  Why don't I receive any output when I send a print job to the printer over 
  2714. the LAN, even though the job gets spooled?  This is a job that will print on a 
  2715. local printer. 
  2716.  
  2717. A.  To resolve the problem, change the CONFIG.SYS file on the server as 
  2718. follows: 
  2719.  
  2720. PRINT MONBUFSIZE=134,134,134
  2721.  
  2722.           to
  2723.  
  2724. PRINT MONBUFSIZE=2048,134,134
  2725.  
  2726. This change will set the parallel-port device driver buffersize.  Each number 
  2727. corresponds to the buffer size for LPT1, LPT2, or LPT3, respectively.  The 
  2728. minimum value that you can specify is 134 bytes; the maximum value is 2048 
  2729. bytes.  Changing these valu es will increase the size of the parallel-port 
  2730. device-driver buffers.  This, in turn, increases the performance of data 
  2731. transfer to devices that are connected to the parallel ports. 
  2732.  
  2733. Q.  Why does a 16-bit OS/2 application run in an OS/2 full-screen session, but 
  2734. fail in an OS/2 window session? 
  2735.  
  2736. A.  An OS/2 full-screen session is a native OS/2 environment, whereas the OS/2 
  2737. window screen session is a PM environment.  That is, the OS/2 window session 
  2738. actually has the application running as a child process under the OS/2 
  2739. PresentationManager application (which is considered the parent process). 
  2740.  
  2741. The failure is usually an access violation (TRAP 0005 or SYS3175) in the 
  2742. DosCall.DLL, PMWin.DLL, or PMGRE.DLL module.  This can happen during the 
  2743. conversion of 16-bit API requests into 32-bit API requests or vice-versa This 
  2744. conversion process is known as thunking, or more specifically 16-to-32-bit 
  2745. thunk or 32-to-16-bit thunk.  Because OS/2 2.0 and higher run in 32-bit 
  2746. environments, thunking occurs, to some degree, for 32-bit applications. 
  2747.  
  2748. Memory is overwritten at a point that is decimal 2608 bytes (0a30 hex) from the 
  2749. top the applications stack.  Specifically, if the bottom of the stack is at hex 
  2750. 00b0 and the top of the stack is at hex 1060 then memory at the location of 
  2751. 10b0 hex minus 0a30 hex is overwritten (0a30 hex).  This can cause a problem if 
  2752. the stacksize is smaller then decimal 4096 bytes, because the area that is 
  2753. overwritten can fall into the data variable area of the application. 
  2754.  
  2755. To avoid this, application developers should use a module.DEF file that 
  2756. contains a minimum Stacksize of 4096 bytes or larger, along with a Heapsize of 
  2757. 4096 bytes.  This overrides the language compiler/linker default Stack and Heap 
  2758. sizes. 
  2759.  
  2760. With the OS/2 Toolki, you can use the following work-a-round.  Run the EXEHDR 
  2761. utility to change the Stacksize and Heapsize of the application's exetable 
  2762. module.  As an illustration: 
  2763.  
  2764.  1. At the OS/2 command prompt, type: 
  2765.  
  2766.         EXEHDR myapp.exe
  2767.  
  2768.     (where myapp.exe is the name of the application's exectable module.) 
  2769.  
  2770.     The Stack size will appear; for example: 
  2771.  
  2772.         Extra stack allocation:    0964 bytes
  2773.  
  2774.  2. Increase your Stacksize and Heapsize to a minimum of hex 2000 bytes larger 
  2775.     than required by your application's executable module.  For example, use 
  2776.     the following command to to set a Stacksize of decimal 6500 bytes and a 
  2777.     Heapsize of decimal 4096 bytes: 
  2778.  
  2779.         EXEHDR /STACK:6500 /HEAP:4096 myapp.exe
  2780.  
  2781. Q.  When I use the IBM C Set++ Compiler, does the appropriate event handling 
  2782. function get called if my class contains a pointer to an IHandler? In other 
  2783. words, if I have the following window class and a command handler: 
  2784.  
  2785.     class MyWindow : public IDialogWindow {
  2786.               IHandler *p;
  2787.         public:
  2788.             MyWindow(IHandler *x) : p(x) {
  2789.         //...
  2790.        }
  2791.        //...
  2792.     };
  2793.     class MyCmdHandler  : public ICommandHandler  {
  2794.        //...
  2795.         Boolean command (ICmdEvents&);
  2796.      };
  2797.  
  2798.      void main() {
  2799.              MyCmdHandler mycmdhandler;
  2800.              MyWindow mywindow(mycmdhandler);
  2801.             //...
  2802.      }
  2803.  
  2804. will MyCmdHandler::command() get called for WM_COMMAND? 
  2805.  
  2806. A.  Your handler will work just fine.  The message dispatching code calls the 
  2807. handler's dispatch HandlerEvent function.  In your case, this will be the 
  2808. implementation you inherit from ICommandHandler.  This function will call this 
  2809. >command(), which you've reimplemented and this will invoke your command() 
  2810. function.  This is the justification for C++ virtual functions. 
  2811.  
  2812. Q.  When using the C Set ++ Compiler, I can't set any form of breakpoints in 
  2813. source view.  I can set them in disassembly view.  Why? 
  2814.  
  2815. A.  You must set the breakpoints by double-clicking in the PREFIX area of an 
  2816. EXECUTABLE in the Program View windows.  If the statement is not executable 
  2817. (usually it will be shown in a different color), you won't be able to set the 
  2818. breakpoint there. 
  2819.  
  2820. Note:  Be aware that most people who have this problem are not using the right 
  2821.        linker.  This can cause the debugger to lose track of which lines of 
  2822.        source code relate to the actual code that is running. 
  2823.  
  2824.  
  2825. ΓòÉΓòÉΓòÉ 20. Directory ΓòÉΓòÉΓòÉ
  2826.  
  2827. Ever wonder where to call to order a product or to voice a particular problem 
  2828. or concern.  Well, we believe it's our job to let you know how to contact IBM. 
  2829. Watch this space; we'll continually update this information. 
  2830.  
  2831. The Developer Connection for OS/2            1-800-6DEVCON (phone) 
  2832.                                              1-800-494-3045 (fax) 
  2833.  
  2834. Additional Order Numbers 
  2835.  
  2836. To order in Europe: 
  2837.  
  2838. England             45-3-252-6588 
  2839. Germany             45-3-252-6711 
  2840. France              45-3-252-7411 
  2841. Spain               45-3-252-6311 
  2842. Italy               45-3-252-7622 
  2843. Netherlands         45-3-252-7088 
  2844. FAX                 45-3-252-8203 
  2845.  
  2846. To order in Canada: 
  2847.  
  2848. 1-800-465-7999 (phone) 
  2849. 1-416-946-5700 (fax) 
  2850.  
  2851. To order in Asia/Pacific: 
  2852.  
  2853. 61-2-354-7684 (phone) 
  2854. 61-2-354-7766 (fax) 
  2855.  
  2856. Stay in touch with The Developer Connection for OS/2 team by writing to: 
  2857.  
  2858. The Developer Connection for OS/2 
  2859. IBM Corporation 
  2860. Internal ZIP 1599 
  2861. PO Box 1328 
  2862. Boca Raton, Florida  33429-1328 
  2863. USA 
  2864.  
  2865. Electronic Support 
  2866.  
  2867. Electronic support is provided through CompuServe.  Obtain technical support or 
  2868. use the forum to exchange messages, ideas, comments, or concerns with The 
  2869. Developer Connection for OS/2 team or other members.  The dedicated Developer 
  2870. Connection section is located in the IBM OS/2 Developer Forum 2. To obtain 
  2871. access to this section, please send a note with your subscription number to the 
  2872. Developer Connection Administrator at CompuServe user id 73423,2767.  You will 
  2873. receive notification or access to the Developer Connection section within 2 
  2874. business days. 
  2875.  
  2876. To access the forum, type GO OS2DF2 at the ! prompt; then, select the Developer 
  2877. Connection section. 
  2878.  
  2879. For CompuServe membership information, call 1-800-524-3388, and ask for 
  2880. Representative 239.  You will receive a special introductory membership for IBM 
  2881. customers. 
  2882.  
  2883. The Device Driver Source Kit for OS/2             1-800-6DEVCON (phone) 
  2884.                                                   1-407-982-3217 (modem) 
  2885.                                                   1-407-982-4239 (voice) 
  2886.  
  2887. Obtain support for the IBM DDK kit by calling the Dynamic Upload/Download 
  2888. Environment (DUDE) BBS.  After completing a self-registration, you will first 
  2889. have limited access to the system; then, within one business day, you will be 
  2890. notified that your access level has been upgraded to NORMAL.  Send your 
  2891. questions using your PC and modem. 
  2892.  
  2893. If you have problems connecting to the DUDE BBS, you can leave a voice message 
  2894. on 1-407-982-4239.  A member of the DDSC team will return your call before the 
  2895. end of the next business day. 
  2896.  
  2897. OS/2 2.1 Technical Support                        1-800-992-4777 
  2898.  
  2899. When you buy OS/2 2.1, you also receive 60 days of free technical support.  The 
  2900. OS/2 technical support team will provide assistance with installing OS/2 2.1, 
  2901. setting up printers and displays, partitioning disk drives, setting up to run 
  2902. multiple operating systems, moving commercial programs to folders or to the 
  2903. OS/2 desktop, and installing and using Multimedia.  You can also report 
  2904. suspected product defects to the technical support team. 
  2905.  
  2906. Electronic Support (U.S. and Puerto Rico only) 
  2907.  
  2908. Electronic support enables you to access current OS/2 technical information, 
  2909. exchange messages with other OS/2 users, and submit program defects to IBM. 
  2910. Electronic support is available to users with a modem and a telephone line 
  2911. through the OS/2 Bulletin Board System (BBS) or CompuServe. 
  2912.  
  2913. For information about registration and access to the IBM OS/2 BBS, call 
  2914. 1-800-547-1283. 
  2915.  
  2916. For CompuServe membership information, call 1-800-848-8199. 
  2917.  
  2918. If you are already a CompuServe member, type GO OS2SUP at the ! prompt to 
  2919. access the IBM OS/2 forum. 
  2920.  
  2921. Electronic Support (Canada only) 
  2922.  
  2923. Electronic Support enables you to access current OS/2 technical information and 
  2924. exchange messages with other OS/2 users.  Electronic support is available to 
  2925. users with a modem and a telephone line through an OS/2 BBS. 
  2926.  
  2927. You can connect directly to the OS/2 BBS nearest you by dialing one of the 
  2928. following numbers: 
  2929.  
  2930. 1-416-946-4255 
  2931. 1-514-938-3022 
  2932. 1-604-664-6466 
  2933.  
  2934. Note:  Set your modem and communication software to the following:  no parity 
  2935.        bit, 8 data bits, 1 stop bit. 
  2936.  
  2937. The Developer Assistance Program 
  2938.  
  2939. The Developer Assistance Program (DAP) is a worldwide porgram that offers 
  2940. services to software developers.  Specific services vary by country and 
  2941. development platform.  For more information about the DAP, call: 
  2942.  
  2943. U.S.                1-407-982-6408 (phone) 
  2944.                     1-407-998-7610 (fax) 
  2945.  
  2946. Worldwide           1-407-982-4259 (phone) 
  2947.  
  2948. Additional Phone Numbers 
  2949.  
  2950. All 800 numbers are applicable in the USA only; for individual country numbers, 
  2951. please check on your local BBS or your IBM Representative. 
  2952.  
  2953. IBM Academic Information Systems Ordering Information 1-800-222-7257 
  2954.  
  2955. IBM Direct Marketing               1-800-IBM-2YOU 
  2956. Order IBM ValuePoint systems, IBM ThinkPad systems, IBM Communication and LAN 
  2957. hardware and software, memory options, printer, and typerwriter supplies. 
  2958. HOURS:  8:00 a.m.  - 10:00 p.m.  EST. 
  2959.  
  2960. IBM FAX Information Service        1-800-IBM-4FAX 
  2961. Retrieve information on IBM products with your fax machine. 
  2962.  
  2963. IBM LAN Systems Service and Support 1-800-237-5511 
  2964. Technical support for custumers who own LAN Systems products. 
  2965.  
  2966. IBM PC Dealer Referral             1-800-237-4824 
  2967. Locate an IBM dealer nearest you. 
  2968.  
  2969. IBM Personal Systems Help Center   1-800-PS2-2227 
  2970. Obtain general information and technical support on ValuePoint systems, 
  2971. ThinkPad systems, PS/2, and OS/2 products.  HOURS:  24-hours a day. 
  2972.  
  2973. IBM PS/2 Technical Support Line    1-800-237-5511 
  2974.                                    1-800-992-4777 
  2975. 60-days of free technical support after purchase of OS/2.  Additional support 
  2976. is available at US$129.95 per year.  HOURS:  24-hours a day. 
  2977.  
  2978. Independant Vendor League 
  2979. The Independant Vendor League was formed to meet the specific needs of 
  2980. individuals and companies who develop and market products and services that 
  2981. support OS/2.  It is an association of vendors whose common ground is the IBM 
  2982. OS/2 marketplace. 
  2983.  
  2984.    To join or to receive information         1-203-262-3769 
  2985.                                              1-203-262-3776 
  2986.    To order an IVL Catalog                   1-800-342-6672 
  2987.  
  2988. Multimedia Help LIne               1-800-241-1620 
  2989. Obtain technical support for the Multimedia Presentation Manager/2 product. 
  2990.  
  2991. Multimedia Information Center      1-800-IBM-9402 
  2992. Obtain informaiton on the Multimedia Presentation Manager/2 product. 
  2993.  
  2994. OS/2 and IBM LAN Systems Sales     1-800-3-IBM-OS2 
  2995. Purchase OS/2 and IBM LAN Systems products by phone. 
  2996.  
  2997. Ultimedia Tool Series              1-800-228-ULTI 
  2998. Obtain technical support on the Ultimedia tool series.