home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 15 Message / 15-Message.zip / oe991120.zip / Pr991119.txt < prev    next >
Text File  |  1999-11-20  |  38KB  |  979 lines

  1.  
  2.                   OS/2 Programming                 (Fidonet)
  3.  
  4.                  Saturday, 13-Nov-1999 to Friday, 19-Nov-1999
  5.  
  6. +----------------------------------------------------------------------------+
  7.  
  8. From: Herbert Rosenau                                   11-Nov-99 22:05:29
  9.   To: Jonathan de Boyne Pollard                         13-Nov-99 01:05:25
  10. Subj: PROMPT $I in PMCMD
  11.  
  12.  JdBP> So I'm looking for an efficient way of drawing characters to a
  13.  JdBP> presentation space during a WM_PAINT event myself. 
  14.  
  15. If you have a lot of painting you should do it in a separate thread.
  16.  
  17. That thread should be an PM thread. There you can create a memory presentation 
  18. space and paint what ever you have to paint - hidden and asyncronous.
  19.  
  20. If your real presentation space is object to repaint you can simply do a
  21. GpiBitBlt() and copy the whole region or simple one or more rectangle(s) from
  22. your memory hps into that of your window. 
  23.  
  24. A simple trick to tune up high frequently changes on your screen is to paint
  25. into more memory presentation spaces parallel and copy the one you need to
  26. show into the screen PS.
  27.  
  28. In case you would use that in WM_PAINT you have to change the lines 
  29.  
  30. hdcScreen = ...
  31. hpsScreen = ...
  32.  
  33. to 
  34.  
  35. hpsScreen = WinBeginPaint(.....
  36.  
  37.  
  38. A sample from GPI Guide and Reference:
  39.  
  40. ----------------------------Abbeißen-----------------------
  41.  
  42.  This example uses GpiBitBlt to copy a bit map from one presentation space to
  43. another. Two presentation spaces are 
  44.  created: one associated with a memory context, and the other associated with
  45. a screen context. The function copies the 
  46.  memory context bit map that is 100 pels wide and 100 pels high into a
  47. 50-by-50-pel rectangle at the location (300,400) on 
  48.  the screen, thereby causing the bit map to be visible in the window. Since
  49. the raster operation is ROP_SRCCOPY, GpiBitBlt 
  50.  replaces the image previously in the target rectangle. The function
  51. compresses the bit map to fit the new rectangle by 
  52.  discarding extra rows and columns as specified by the BBO_IGNORE option. 
  53.  
  54.  #define INCL_GPIBITMAPS         /* Bit map functions            */
  55.  #define INCL_DEV                /* Device Function definitions  */
  56.  #define INCL_GPICONTROL         /* GPI control Functions        */
  57.  #define INCL_WINWINDOWMGR       /* Window Manager Functions     */
  58.  #include <os2.h>
  59.  
  60.  HAB     hab;            /* anchor-block handle                  */
  61.  HPS    hpsMemory;       /* presentation-space handle            */
  62.  HPS    hpsScreen;       /* presentation-space handle            */
  63.  HDC    hdcScreen;       /* Device-context handle                */
  64.  HDC    hdcMemory;       /* Device-context handle                */
  65.  SIZEL  sizl={0, 0};     /* use same page size as device         */
  66.  /* context data structure */
  67.  DEVOPENSTRUC dop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
  68.  POINTL aptl[4] = {
  69.      300, 400,           /* lower-left corner of target          */
  70.      350, 450,           /* upper-right corner of target         */
  71.      0, 0,               /* lower-left corner of source          */
  72.      100, 100 };         /* upper-right corner of source         */
  73.  HWND   hwnd;
  74.  
  75.  /* create memory device context and presentation space, associating
  76.     DC with the PS */
  77.  hdcMemory = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop,
  78.                        NULLHANDLE);
  79.  hpsMemory = GpiCreatePS(hab, hdcMemory, &sizl, GPIA_ASSOC
  80.                                                 | PU_PELS);
  81.  
  82.  /* create window device context and presentation space, associating
  83.     DC with the PS */
  84.  hdcScreen = WinOpenWindowDC(hwnd); /* Open window device context */
  85.  hpsScreen = GpiCreatePS(hab, hdcScreen, &sizl, PU_PELS | GPIF_LONG
  86.                                                 | GPIA_ASSOC);
  87.  
  88.  
  89.  /*
  90.    .
  91.    . get bit map, associate bit map with memory device context,
  92.    .     draw into bit map
  93.    .
  94.    */
  95.  
  96.  /* display the bit map on the screen by copying it from the memory
  97.     device context into the screen device context */
  98.  GpiBitBlt(hpsScreen, hpsMemory, 4L, aptl, ROP_SRCCOPY, BBO_IGNORE);
  99.  
  100.  
  101.  
  102. ----------------------------Abbeißen-----------------------
  103.  
  104.  
  105.  
  106. --- Sqed/32 1.14/development
  107.  * Origin: Schont die Umwelt: Vermeidet DOSen (2:2476/493)
  108.  
  109. +----------------------------------------------------------------------------+
  110.  
  111. From: Jonathan de Boyne Pollard                         11-Nov-99 09:05:13
  112.   To: MIKE RUSKAI                                       13-Nov-99 03:49:18
  113. Subj: Multiple primary HPFS
  114.  
  115.  MR> [This may be a duplicate message.  My Fido host had a glitch]
  116.  MR> [that prevented mail from going out for an unspecified      ]
  117.  MR> [length of time, so I have to repost recent messages.       ]
  118.  
  119. They actually did make it out the first time.
  120.  
  121.  » JdeBP «
  122.  
  123. --- FleetStreet 1.22 NR
  124.  * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  125.  
  126. +----------------------------------------------------------------------------+
  127.  
  128. From: Fred Springfield                                  15-Nov-99 12:44:05
  129.   To: All                                               15-Nov-99 21:24:16
  130. Subj: Environment Variables
  131.  
  132. I recently installed VACPP v3.0 on my system, which has Warp 4 + FP10,
  133. Lotus S/S for OS/2, and VA Basic.
  134.  
  135. In the config.sys there are conflicting SET statements put in by these
  136. 3 programs for TMP, SMTMP, SOMBASE, and SOMRUNTIME.
  137.  
  138. Do I need to consolidate these some how to eliminate the duplication 
  139. and/or conflicts?  If so, what is the best way to do it?
  140.  
  141. Since the TMP directories seem to be empty, I think it is OK to just
  142. use one single directory, such as C:\TMP, without actually deleting
  143. any of the other TMP directories, but what about the others?
  144.  
  145. Fred Springfield
  146. Plymouth, MN
  147.  
  148.  
  149.  ■ KWQ/2 1.2i ■ Hope makes a good breakfast, but a poor dinner.
  150.  
  151. --- ProBoard v2.16 [Reg]
  152.  * Origin: RiverWorks * ProBoard Beta Site * V34+ * (1:282/4093)
  153.  
  154. +----------------------------------------------------------------------------+
  155.  
  156. From: Andrew Grillet                                    09-Nov-99 17:45:15
  157.   To: Kris Steenhaut                                    15-Nov-99 21:24:16
  158. Subj: Re: Fixpaks
  159.  
  160. Hi Kris,
  161.  
  162. -=> Kris Steenhaut wrote to Andrew Grillet <=-
  163.  
  164.  KS>    Dag Andrew,
  165.  KS> vrijdag 22 oktober 1999 08.19, Bericht van Andrew Grillet aan All:
  166.  
  167.  AG> I was running Warp Connect with fixpack 40, on a VESA bus 486
  168.  AG> when my VGA card suffered hardware death.
  169.  
  170.  AG> I have more Vesa VGA cards than is good for a normal
  171.  AG> human, so I simply swapped it out. Unfortunately, it was
  172.  AG> a different brand. This meant attempting a switch back
  173.  AG> to VGA. This failed - the scan rate was bizarre.
  174.  
  175.  AG> Obviously time for a re-install.
  176.  
  177.  KS> Not so, for two reasons:
  178.  
  179.  KS> 1° You only have to delete the syslevel.os2 and syslevel.fpk files in
  180.  KS> the \OS2\INSTALL directory.
  181.  
  182. Unfortunately, there is no obvious way to access this information - especially
  183. when your scan rate is set to one your monitor can't handle.
  184.  
  185.  KS> 2° You should have had no trouble at all, if, after having replaced the
  186.  KS> hardware, you'd had rebooted with an alt-F1 --> F3 operation.
  187.  
  188. That was what I meant by 'switch back to VGA' - I did it, but it did not
  189. function as intended.
  190.  
  191.  KS> Just the basics. Next time, before action, do ask first.
  192.  
  193. Exactly how am I supposed to ask when my system is dead? I can only access
  194. Fido via OS/2 on that machine.
  195.  
  196. Despite numerous postings by many people, my origian point remains valid - 
  197. that once a fixpack has been applied, a re-install is 'forbidden'. There may
  198. be hacks that get around this, but there are legitimate reasons why a user
  199. may wish to reinstall after a fixpack has been applied, and the user should
  200. be offered a choice, and not a 'refusal to act as needed by the purchaser'.
  201.  
  202. This type of authoritarian treatment of legit users tends to drive them in
  203. the direction of freeware, while a more flexible and co-operative approach 
  204. would give users a warm feeling inside (possibly near the credit card).
  205.  
  206. Andrew
  207.  
  208. ... Computer Hacker wanted. Must have own axe.
  209. --- Blue Wave/Maximus
  210.  * Origin: Me/2 <Meet-You> (2:254/259)
  211.  
  212. +----------------------------------------------------------------------------+
  213.  
  214. From: Harald Pollack                                    10-Nov-99 13:49:15
  215.   To: Jonathan de Boyne Pollard                         15-Nov-99 21:24:16
  216. Subj: PROMPT $I in PMCMD
  217.  
  218. Am 03. Nov 99 09:49, schrieb Jonathan de Boyne Pollard (2:257/609.3)
  219.     an George White:
  220.  
  221. Servus Jonathan!
  222.  
  223. JdBP>>> Actually, what I need to do is to write a control window 
  224. JdBP>>> that can be used to display coloured text, rather than 
  225. JdBP>>> relying on a standard MLE control.
  226.  
  227.  JdBP> Does anyone here in OS2PROG have any suggestions ?
  228.  
  229. And how about these ?
  230.  
  231. hdc = WinOpenWindowDC(hwnd);
  232. hps = GpiCreatePS(hab,hdc,&sizel,
  233.     PU_PELS | GPIF_DEFAULT | GPIT_MICRO | GPIA_ASSOC );
  234. VioCreatePS(&hvps,SCREEN_HEIGHT,SCREEN_WIDTH,0,1,0);
  235. VioAssociate(hdc,hvps);
  236. ...
  237.  
  238. and so on.
  239.  
  240. Herzliche Gruesse, Harald
  241.  
  242. -+- Message created on Wednesday November, 10 1999 13:51:05 MEZ
  243. --- WarpEd/2 1.11α
  244.  * Origin: LFP Schwechat [OS/2] (2:310/14.59)
  245.  
  246. +----------------------------------------------------------------------------+
  247.  
  248. From: MIKE RUSKAI                                       13-Nov-99 12:37:00
  249.   To: JONATHAN DE BOYNE POLLARD                         15-Nov-99 21:24:16
  250. Subj: Multiple primary HPFS
  251.  
  252. Some senseless babbling from Jonathan De Boyne Pollard to Mike Ruskai
  253. on 11-11-99  09:05 about Multiple primary HPFS...
  254.  
  255.  MR> [This may be a duplicate message.  My Fido host had a glitch]
  256.  MR> [that prevented mail from going out for an unspecified      ]
  257.  MR> [length of time, so I have to repost recent messages.       ]
  258.  
  259.  JDBP> They actually did make it out the first time.
  260.  
  261. Apparently some didn't.  The sysop never said when the error occurred (he
  262. forgot to create a subdirectory when moving to a new drive), so I went back
  263. a week.
  264.  
  265. Mike Ruskai
  266. thannymeister@yahoo.com
  267.  
  268.  
  269. ... An optimist is a person without much experience in life.
  270.  
  271. ___ Blue Wave/QWK v2.20
  272. --- Platinum Xpress/Win/Wildcat5! v3.0pr2
  273.  * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
  274.  
  275. +----------------------------------------------------------------------------+
  276.  
  277. From: Jonathan de Boyne Pollard                         12-Nov-99 12:12:28
  278.   To: Charles Gaefke                                    16-Nov-99 03:46:08
  279. Subj: Watcom C++ 11.0 and thunking
  280.  
  281. Thanks for your 1998 posting on the powersoft news server, by the way.  I
  282. spent ages trying to find out why some assembly language code that I wrote to
  283. thunk from 32-bit to 16-bit wasn't working.  Then I turned up your posting
  284. where you noted that
  285.  
  286.         #define INCL_VIO
  287.         #include <os2.h>
  288.  
  289.         char vm_wherey(void)
  290.         {
  291.             USHORT row, col;
  292.             VioGetCurPos(&row, &col, 0);
  293.             return (char)(row + 1);
  294.         }
  295.  
  296. when compiled as a 32-bit application crashes.  VioGetCurPos() was the exact
  297. call that I was having trouble with.  Knowing that it didn't work using
  298. Watcom's own libraries steered me towards the conclusion that my assembly
  299. language code was in fact correct (which explained why I couldn't find any
  300. mistakes in it despite hours of patient tracing through it with a debugger
  301. (-:) and that it was a linker problem.  WATFIX has now fixed the problem (but, 
  302. alas, not the linker itself) and my DLL now works.  There are a small bunch of 
  303. happy VIOCMD users who would probably like to thank you as well.  (-:
  304.  
  305. Ironically, I had actually already noticed the lack of the "ALIAS" flag on
  306. some of the 16:16 import fixups (which is what WATFIX fixes, of course).  I
  307. should have pursued that line of investigation further.
  308.  
  309.  » JdeBP «
  310.  
  311. --- FleetStreet 1.22 NR
  312.  * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  313.  
  314. +----------------------------------------------------------------------------+
  315.  
  316. From: Jonathan de Boyne Pollard                         15-Nov-99 09:41:17
  317.   To: Steve Wendt                                       16-Nov-99 03:46:08
  318. Subj: DESKARC LIST
  319.  
  320. [ This is a précis of a message in the TAUCMD echo. ]
  321.  
  322.  SW> DESKARC LIST produces no output here.
  323.  
  324. About three months ago, I posted a question asking if anyone knew the internal 
  325. structure of \OS2\ARCHIVES\ARCHIVES.$$$ .  Once I know that, I can add code to 
  326. DESKARC to pretty-print the information contained in it when the LIST option
  327. is used.
  328.  
  329. Unfortunately, I've had no replies, and I don't have the time to sit down with 
  330. a hex viewer and work out the structure of the file myself.  If anyone reading 
  331. this wants to do so, I'd be grateful.  I gather that there are several people
  332. who are interested in the tools when they are finished but who don't have
  333. enough spare time to cope with the full cycle of installing and using
  334. pre-releases as I shovel them out, even though they would like to contribute
  335. something if they could.  This is their chance.  If they want to make a more
  336. modest contribution, one which won't be as demanding of their time, figuring
  337. out the structure of ARCHIVES.$$$ can be it.
  338.  
  339. Let me know what it is, and I'll implement the LIST option of the DESKARC
  340. command.
  341.  
  342.  » JdeBP «
  343.  
  344. --- FleetStreet 1.22 NR
  345.  * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  346.  
  347. +----------------------------------------------------------------------------+
  348.  
  349. From: Murray Lesser                                     15-Nov-99 22:47:00
  350.   To: Fred Springfield                                  15-Nov-99 22:47:00
  351. Subj: Environment Variables
  352.  
  353. (Excerpts from a message dated 11-15-99, Fred Springfield to All)
  354.  
  355. Hi Fred--
  356.  
  357. FS>I recently installed VACPP v3.0 on my system, which has Warp 4 +
  358.   >FP10, Lotus S/S for OS/2, and VA Basic.
  359.  
  360. FS>In the config.sys there are conflicting SET statements put in by
  361.   >these 3 programs for TMP, SMTMP, SOMBASE, and SOMRUNTIME.
  362.  
  363. FS>Do I need to consolidate these some how to eliminate the duplication
  364.   >and/or conflicts?  If so, what is the best way to do it?
  365.  
  366.     IIRC, in some cases, there are instructions in the README telling
  367. the order in which to install some IBM applications to avoid your
  368. trouble.  Unfortunately, I believe those apply only to multiple VA
  369. compiles :-(.  I have no experience with the set you have installed, so
  370. I can't tell you whether or not any of the conflicts can be
  371. consolidated.
  372.  
  373.     AFAIAC, the easiest way is to NOT let the installation program
  374. monkey with your CONFIG.SYS file.  If you tell it not to modify
  375. CONFIG.SYS, when each program is installed, you will find another
  376. CONFIG.SYS-type file (I've forgotten what it is named, but the install
  377. program will tell you.  You may be able to consolidate these three
  378. files, or (better) set up a REXX file to to call the application, but
  379. modify the necessary CONFIG.SYS "SET" commands for that application.
  380. Each app will be in a special session, each with its own environment.
  381. You must remember to use SET BEGINLIBPATH=(whatever) to tell the session
  382. where the DLLs may be beside those in your normal CONFIG.SYS.
  383.  
  384.     I refuse to let anyone else's software diddle my CONFIG.SYS file.  I
  385. spent too much time and effort getting it the way I want it :-).
  386.  
  387.     Regards,
  388.  
  389.         --Murray
  390. <Team PL/I>
  391. ___
  392.  * MR/2 2.25 #120 * Have a frabjous day." he chortled in his joy
  393.  
  394. --- Maximus/2 2.02
  395.  * Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)
  396.  
  397.  
  398. +----------------------------------------------------------------------------+
  399.  
  400. From: MIKE RUSKAI                                       16-Nov-99 04:34:00
  401.   To: FRED SPRINGFIELD                                  17-Nov-99 00:27:02
  402. Subj: Environment Variables
  403.  
  404. Some senseless babbling from Fred Springfield to All
  405. on 11-15-99  12:44 about Environment Variables...
  406.  
  407.  FS> I recently installed VACPP v3.0 on my system, which has Warp 4 +
  408.  FS> FP10, Lotus S/S for OS/2, and VA Basic.
  409.  
  410.  FS> In the config.sys there are conflicting SET statements put in by these
  411.  FS> 3 programs for TMP, SMTMP, SOMBASE, and SOMRUNTIME.
  412.  
  413.  FS> Do I need to consolidate these some how to eliminate the duplication 
  414.  FS> and/or conflicts?  If so, what is the best way to do it?
  415.  
  416.  FS> Since the TMP directories seem to be empty, I think it is OK to just
  417.  FS> use one single directory, such as C:\TMP, without actually deleting
  418.  FS> any of the other TMP directories, but what about the others?
  419.  
  420. Your safest bet is probably to use the one pointing to the newest of the
  421. SOM files.
  422.  
  423. Mike Ruskai
  424. thannymeister@yahoo.com
  425.  
  426.  
  427. ... Back off man...I'm a scientist.
  428.  
  429. ___ Blue Wave/QWK v2.20
  430. --- Platinum Xpress/Win/Wildcat5! v3.0pr2
  431.  * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
  432.  
  433. +----------------------------------------------------------------------------+
  434.  
  435. From: Jonathan de Boyne Pollard                         15-Nov-99 12:11:29
  436.   To: All                                               17-Nov-99 03:41:04
  437. Subj: 32-bit console API
  438.  
  439. It's unfortunate that there's no 32-bit console API in OS/2 Warp 4, and it's
  440. equally unfortunate that there's no standard DLL for thunking down to the
  441. 16-bit VIO, KBD, and MOU subsystems.  As a consequence, most C/C++
  442. implementations either generate thunking code on the fly (Borland C++, Watcom
  443. C++, IBM VisualAge C++), or have in their libraries pre-written thunks for the 
  444. VIO16, KBD16, and MOU16 subsystems that are statically linked into executables 
  445. when needed (MetaWare High C++, EMX C++).
  446.  
  447. And as a consequence of that, many otherwise purely 32-bit OS/2 applications
  448. contain 16-bit code statically linked into them, simply because they want to
  449. do fancy things in text mode.
  450.  
  451. Of course, there *is* such a 32-bit DLL: the DLL in the 32TEXT package on the
  452. DevCon CD-ROMs.  However, it is beta-level code as the documentation states,
  453. highly unlikely *ever* to become a standard part of OS/2 (going by the lack of 
  454. movement in this direction over the past 5 or so years), and, as I found out,
  455. it contains some rather vicious bugs that make it practically useless.  One
  456. cannot run two processes simultaneously that use that DLL and that call
  457. KbdCharIn(), for example.  The processes die with a SYS3175 somewhere inside
  458. the DLL.
  459.  
  460. If anyone wants a 32-bit wrapper around the most generally used portions of
  461. the 16-bit VIO and KBD subsystems, I've now rolled my own, CON3216.DLL, which
  462. *does* work when used simultaneously in multiple processes.  I can provide an
  463. import library and a replacement <bsesub.h> header.  I've followed the 32TEXT
  464. API as faithfully as I can (given how little documentation there is -- there's 
  465. no description of *what* VK_ codes are returned by KbdCharIn for each key, for 
  466. example), even going so far as using the same ordinal numbers for the function 
  467. entry points.
  468.  
  469. Better yet, I have also written a proper, 32-bit, Unicode, console API,
  470. CONCALLS.DLL, and a <bsecon.h> header.
  471.  
  472. Consider it just one more 16-bit vestige in OS/2 Warp that can now be
  473. eliminated.
  474.  
  475.  » JdeBP «
  476.  
  477. --- FleetStreet 1.22 NR
  478.  * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  479.  
  480. +----------------------------------------------------------------------------+
  481.  
  482. From: Murray Lesser                                     16-Nov-99 19:35:01
  483.   To: All                                               16-Nov-99 19:35:01
  484. Subj: Basic Pds Y2k Ok
  485.  
  486.     In case there is anyone out there besides me who is still using the
  487. vintage-1990 MS BASIC PDS v 7.1 compiler running as a "native OS/2"
  488. application (not in a VDM!):
  489.  
  490.     I made a small test of the DATE$ function (compiled and linked for
  491. both real (VDM) and protected (native OS/2) modes with my system clock
  492. cranked up a year.  The full source code of TEST.BAS was: PRINT DATE$.
  493. Both versions returned 11-16-2000, something that was not really
  494. expected!
  495.  
  496.     So, two of my often-used very-old utilities are Y2K safe, so I don't
  497. have to rewrite them in PL/I during the next month and a half :-).
  498.  
  499.     Just shows that MS once was able to do things right!
  500.  
  501.     Regards,
  502.  
  503.         --Murray
  504. <Team PL/I>
  505. ___
  506.  * MR/2 2.25 #120 * Never send a PM program to do a text-mode job
  507.  
  508. --- Maximus/2 2.02
  509.  * Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)
  510.  
  511.  
  512. +----------------------------------------------------------------------------+
  513.  
  514. From: Rob Basler                                        16-Nov-99 18:34:16
  515.   To: All                                               17-Nov-99 07:57:14
  516. Subj: sendto() doesn't work on WSeB
  517.  
  518. I'm trying to make a UDP app that will broadcast on the local LAN to find any
  519. available servers.  I have tested this code on Warp 4 and it works fine.  It
  520. also works fine if the server is on WSeB, but if the client is on WSeB I get a 
  521. TCP/IP error 10065 (No Route to Host) which is pretty strange.  
  522.  
  523. Suggestions?  I can ping any and all computers on my lan from any and all.  If 
  524. I connect to the internet via dialup the client program runs, but of course is 
  525. looking at the internet rather than my local lan to find the servers so it
  526. doesn't find anything.
  527.  
  528. The code (prettified a bit.)
  529.  
  530. int s, tries, found;
  531. char buf[256], buf2[256];
  532. int nonblocking, errorcode, broadcast;
  533. struct sockaddr_in server, client;
  534.  
  535. tries=5;
  536. found=0;
  537. while ((tries>0) && (found==0)) {
  538.      /* Create a datagram socket in the internet domain and use the default
  539. protocol (UDP). */
  540.      if ((s = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
  541.           return(-1);
  542.      }
  543.  
  544.      /* Bind the UDP socket to the server address. */
  545.      client.sin_family      = AF_INET;    /* Server is in Internet Domain */
  546.      client.sin_port        = 0;          /* Any port in a storm */
  547.      client.sin_addr.s_addr = INADDR_ANY; /* Server's Internet Address    */
  548.      if (bind(s, (struct sockaddr *)&client, sizeof(client)) < 0) {
  549.          return(-1);
  550.      }
  551.  
  552.      /* Set up the server name */
  553.      server.sin_family      = AF_INET;                   /* Internet Domain    
  554. */
  555.      server.sin_port        = htons(SERVERBROADCAST_UDP); /* Server Port       
  556.  */
  557.      server.sin_addr.s_addr = INADDR_BROADCAST;          /* broadcast to all
  558. servers */
  559.  
  560.      // Make up our message, the client name and version
  561.      strcpy(buf,"CLIENTBXMSG10");
  562.  
  563.      // Set socket to allow broadcasts
  564.      broadcast=1;
  565.      if
  566. (setsockopt(s,SOL_SOCKET,SO_BROADCAST,(char*)&broadcast,sizeof(broadcast))!=0) 
  567. {
  568.            return(-3);
  569.      }
  570.  
  571.      /* Broadcast the message in buf to the server */
  572.      if (sendto(s, buf, (strlen(buf)+1), 0, (struct sockaddr *)&server,
  573. sizeof(server)) < 0) {
  574.           return(-2);
  575.      }
  576.  
  577.      // Set socket to non-blocking mode
  578.      nonblocking=1;
  579.      if (ioctl(s,FIONBIO,(caddr_t)&nonblocking,sizeof(nonblocking))!=0) {
  580.            return(-3);
  581.      }
  582.  
  583.      // Wait for response for 2 seconds.
  584.      int32 timeout=TimeGet();
  585.      while ((TimeElapsed(timeout)<2000) && (found<maxservers)) {
  586.           /* Receive a message on socket udpsock in buf  of maximum size 32
  587. from a client. */
  588.           int server_address_size = sizeof(server);
  589.           if (recvfrom(s,buf,sizeof(buf),0,(struct sockaddr *)
  590. &server,&server_address_size) <0) {
  591.  
  592. // miscellaneous processing of the received message and closing of the socket.
  593.  
  594. --- Maximus/2 3.01
  595.  * Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)
  596.  
  597. +----------------------------------------------------------------------------+
  598.  
  599. From: Charles Gaefke                                    16-Nov-99 18:30:02
  600.   To: Jonathan De Boyne Pollard                         17-Nov-99 11:14:25
  601. Subj: Re: Watcom C++ 11.0 and thunking
  602.  
  603. JD> Thanks for your 1998 posting on the powersoft news server, by the way.  I
  604. s
  605. JD> ages trying to find out why some assembly language code that I wrote to
  606. thu
  607. JD> from 32-bit to 16-bit wasn't working.  Then I turned up your posting where 
  608.  
  609. JD> noted that
  610.  
  611.     Using Watcom 11.0 I take it? :)
  612.  
  613.     It's a shame Powersoft never fixed Watcom.  10.6 is great.  11.0 is broke.
  614.  11.0a is better, but still broke (atleast for OS/2).
  615.  
  616.     I use 10.6 when I develop for OS/2.  Saves me a lot of hassle.
  617.  
  618.     I use 11.0a when I develop for Win32.
  619.  
  620.     Oh, and you're welcome.  Glad it helped.
  621.  
  622.  
  623. C. Gaefke
  624. cdgaefke@earthlink.net
  625.  
  626.  
  627.     
  628.  
  629.  
  630. ... Are you following your dreams?
  631.  
  632. --- Renegade 98-310 Dos/CDRMail v1.23.b1.1
  633.  * Origin: LOTL/2 * www.icubed.com/~cdgaefke (1:129/230)
  634.  
  635. +----------------------------------------------------------------------------+
  636.  
  637. From: Harald Pollack                                    12-Nov-99 08:10:06
  638.   To: MIKE RUSKAI                                       17-Nov-99 19:18:20
  639. Subj: HPFS freespace bmp list
  640.  
  641. Am 06. Nov 99 07:20, schrieb MIKE RUSKAI (1:3603/140)
  642.     an HARALD POLLACK:
  643.  
  644. Servus MIKE!
  645.  
  646.  MR> That wouldn't work at all.  That space is not necessarily 
  647.  MR> contigous at all.
  648.  
  649. Ok, than it is not for a reference partition :-)
  650.  
  651.  MR> It can have two freespace bitmaps right in the middle of 
  652.  MR> it, depending on the drive layout.
  653.  
  654. Maybe it is some reserved space for 'HotFix' (whatever this is in reality)
  655.  
  656.  MR> Furthermore, on a 10MB HPFS drive,
  657.  
  658. On such a drive, a reference partition is not possible.
  659.  
  660.  MR> that area is only 443 sectors, which is not enough for a PS/2 reference 
  661.  MR> partition
  662.  
  663. That's also right
  664.  
  665.  MR> (which not very many PS/2's actually have - most use reference 
  666.  MR> diskettes).
  667.  
  668. In principel, all PS/2 use reference DISKs, but (almost ?) all 95XX models do
  669. so.
  670.  
  671. Herzliche Gruesse, Harald
  672.  
  673. -+- Message created on Friday November, 12 1999 08:13:54 MEZ
  674. --- WarpEd/2 1.11α
  675.  * Origin: LFP Schwechat [OS/2] (2:310/14.59)
  676.  
  677. +----------------------------------------------------------------------------+
  678.  
  679. From: Jonathan de Boyne Pollard                         16-Nov-99 13:48:23
  680.   To: Harald Pollack                                    18-Nov-99 06:15:01
  681. Subj: PROMPT $I in PMCMD
  682.  
  683.  JdBP>>>> Actually, what I need to do is to write a control window 
  684.  JdBP>>>> that can be used to display coloured text, rather than 
  685.  JdBP>>>> relying on a standard MLE control.
  686.  
  687.  JdBP>> Does anyone here in OS2PROG have any suggestions ?
  688.  
  689.  HP> And how about these ?
  690.  HP>
  691.  HP> hdc=WinOpenWindowDC(hwnd);
  692.  HP>
  693. hps=GpiCreatePS(hab,hdc,&sizel,PU_PELS|GPIF_DEFAULT|GPIT_MICRO|GPIA_ASSOC);
  694.  HP> VioCreatePS(&hvps,SCREEN_HEIGHT,SCREEN_WIDTH,0,1,0);
  695.  HP> VioAssociate(hdc,hvps);
  696.  HP> ...
  697.  
  698. As I have said already, in a pure 32-bit application the option of a VIO
  699. presentation space is not open to me.  In any case, it seems silly to have a
  700. 32-bit application relying on a 16-bit relic from OS/2 version 1.2 .
  701.  
  702. I'm looking for a solution that is 32-bit.  Therefore I'm looking for a
  703. solution that uses the ordinary 32-bit Presentation Manager API.  There must
  704. be an efficient way of drawing fixed-width text in multiple colours using the
  705. GPI.
  706.  
  707. I've been wondering whether to use a memory PS, drawing into it when the
  708. window contents are changed and blitting into the window's PS in a WM_PAINT
  709. event.  But I'm worried about if I do so having to handle font and preparams
  710. issues manually (which seem to be taken care of automatically when I use the
  711. cached micro PS supplied by WinBeginPaint).
  712.  
  713.  » JdeBP «
  714.  
  715. --- FleetStreet 1.22 NR
  716.  * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  717.  
  718. +----------------------------------------------------------------------------+
  719.  
  720. From: Fred Springfield                                  18-Nov-99 01:43:05
  721.   To: Murray Lesser                                     18-Nov-99 17:36:09
  722. Subj: Basic Pds Y2k Ok
  723.  
  724. Murray Lesser said to all:
  725.  
  726. ML>     In case there is anyone out there besides me who is still
  727. ML> using the vintage-1990 MS BASIC PDS v 7.1 compiler running as a
  728. ML> "native OS/2" application (not in a VDM!):
  729. ML> 
  730. ML>     I made a small test of the DATE$ function (compiled and linked for
  731. ML> both real (VDM) and protected (native OS/2) modes with my system
  732. ML> clock cranked up a year.  The full source code of TEST.BAS was:
  733. ML> PRINT DATE$. Both versions returned 11-16-2000, something that was
  734. ML> not really expected!
  735. ML> 
  736. ML>     So, two of my often-used very-old utilities are Y2K safe, so I don't
  737. ML> have to rewrite them in PL/I during the next month and a half :-).
  738. ML> 
  739. ML>     Just shows that MS once was able to do things right!
  740. ML> 
  741.  
  742. Yes, I still use mine heavily--3 commercial programs in use now, which
  743. I am still supporting.  But, I run it in a VDM on Warp 4 and only
  744. generate DOS .exe's, which my clients run on Win 95/NT.  I know you can
  745. generate VIO programs with it, but I went to rexx for that type of thing
  746. because PDS essentially becomes a text program generator in that mode of
  747. operation.
  748.  
  749. But, surprise, surprise.  How do you run it as an OS/2 application?
  750.  
  751. Fred Springfield
  752. Plymouth, MN
  753.  
  754.  
  755.  ■ KWQ/2 1.2i ■ Working smart beats working hard--try it.
  756.  
  757. --- ProBoard v2.16 [Reg]
  758.  * Origin: RiverWorks * ProBoard Beta Site * V34+ * (1:282/4093)
  759.  
  760. +----------------------------------------------------------------------------+
  761.  
  762. From: MIKE RUSKAI                                       17-Nov-99 19:38:00
  763.   To: HARALD POLLACK                                    18-Nov-99 23:18:15
  764. Subj: HPFS freespace bmp list
  765.  
  766. Some senseless babbling from Harald Pollack to Mike Ruskai
  767. on 11-12-99  08:10 about HPFS freespace bmp list...
  768.  
  769.  HP> Am 06. Nov 99 07:20, schrieb MIKE RUSKAI (1:3603/140)
  770.  HP> an HARALD POLLACK:
  771.  
  772.  HP> Servus MIKE!
  773.  
  774.  MR> That wouldn't work at all.  That space is not necessarily 
  775.  MR> contigous at all.
  776.  
  777.  HP> Ok, than it is not for a reference partition :-)
  778.  
  779. No, and I've still not found an answer.
  780.  
  781.  MR> It can have two freespace bitmaps right in the middle of 
  782.  MR> it, depending on the drive layout.
  783.  
  784.  HP> Maybe it is some reserved space for 'HotFix' (whatever this is in
  785.  HP> reality) 
  786.  
  787. No, the location and count of hotfix sectors are well-defined.  There are
  788. always 100, and they're always at the beginning of the drive.
  789.  
  790.  MR> (which not very many PS/2's actually have - most use reference 
  791.  MR> diskettes).
  792.  
  793.  HP> In principel, all PS/2 use reference DISKs, but (almost ?) all 95XX
  794.  HP> models do so.
  795.  
  796. I've never used a PS/2 as new as that :)
  797.  
  798. Mike Ruskai
  799. thannymeister@yahoo.com
  800.  
  801.  
  802. ... Humor is the ability to laugh at ourselves.
  803.  
  804. ___ Blue Wave/QWK v2.20
  805. --- Platinum Xpress/Win/Wildcat5! v3.0pr2
  806.  * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
  807.  
  808. +----------------------------------------------------------------------------+
  809.  
  810. From: Vince Coen                                        18-Nov-99 00:12:27
  811.   To: Charles Gaefke                                    19-Nov-99 06:08:13
  812. Subj: Watcom C++ 11.0 and thunking
  813.  
  814. Hello Charles!
  815.  
  816. Tuesday November 16 1999, Charles Gaefke writes to Jonathan De Boyne Pollard:
  817.  
  818.  JD>> Thanks for your 1998 posting on the powersoft news server, by the
  819.  JD>> way.  I s ages trying to find out why some assembly language code
  820.  JD>> that I wrote to thu from 32-bit to 16-bit wasn't working.  Then I
  821.  JD>> turned up your posting where noted that
  822.  
  823.  CG>     Using Watcom 11.0 I take it? :)
  824.  
  825.  CG>     It's a shame Powersoft never fixed Watcom.  10.6 is great.  11.0 is
  826.  CG> broke. 11.0a is better, but still broke (atleast for OS/2).
  827.  
  828.  CG>     I use 10.6 when I develop for OS/2.  Saves me a lot of hassle.
  829.  
  830.  CG>     I use 11.0a when I develop for Win32.
  831.  
  832.  CG>     Oh, and you're welcome.  Glad it helped.
  833.  
  834. I have 11.0b if anyone needs it.
  835.  
  836.  
  837. Vince
  838.  
  839. --- Maximus v3.01/GoldED/2 2.50+#10UK3 under OS/2
  840.  * Origin: Air Applewood; OS/2 Gateway to Essex +44-1279-792300 (2:257/609)
  841.  
  842. +----------------------------------------------------------------------------+
  843.  
  844. From: Tobias Ernst                                      18-Nov-99 10:44:09
  845.   To: Jonathan de Boyne Pollard                         19-Nov-99 06:08:13
  846. Subj: 32-bit console API
  847.  
  848. Hallo Jonathan!
  849.  
  850.  JdBP> Better yet, I have also written a proper, 32-bit, Unicode, console 
  851.  JdBP> API, CONCALLS.DLL, and a <bsecon.h> header.
  852.  
  853. This is really fine. Where can one get this?
  854.  
  855. Viele Grüße,
  856. Tobias
  857.  
  858. --- Msged/BSD TE 06 (pre)
  859.  * Origin: Running FreeBSD 3.2 (2:2476/418)
  860.  
  861. +----------------------------------------------------------------------------+
  862.  
  863. From: Eddy Thilleman                                    17-Nov-99 12:59:19
  864.   To: Fred Springfield                                  19-Nov-99 14:48:11
  865. Subj: Environment Variables
  866.  
  867. Hello Fred,
  868.  
  869. 15 Nov 99 12:44, Fred Springfield wrote to All:
  870.  
  871. FS> In the config.sys there are conflicting SET statements put in by these
  872. FS> 3 programs for TMP, SMTMP, SOMBASE, and SOMRUNTIME.
  873.  
  874. You can start them via a (for each) unique batch (or REXX) file and set these
  875. environment variables there to the value they need.
  876.  
  877.   Greetings   -=Eddy=-        email: eddy.thilleman@net.hcc.nl
  878.  
  879. ... "Tuesday is Human Sacrifice Day at the Sizzler." - Tom Servo
  880. --- GoldED/2 3.0.1
  881.  * Origin: Windows95 is a graphic DOS extender (2:500/143.7)
  882.  
  883. +----------------------------------------------------------------------------+
  884.  
  885. From: Murray Lesser                                     19-Nov-99 21:53:01
  886.   To: Fred Springfield                                  19-Nov-99 21:53:01
  887. Subj: Basic Pds Y2k Ok
  888.  
  889. (Excerpts from a message dated 11-18-99, Fred Springfield to Murray
  890. Lesser)
  891.  
  892. Hi Fred--
  893.  
  894. ML>     In case there is anyone out there besides me who is still
  895. ml> using the vintage-1990 MS BASIC PDS v 7.1 compiler running as a
  896. ML> "native OS/2" application (not in a VDM!):
  897. ML> 
  898. ML>     I made a small test of the DATE$ function (compiled and linked for
  899. ML> both real (VDM) and protected (native OS/2) modes with my system
  900. ML> clock cranked up a year.  The full source code of TEST.BAS was:
  901. ML> PRINT DATE$. Both versions returned 11-16-2000, something that was
  902. ML> not really expected!
  903. ML> 
  904.  
  905. FS>Yes, I still use mine heavily--3 commercial programs in use now,
  906.   >which I am still supporting.  But, I run it in a VDM on Warp 4 and
  907.   >only generate DOS .exe's, which my clients run on Win 95/NT.  I know
  908.   >you can generate VIO programs with it, but I went to rexx for that
  909.   >type of thing because PDS essentially becomes a text program
  910.   >generator in that mode of operation.
  911.  
  912.     It doesn't bother me that BASIC PDS (run under OS/2) produces only
  913. text-mode applications, because that is the only type of program I
  914. write.  Nowadays, I program only for my own amazement, and I prefer to
  915. run text-mode applications to their GUI brethren.  I no longer write
  916. "new" programs with BASIC PDS, and use the compiler only to update those
  917. currently active applications that I haven't gotten around to rewriting
  918. in PL/I (something on the to-do list, RSN!).  At the moment, I have only
  919. three left that I run regularly, but I will have to write a set of
  920. separately compiled procedures for PL/I to display text "windows" within
  921. a text-mode full-screen application before I can rewrite two of them.  I
  922. use the compiler so rarely that I have moved it on to a Zip-drive
  923. diskette (the files I have retained use only about 4 MB, including my
  924. "private" link libraries containing separately-compiled and assembled
  925. modules).
  926.  
  927.     REXX is a great programming tool for quick and dirty jobs, or even
  928. for jobs that spend most of their activity manipulating text files, but
  929. I would not use it as a complete substitute for BASIC PDS, even though
  930. there are things that are easier to do in REXX than in any other
  931. language that I know: anything that "needs" the REXX PARSE statement.
  932. But I prefer PL/I to any other language that I know for "real" text-mode
  933. applications.  I tried "porting" a few BASIC PDS programs to C (before I
  934. began to learn PL/I), but gave up; C is just too clumsy a language to be
  935. useful for programs with a lot of text manipulation, Kernighan and
  936. Ritchie to the contrary notwithstanding.
  937.  
  938. FS>But, surprise, surprise.  How do you run it as an OS/2 application?
  939.  
  940.     You have to remember that "native OS/2" for the BASIC PDS compiler
  941. (and protected-mode applications written in it) are 16-bit text-mode
  942. OS/2 programs, because the only version of OS/2 that Microsoft
  943. recognized at the time was 1.0.  However, since IBM is a very strong
  944. believer in backward compatibility, 16-bit OS/2 programs run fine,
  945. unchanged, in 32-bit OS/2.
  946.  
  947.     It has been over six years since I installed BASIC PDS to run in
  948. "protected mode" and I'm not sure that I could do it today, since I seem
  949. to have lost any "getting started" documentation that came with the
  950. compiler.  I suppose, if I had to, I would try by starting with
  951. SETUP.EXE on the first distribution diskette, telling it to load the
  952. BINP directory as well as the others.  (A small test this morning
  953. indicated that SETUP would run in a VDM.)  My installation includes both
  954. the BINP directory (protected-mode files containing, among other things,
  955. some necessary OS/2 DLLs) as well as the BINB directory (bound
  956. executables that run in either mode).  For example, the version of
  957. LINK.EXE as found in BINB will run in either an OS/2 command-line window
  958. or a DOS window, under OS/2.  I compile only in "stand-alone" mode (/O
  959. switch on the command line), and when I wish to compile a program that
  960. runs in a VDM (real mode) I must use the command-line switch /LR.  I
  961. gather from the "Programming Guide" manual that if I were running the
  962. compiler in DOS mode, I would have to use the /LP (protected mode)
  963. switch to produce a 16-bit "native OS/2" executable program.
  964.  
  965.     Regards,
  966.  
  967.         --Murray
  968. <Team PL/I>
  969. ___
  970.  * MR/2 2.25 #120 * Never send a PM program to do a text-mode job
  971.  
  972. --- Maximus/2 2.02
  973.  * Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)
  974.  
  975.  
  976. +----------------------------------------------------------------------------+
  977.  
  978. +============================================================================+
  979.