home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / watcom.zip / WC931214.CAP < prev    next >
Internet Message Format  |  1993-12-14  |  184KB

  1. From:    Kevin Kitsemetry
  2. To:      Mike Dijkema                           Msg #1815, Nov-01-93 03:21PM
  3. Subject: BIMODAL
  4.  
  5.  MD> It appears that in the new dos4gw which came along
  6.  MD> with WC9.5 the bimodal program won't run anymore. All
  7.  MD> serial IO is actually not working because something
  8.  MD> appears to go wrong in the apssing up dan down of the
  9.  MD> interrupts. It does though run on the old 9.0 version.
  10.  MD> Ok it is now possible to trap GP faults, but
  11.  MD> apparently it is not yet ok...
  12.  
  13. You should make sure that you have applied the A-level
  14. patch to the compiler, and that you get the new version
  15. of BIMODAL.ZIP from the BBS.  This should solve your
  16. problems with the Bimodal example.
  17.  
  18.  
  19. Kevin Kitsemetry
  20. WATCOM TECHNICAL SUPPORT
  21.  
  22. *** This is a reply to #1804.
  23.  
  24.  
  25. From:    Kevin Kitsemetry                       Rec'd
  26. To:      Rainer Schupp                          Msg #1817, Nov-01-93 03:54PM
  27. Subject: msg 1790 + 1801
  28.  
  29.  RS> The provided code in msg #1790 is complete.
  30.  RS> (Except the line breaks in the pragma aux,
  31.  RS> check the backslashes). If compiled with
  32.  RS> wcc386p test.c , it passes the 9.0 E-level
  33.  RS> compiler with no warnings and no errors, but
  34.  RS> it won't pass the 9.5 compiler.
  35.  
  36. I just compiled this example, and got 0 warning and 0 errors. Please make sure
  37. you have the A-level patch applied to the
  38. compiler.
  39.  
  40.  
  41. Kevin Kitsemetry
  42. WATCOM TECHNICAL SUPPORT
  43.  
  44. *** This is a reply to #1812.
  45.  
  46.  
  47. From:    Matt Goheen                            Rec'd
  48. To:      John Hinkley                           Msg #1818, Nov-01-93 05:33PM
  49. Subject: C386 9.5
  50.  
  51. Geez, I read your message and kept muttering, yeah, Yeah!, YEAH!  We have
  52. basically gone through ALL the same steps (and same problems) that you mention
  53. (including the "hang" at startup w/DOS6 -- 5-7 seconds with my little 8Mb, as
  54. well as the move to FlashTek X32).  Anyway, I don't have any solutions, but
  55. you aren't alone...
  56.  
  57.         - Matt Goheen
  58.  
  59. *** This is a reply to #1137.
  60.  
  61.  
  62. From:    Jerry Rice
  63. To:      Kevin Kitsemetry                       Msg #1819, Nov-03-93 10:45AM
  64. Subject: On Intel Code Builder
  65.  
  66. KK> Internal Report #9313
  67.  
  68.  
  69.       Have you come up with  any solutions to the Intel Code Builder to Watcom
  70. problem?
  71.  
  72.       The  basic problem  is that  I can't  use .rex  files. Intel no longer
  73. accepts them.
  74.  
  75.       The only thing I can see from the manuals, both Watcom and Intel, is
  76. that Intel can accept PharLaps Easy-OMF object format,  in  both  .obj  and
  77. .lib.  Their  Lib32 can take a PharLap Easy-OMF  library and convert it  to
  78. Intel Easy-OMF. Your  Womp.exe  can  take  a  Watcom  object  or library and
  79. convert it  to PharLap Easy OMF.  But would it work  on your CLIBs.lib,...,
  80. plus startup code? Then I could use wcc386 to compile to  watcom objects,
  81. convert  these to Pharlap,  then convert  them  to  Intel,  then  link  them
  82. with il32, which pastes on intel's extender. I doubt if it will work, since I
  83. have   never  seen   any  converter   work  perfectly,  only acceptibly. That
  84. is, your  Womp.exe will convert watcom .obj to pharlap, acceptible enough to
  85. be accepted by pharlap, but not  necessarily  enough  for  Intel's  lib32  to
  86. be able to convert it to Intel format.
  87.  
  88.  
  89.       Anyway, I  entend to try  this, but I  need some info. Given  that  I
  90. am  using  the  pentium switches and maximum optimization, 5s... What startup
  91. and library modules would I have to convert, create. I noticed a couple of
  92. .asm files in the startup directory. I have both tasm 3.0, 3.2 and ml 6.1. I
  93. don't  know  whether  ml  can  create  a  pharlap easy omf directly or not,
  94. but I do know that  intel will accept both tasm and ml  obj's. Which do you
  95. suggest?  I suppose I could use  WOMP.exe  to  convert  the  32  bit  ml  6.1
  96. objects to Pharlap?  With  all  of  these,  tasm  and  ml, there is the
  97. problem of switches! Any suggestions would be helpful!!
  98.  
  99.  
  100.                                      Jer
  101.  
  102. ___
  103.  X SLMR 2.1a X
  104.  
  105.  
  106. From:    Eric Nylander
  107. To:      All                                    Msg #1820, Nov-02-93 03:54AM
  108. Subject: pharlap, qemm, and graph.h
  109.  
  110. if you are having problems running graph.h while in pharlap, and you are using
  111. qemm, the stealth mode of qemm causes a GP.
  112. stealth can be turned off for the video rom to remove the GP.
  113.  
  114.  
  115. From:    Marcus Erickson                        Rec'd
  116. To:      Kevin Kitsemetry                       Msg #1823, Nov-02-93 11:44AM
  117. Subject: Problem with Patching 9.5 (a)
  118.  
  119. I am haing trouble applying my 'A' version patch to my version 9.5
  120. DOS32 compiler.  I purchased 9.0 but received a free copy of 9.5 at
  121. SD 93. When I try to apply the A level patches, I get the warning that
  122. BPATCH can not apply the patches because the file sizes are different than
  123. what it expects.
  124.     Thank you,
  125.         Marcus Erickson
  126.         Pocket Soft, Inc.
  127.  
  128. *** See also #1830.
  129.  
  130.  
  131. From:    Richard Parkinson                      Rec'd
  132. To:      Kevin Kitsemetry                       Msg #1824, Nov-02-93 01:38PM
  133. Subject: C32 V9.5 problems
  134.  
  135. Hello,
  136.  
  137. I am currently porting an OS/2 16 bit app written with Microsoft C6.0 to an
  138. OS/2 32 bit app with Watcom C/C++32 V9.5.
  139.  
  140. I have found that there seems to be a problem with the Watcom compiler.
  141.  
  142. Basicall my program has some large and complex structures which contain
  143. pointers to other structures. These are all dynamically allocated with
  144. DosAllocSharedMem.
  145.  
  146. Everthing works fine untill I access data that is in a structure which itself
  147. is part of a structure.
  148.  
  149. i.e.
  150.  
  151. Structure 1
  152.  
  153.   long var1;
  154.   long var2;
  155.   struct struct2 *struct2;
  156.  
  157. structure 2
  158.  
  159.    long var1;
  160.    long var2;
  161.  
  162. if I allocate memory for an array of structure 1 and then allocate an array of
  163. structure2 within structure1 I cant access any of structure 2, I get a PV.
  164.  
  165. If however I copy the address from the structure pointer in structure 1 to a
  166. temporary variable I CAN access the memory.
  167.  
  168. All this worked fine with the Microsoft compiler so I can only assume that
  169. there is a bug in the Watcom compiler that causes an incorrect address to be
  170. returned when you have a structure array that contains a structure array.
  171.  
  172. If you nead any more information just let me know, but for now I can-not use
  173. the watcom compiler for my app. This is a serious bug!
  174.  
  175. Regards,
  176.  
  177. Richard Parkinson.
  178.  
  179. *** See also #1831.
  180.  
  181.  
  182. From:    Kevin Kitsemetry                       Rec'd
  183. To:      Jason Blochowiak                       Msg #1825, Nov-02-93 04:30PM
  184. Subject: Locking for VM
  185.  
  186.  JB>  As expected, the DPMI functions themselves aren't
  187.  JB> that big of a deal. What I need to know is how to
  188.  JB> determine the values to pass - where the code for the
  189.  JB> program resides & how long it is, and where the static
  190.  JB> data resides and how long it is. I don't recall seeing
  191.  JB> how to determine these values on my previous scans of
  192.  JB> the documentation - if I'm having a memory lapse,
  193.  JB> pointing me to the right page in the docs (I have 9.5)
  194.  JB> would be entirely sufficient.
  195.  
  196.  
  197.  
  198. /* Here's how to lock a function called "lockme"
  199. */
  200. int lockme ()
  201.         {
  202.         }
  203.  
  204. int function_after_lockme ();
  205.         {
  206.         }
  207.  
  208. int lock_lockme ()
  209.         {
  210.         void *p;
  211.         int len;
  212.  
  213.         p = (void *) lockme;            /* p = linear address to lock */
  214.         len = (char *) function_after_lockme - (char *) lockme;
  215.                                         /* len = length of area to lock */
  216.  
  217.         /* now load BX:CX with 'p' and SI:DI with 'len' and issue int 31h/
  218.            600h to lock the code for the function
  219.         */
  220.         }
  221.  
  222. *** This is a reply to #1795.  *** See also #1894.
  223.  
  224.  
  225. From:    Kevin Kitsemetry                       Rec'd
  226. To:      Howard Keller                          Msg #1826, Nov-02-93 04:34PM
  227. Subject: Zinc Application Framework 3.5 and Watcom C++32 for NT
  228.  
  229.  HK> I'm not sure who to address this letter to.
  230.  HK> I'm trying to use the Zinc Application Framework 3.5 to build
  231.  HK> applications for both OS/2 2.1 and WindowsNT.  No
  232.  HK> problem with OS/2, but Zinc doesn't provide libraries
  233.  HK> for the 9.5 WindowsNT compiler.  When inquiring about
  234.  HK> this from Zinc teck support, I was told that they have
  235.  HK> enperienced "serious problems" with the Watcom C++32
  236.  HK> 9.5 NT compiler and they don't plan to support it
  237.  HK> until the problems have been resolved.  I was unable
  238.  HK> to find out the nature of the problems.  Is anyone
  239.  HK> aware of this at Watcom and if there is a problem,
  240.  HK> what's the time frame for repair?
  241.  
  242. I have talked with our person responsible for Third Party
  243. Vendor Support for WATCOM products, and he told me that
  244. we are aware of the problems, and are currently working with Zinc to resolve
  245. them.
  246.  
  247.  
  248. Kevin Kitsemetry
  249. WATCOM TECHNICAL SUPPORT
  250.  
  251. *** This is a reply to #1761.
  252.  
  253.  
  254. From:    Kevin Kitsemetry                       Rec'd
  255. To:      Marcus Erickson                        Msg #1830, Nov-03-93 10:49AM
  256. Subject: Problem with Patching 9.5 (a)
  257.  
  258.  ME> I am haing trouble applying my 'A' version patch to my version 9.5
  259.  ME> DOS32 compiler.  I purchased 9.0 but received a free copy of 9.5 at
  260.  ME> SD 93. When I try to apply the A level patches, I get the warning that
  261.  ME> BPATCH can not apply the patches because the file
  262.  ME> sizes are different than what it expects.
  263.  
  264. You can run the techinfo utility to see if the files are already patched to
  265. level 'a'.  If you think that the files have been corrupted somehow, you can
  266. re-install the compiler and then apply the patches. Remember, you must apply
  267. them in DOS, not OS/2.
  268.  
  269.  
  270. Kevin Kitsemetry
  271. WATCOM TECHNICAL SUPPORT
  272.  
  273. *** This is a reply to #1823.  *** See also #1841.
  274.  
  275.  
  276. From:    Kevin Kitsemetry
  277. To:      Richard Parkinson                      Msg #1831, Nov-03-93 10:52AM
  278. Subject: C32 V9.5 problems
  279.  
  280.  RP> Hello,
  281.  
  282.  RP> I am currently porting an OS/2 16 bit app written with
  283.  RP> Microsoft C6.0 to an OS/2 32 bit app with Watcom
  284.  RP> Basicall my program has some large and complex
  285.  RP> structures which contain pointers to other structures.
  286.  RP> These are all dynamically allocated with
  287.  RP> DosAllocSharedMem.
  288.  
  289.  
  290.  RP> If however I copy the address from the structure
  291.  RP> pointer in structure 1 to a
  292.  RP> temporary variable I CAN access the memory.
  293.  
  294.  RP> If you nead any more information just let me know, but
  295.  RP> for now I can-not use the watcom compiler for my app.
  296.  RP> This is a serious bug!
  297.  
  298. Can you provide us with a small example program that illustrates the problem,
  299. so that we can reproduce it here?  You can upload it in file area 12 on this
  300. BBS.
  301.  
  302.  
  303. Kevin Kitsemetry
  304. WATCOM TECHNICAL SUPPORT
  305.  
  306. *** This is a reply to #1824.
  307.  
  308.  
  309. From:    Nicos Skouras                          Rec'd
  310. To:      Kevin Kitsemetry                       Msg #1833, Nov-03-93 01:04PM
  311. Subject: WVIDEO
  312.  
  313. I believe that I misused the word 'in the weeds'. The WVIDEO is still active
  314. but because the system has switched to Graphics Mode any motion
  315. of the mouse ( to select anything from the menus ) results in a trail of
  316. non-characters that makes the screen completely garbled after a while.
  317. Thanks for your efforts
  318. Nicos skouras
  319.  
  320.  
  321. From:    Nicos Skouras                          Rec'd
  322. To:      Kevin Kitsemetry                       Msg #1834, Nov-03-93 01:08PM
  323. Subject: C++32 & get/set vectors
  324.  
  325. Using C++32 9.5a, Pharlap 4.0, and attempting to use the functions:
  326. _dos_getvevct, _dos_setvect & _chain_intr I get no results, not even
  327. mem. exception errors.
  328. To verify it I went away from my software and did a test module using
  329. the examples in page 138, 154 & 87 of the Library Functions manual
  330. (4th edition) with the same results.
  331. Any help on the subject ??
  332. Thanks Nicos Skouras
  333.  
  334. *** See also #1847.
  335.  
  336.  
  337. From:    Kevin Blenkinsopp                      Rec'd
  338. To:      Kevin Kitsemetry                       Msg #1838, Nov-03-93 06:51PM
  339. Subject: Zero-sized arrays, const-ness
  340.  
  341. Kevin,
  342.  
  343. first off, thanks for sorting out that locked port problem.
  344. Couple of compiler problems for you:
  345. first,
  346.   struct frog {
  347.     int n;
  348.     char a[];
  349.   };
  350. throws up an error because of the zero-sized array. It's legal ANSI (I think)
  351. and it's definitely legal MS (I'm porting the code) - I thought there might be
  352. a switch to enable things like this, but I can't find it in the docs.
  353. Also,
  354.   const int n = 32;
  355.   char buf[n];
  356. chokes on the declaration of buf because it says it needs a constant
  357. expression inside the brackets. It's as if the compiler has lost the const-
  358. ness of the int. Similar problems (not surprisingly) with
  359.   const char *s="frog";
  360.   char buf[strlen(s)];
  361. which is how I found it in the first place.
  362.  
  363. Any suggestions would be greatly appreciated.
  364.  
  365. Cheers,
  366.  
  367. Kevin
  368.  
  369. *** See also #1840.
  370.  
  371.  
  372. From:    David Zechiel                          Rec'd
  373. To:      Kevin Kitsemetry                       Msg #1839, Nov-03-93 07:48PM
  374. Subject: asm directive
  375.  
  376. Does the C++ compiler support the asm compiler directive in extended mode?  I
  377. can't locate much about this in the documentation.
  378.  
  379.   Thanks in advance,
  380.  
  381.   Dave Zechiel
  382.  
  383. *** See also #1849.
  384.  
  385.  
  386. From:    Anthony Scian                          Rec'd
  387. To:      Kevin Blenkinsopp                      Msg #1840, Nov-04-93 10:49AM
  388. Subject: Zero-sized arrays, const-ness
  389.  
  390.  KB> Couple of compiler problems for you:
  391.  KB> first,
  392.  KB>   struct frog {
  393.  KB>     int n;
  394.  KB>     char a[];
  395.  KB>   };
  396.  KB> throws up an error because of the zero-sized array.
  397.  KB> It's legal ANSI (I think) and it's definitely legal MS
  398.  KB> (I'm porting the code) - I thought there might be a
  399.  KB> switch to enable things like this, but I can't find it
  400.  KB> in the docs.
  401.  
  402.  This is definitely not legal ANSI although it is an MS extension.
  403.  The C compiler accepts this but the C++ compiler correctly rejects
  404.  it as incorrect.  We've logged this as a possible enhancement to
  405.  the C++ compiler.
  406.  
  407.  KB> Also,
  408.  KB>   const int n = 32;
  409.  KB>   char buf[n];
  410.  
  411.  The C compiler is correct in rejecting this code.  This works fine
  412.  in C++.
  413.  
  414.  KB> chokes on the declaration of buf because it says it needs a constant
  415.  KB> expression inside the brackets. It's as if the
  416.  KB> compiler has lost the const-ness of the int. Similar
  417.  KB> problems (not surprisingly) with
  418.  KB>   const char *s="frog";
  419.  KB>   char buf[strlen(s)];
  420.  
  421. This is incorrect, array dimensions must be constant.  Both the C and C++
  422. compilers are correct in rejecting this code.
  423.  
  424. *** This is a reply to #1838.
  425.  
  426.  
  427. From:    Marcus Erickson                        Rec'd
  428. To:      Kevin Kitsemetry                       Msg #1841, Nov-04-93 11:38AM
  429. Subject: Problem with Patching 9.5 (a)
  430.  
  431. Thanks for your suggestions by unfortunately they do not apply in my
  432. situation.  I have a version of 9.5 according to the banners.
  433. An example file:
  434.    FILE: WCC386.EXE
  435.    SIZE: 625566 bytes
  436.    DATE: 2/11/93
  437.  
  438.    BPATCH -Q: Says that file has not been patched
  439.    BANNER   : Says that it is version 9.5
  440.  
  441.    When I try to apply the A patch, I get the message existing file
  442.    is the wrong size. Expecting file of size 627702 bytes and found one
  443.    with size 625566 bytes.
  444.  
  445.    I was wondering if the free releases of the 9.5 compiler given
  446.    out at SD 3 were pre-releases or special releaes or something?
  447.  
  448.    Thanks for your help!
  449.  
  450. *** This is a reply to #1830.  *** See also #1850.
  451.  
  452.  
  453. From:    Skip Fedanzo
  454. To:      Watcom                                 Msg #1842, Nov-04-93 08:39PM
  455. Subject: realloc() with DOS4G professional
  456.  
  457. I discovered with the new DOS4G Professional that realloc() isn't working
  458. correctly and am wondering when WATCOM is issuing a fix.
  459.  
  460. *** See also #1852.
  461.  
  462.  
  463. From:    Colly Myers
  464. To:      All                                    Msg #1843, Nov-04-93 10:12PM
  465. Subject: Classes in DLLs
  466.  
  467. Is it possible to put a class library in a DLL under Windows/NT and if it is
  468. possible can sub-classes reference the DLL from the main program.
  469.  
  470. Colly Myers
  471.  
  472. *** See also #1853.
  473.  
  474.  
  475. From:    Kevin Kitsemetry                       Rec'd
  476. To:      Nicos Skouras                          Msg #1847, Nov-05-93 02:57PM
  477. Subject: C++32 & get/set vectors
  478.  
  479.  NS> Using C++32 9.5a, Pharlap 4.0, and attempting to use the functions:
  480.  NS> _dos_getvevct, _dos_setvect & _chain_intr I get no results, not even
  481.  NS> mem. exception errors.
  482.  NS> To verify it I went away from my software and did a test module using
  483.  NS> the examples in page 138, 154 & 87 of the Library Functions manual
  484.  NS> (4th edition) with the same results.
  485.  
  486. I just tried the getvect.c example (provided in src\clibexam) and it worked
  487. fine with 9.5a.  What problem did you have?  What was the output after you ran
  488. this example program?
  489.  
  490.  
  491. Kevin Kitsemetry
  492. WATCOM TECHNICAL SUPPORT
  493.  
  494. *** This is a reply to #1834.  *** See also #1851.
  495.  
  496.  
  497. From:    Kevin Kitsemetry                       Rec'd
  498. To:      David Zechiel                          Msg #1849, Nov-05-93 03:11PM
  499. Subject: asm directive
  500.  
  501.  DZ> Does the C++ compiler support the asm compiler
  502.  DZ> directive in extended mode?  I can't locate much about
  503.  DZ> this in the documentation.
  504.  
  505. No, WATCOM C++ supports in-line assembly instructions via a pragma statement.
  506. This is documented (a bit) in the User's Guide beginning on page 166.
  507. Although it looks like they
  508. are called as functions, the compiler actually generates the code in-line.
  509.  
  510.  
  511. Kevin Kitsemetry
  512. WATCOM TECHNICAL SUPPORT
  513.  
  514. *** This is a reply to #1839.
  515.  
  516.  
  517. From:    Kevin Kitsemetry                       Rec'd
  518. To:      Marcus Erickson                        Msg #1850, Nov-05-93 03:19PM
  519. Subject: Problem with Patching 9.5 (a)
  520.  
  521.  ME>    I was wondering if the free releases of the 9.5 compiler given
  522.  ME>    out at SD 3 were pre-releases or special releaes or something?
  523.  
  524. I was unaware of this before.  The SD version that were given away for free
  525. cannot be patched.  You have the option of upgrading to the General
  526. Availability release of the compiler if you wish, which could then be patched.
  527.  
  528.  
  529. Kevin Kitsemetry
  530. WATCOM TECHNICAL SUPPORT
  531.  
  532. *** This is a reply to #1841.
  533.  
  534.  
  535. From:    Nicos Skouras                          Rec'd
  536. To:      Kevin Kitsemetry                       Msg #1851, Nov-05-93 03:25PM
  537. Subject: C++32 & get/set vectors
  538.  
  539. I did not use the example program, just copied the code from the library
  540. manual. It behaved as if the timer was never intercepted or chained.
  541. I'll try using the getvect.c and see.
  542. Thanks for your efforts
  543. Nicos Skouras
  544.  
  545. *** This is a reply to #1847.
  546.  
  547.  
  548. From:    Kevin Kitsemetry                       Rec'd
  549. To:      Skip Fedanzo                           Msg #1852, Nov-05-93 03:22PM
  550. Subject: realloc() with DOS4G professional
  551.  
  552.  SF> I discovered with the new DOS4G Professional that realloc() isn't working
  553.  SF> correctly and am wondering when WATCOM is issuing a fix.
  554.  
  555. Which problem are you referring to?  Perhaps the file RSIMEM in file area 10
  556. will help you.  It shows how to acquire large blocks of memory under the
  557. Rational DOS extender.
  558.  
  559.  
  560. Kevin Kitsemetry
  561. WATCOM TECHNICAL SUPPORT
  562.  
  563. *** This is a reply to #1842.  *** See also #1857.
  564.  
  565.  
  566. From:    Kevin Kitsemetry                       Rec'd
  567. To:      Colly Myers                            Msg #1853, Nov-05-93 03:30PM
  568. Subject: Classes in DLLs
  569.  
  570.  CM> Is it possible to put a class library in a DLL under
  571.  CM> Windows/NT and if it is possible can sub-classes
  572.  CM> reference the DLL from the main program.
  573.  
  574. Both are possible, BUT:  There were problems with the C++
  575. compiler under Windows NT that have been fixed and will be
  576. made available in the B-level patches.
  577.  
  578.  
  579. Kevin Kitsemetry
  580. WATCOM TECHNICAL SUPPORT
  581.  
  582. *** This is a reply to #1843.
  583.  
  584.  
  585. From:    Nicos Skouras                          Rec'd
  586. To:      Kevin Kitsemetry                       Msg #1854, Nov-05-93 04:22PM
  587. Subject: getvect.c (src\clibexam- C++ 9.5A )
  588.  
  589. Reference previous messages: 1834, 1847, 1851 (which should be deleted)
  590. I compiled the getvect.c test program with the same results:
  591. The executable displays: "Delayed for 1 second" the number of times it
  592. should ( 15 ) and the the program terminates without displaying the '.'
  593. expected after each 5 sec intervals and the variable clock_ticks never gets
  594. incremented !!!.
  595. I do not believe that the set/get/chain function actually WORK
  596. Please advise
  597. Thanks
  598. Nicos skouras
  599.  
  600. *** See also #1862.
  601.  
  602.  
  603. From:    Matthew Heinze
  604. To:      Mark Yu                                Msg #1855, Nov-05-93 06:35PM
  605. Subject: C++ Sampler Programs
  606.  
  607.  MY> We're using v9.5 to build 32-bit windows apps and I was wondering if you
  608.  MY> could post some C++ sample programs on the BBS.
  609.  
  610. I have placed a C++ example in the WATCOM C file area, #10.  This is a simple
  611. calendar example that will be updated as new versions are available.
  612.  
  613.  MY> Borland or Zortech)?  Finally, when I mix C++ and C
  614.  MY> programs and invoke wmake to do the build, I get
  615.  MY> numerous undefined references of global data (the
  616.  MY> programs compile fine using Borland C++).  Is there
  617.  MY> some encapsulation that must be performed on the data
  618.  MY> (as one does with functions using extern "C" { etc.)?
  619.  
  620. Please provide a small example of the problem you are having mixing C and C++
  621. so that we can reproduce the problem here.
  622.  
  623. Matthew Heinze
  624. WATCOM TECHNICAL SUPPORT
  625.  
  626. *** This is a reply to #1487.
  627.  
  628.  
  629. From:    Donald Tevault
  630. To:      Watcom Technical Support               Msg #1856, Nov-06-93 05:27AM
  631. Subject: Make utility
  632.  
  633.         Is the make utility for the C/C++32 compiler package meant to work
  634. with the C++ compiler?  It seems that it isn't, since all of your example
  635. MAKEFILES are written for the C compiler,  and since I can't get it to work
  636. with the C++ compiler.  This presents a problem for me, because I'm trying to
  637. use the C++ compiler with Kedwell Software's Databoss for Windows package.
  638. Databoss generates C++ code and a makefile for it.  The make utility will
  639. recognize the C++ files if I add the line ".EXTENSION .CPP".  However, it
  640. still will not invoke the C++ compiler, and just dumps me back out to DOS
  641. without any error messeges.  To make things even more frustrating, none of the
  642. included manuals mention that the make utility will not work with C++.
  643.         Thanks for your time.  I'll check back next week for a reply.
  644.                                  Sincerely,
  645.                                  Donald A. Tevault
  646.                                  Registration number:
  647.  
  648. *** See also #1863.
  649.  
  650.  
  651. From:    Skip Fedanzo                           Rec'd
  652. To:      Kevin Kitsemetry                       Msg #1857, Nov-06-93 11:56AM
  653. Subject: realloc() under DOS4G Professional
  654.  
  655. The specific problem I refer to concerns realloc() freeing previously
  656. malloced data space.  I have an application that does a fair amount of
  657. malloc/realloc/freeing and it runs slower and slower over time, apparently
  658. because it's wending its way through memory that should have
  659. been returned to the free list.  I'm hypothesizing the cause, but the
  660. type of bug reported by Rational would produce the effect I observe;
  661. hence my interest.
  662.  
  663. *** This is a reply to #1852.  *** See also #1864.
  664.  
  665.  
  666. From:    Norm Case
  667. To:      Tech-Support                           Msg #1858, Nov-09-93 10:23AM
  668. Subject: File Handles in NT DLL's
  669.  
  670. KK> Duplicate.
  671.  
  672.  
  673. Here is a new problem I ran into with using file handles 'creat'ed in the main
  674. application and then passed on to a function in a DLL.
  675.  
  676. cprob5.c:
  677.  
  678. #include <sys\types.h>
  679. #include <sys\stat.h>
  680. #include <io.h>
  681.  
  682. void main()
  683.    {
  684.    int handle;
  685.  
  686.    handle = creat("file", S_IWRITE | S_IREAD);
  687.    use_handle_in_dll(handle);
  688.    close(handle);
  689.    }
  690.  
  691.  
  692. cprob5a.c:
  693.  
  694. #include <sys\types.h>
  695. #include <sys\stat.h>
  696. #include <io.h>
  697. #include <errno.h>
  698.  
  699. void use_handle_in_dll(int handle)
  700.    {
  701.    int err;
  702.  
  703.    err = write(handle,"hello", 6);
  704.    printf("handle = %d, err = %d, errno = %d\n", handle, err, errno);
  705.    }
  706.  
  707.  
  708. cprob5.lnk:
  709.  
  710. system nt
  711. name cprob5dl.exe
  712. option map=cprob5.map
  713. debug all
  714. file cprob5
  715. library cprob5a.lib
  716.  
  717. cprob5a.lnk:
  718.  
  719. system nt_dll initinstance terminstance
  720. option map=cprob5a.map
  721. debug all
  722. name cprob5a.dll
  723. file cprob5a
  724. export use_handle_in_dll
  725.  
  726. If I link cprob5 straight (cprob5.exe) with cprob5a (not from DLL) then the
  727. result is as expected, handle = 3, err = 6 (number of bytes written) and errno
  728. = 0.  But, if I link cprob5a with cprob5a in a DLL (cprob5dl.exe) then the
  729. rusult is, handle = 3, err = -1, errno = 4, indicating a bad file handle.
  730.  
  731. The file 4deanne5.zip contains the files needed to demonstrate this problem.
  732.  
  733. Please let me know as soon as possible the solution or a work around to this
  734. problem.  Thanks for you help.
  735.  
  736. Norman Case
  737. 4D Graphics
  738.  
  739. (206) 432-4987
  740.  
  741.  
  742. From:    Norm Case                              Rec'd
  743. To:      Kevin Kitsemetry                       Msg #1860, Nov-09-93 10:22AM
  744. Subject: File handles in NT DLL's
  745.  
  746. KK> Duplicate message.
  747.  
  748.  
  749. Here is a new problem I ran into with using file handles 'creat'ed in the main
  750. application and then passed on to a function in a DLL.
  751.  
  752. cprob5.c:
  753.  
  754. #include <sys\types.h>
  755. #include <sys\stat.h>
  756. #include <io.h>
  757.  
  758. void main()
  759.    {
  760.    int handle;
  761.  
  762.    handle = creat("file", S_IWRITE | S_IREAD);
  763.    use_handle_in_dll(handle);
  764.    close(handle);
  765.    }
  766.  
  767.  
  768. cprob5a.c:
  769.  
  770. #include <sys\types.h>
  771. #include <sys\stat.h>
  772. #include <io.h>
  773. #include <errno.h>
  774.  
  775. void use_handle_in_dll(int handle)
  776.    {
  777.    int err;
  778.  
  779.    err = write(handle,"hello", 6);
  780.    printf("handle = %d, err = %d, errno = %d\n", handle, err, errno);
  781.    }
  782.  
  783.  
  784. cprob5.lnk:
  785.  
  786. system nt
  787. name cprob5dl.exe
  788. option map=cprob5.map
  789. debug all
  790. file cprob5
  791. library cprob5a.lib
  792.  
  793. cprob5a.lnk:
  794.  
  795. system nt_dll initinstance terminstance
  796. option map=cprob5a.map
  797. debug all
  798. name cprob5a.dll
  799. file cprob5a
  800. export use_handle_in_dll
  801.  
  802. If I link cprob5 straight (cprob5.exe) with cprob5a (not from DLL) then the
  803. result is as expected, handle = 3, err = 6 (number of bytes written) and errno
  804. = 0.  But, if I link cprob5a with cprob5a in a DLL (cprob5dl.exe) then the
  805. rusult is, handle = 3, err = -1, errno = 4, indicating a bad file handle.
  806.  
  807. The file 4deanne5.zip contains the files needed to demonstrate this problem.
  808.  
  809. Please let me know as soon as possible the solution or a work around to this
  810. problem.  Thanks for you help.
  811.  
  812. Norman Case
  813. 4D Graphics
  814.  
  815. (206) 432-4987
  816.  
  817.  
  818. From:    Karsten Kiehlmann                      Rec'd
  819. To:      Kevin Kitsemetry                       Msg #1861, Nov-08-93 07:36PM
  820. Subject: Var.Access Pmode Rmode --> MORE INFORMATION NEEDED <--
  821.  
  822. Dear Kevin,
  823.  
  824. thanks for your first answer.
  825.  
  826. Unfortunately it doesn't cover all of our questions which I'd tried to specify
  827. more exactly in the  last message. So could you please answer to  all of the
  828. questions in message no. 1773 ??
  829.  
  830. Your last answer doesn't solve our problems.
  831.  
  832. Thanks.
  833.  
  834. With best regards,
  835.  
  836. K. Kiehlmann
  837.  
  838. c/o IAV GmbH, Dept. Electronic, Carnotstrasse 1, D-10587 Berlin, F.R.G.
  839.     Tel.:  +49  30  39 08 08 54       Fax.: +49  30  39 08 08 90
  840.  
  841. *** This is a reply to #1789.  *** See also #1865.
  842.  
  843.  
  844. From:    Kevin Kitsemetry                       Rec'd
  845. To:      Nicos Skouras                          Msg #1862, Nov-09-93 10:10AM
  846. Subject: getvect.c (src\clibexam- C++ 9.5A )
  847.  
  848.  NS> Reference previous messages: 1834, 1847, 1851 (which should be deleted)
  849.  NS> I compiled the getvect.c test program with the same results:
  850.  NS> The executable displays: "Delayed for 1 second" the number of times it
  851.  NS> should ( 15 ) and the the program terminates without displaying the '.'
  852.  NS> expected after each 5 sec intervals and the variable
  853.  NS> clock_ticks never gets
  854.  NS> incremented !!!.
  855.  
  856. What is your environment that you are running this in.  Send a copy of the
  857. output from running techinfo.exe (don't forget to have the WATCOM environment
  858. variable set).
  859.  
  860.  
  861. Kevin Kitsemetry
  862. WATCOM TECHNICAL SUPPORT
  863.  
  864. *** This is a reply to #1854.  *** See also #1866.
  865.  
  866.  
  867. From:    Kevin Kitsemetry                       Rec'd
  868. To:      Donald Tevault                         Msg #1863, Nov-09-93 10:13AM
  869. Subject: Make utility
  870.  
  871.  DT>         Is the make utility for the C/C++32 compiler package meant to
  872.  DT> work with the C++ compiler?  It seems that it isn't,
  873.  DT> since all of your example MAKEFILES are written for
  874.  DT> the C compiler,  and since I can't get it to work with
  875.  DT> the C++ compiler.  This presents a problem for me,
  876.  DT> because I'm trying to use the C++ compiler with
  877.  DT> Kedwell Software's Databoss for Windows package.
  878.  DT> Databoss generates C++ code and a makefile for it.
  879.  DT> The make utility will recognize the C++ files if I add
  880.  DT> the line ".EXTENSION .CPP".  However, it still will
  881.  DT> not invoke the C++ compiler, and just dumps me back
  882.  DT> out to DOS without any error messeges.  To make things
  883.  
  884. Because the C++ is so new, there aren't any examples of
  885. using wmake with it.  There are many ways that you can use
  886. it (it does indeed work).  Try creating a makefile to build calendar.cpp.  If
  887. you can't get it work, upload your makefile attempt and I will have a look at
  888. it.
  889.  
  890.  
  891. Kevin Kitsemetry
  892. WATCOM TECHNICAL SUPPORT
  893.  
  894. *** This is a reply to #1856.
  895.  
  896.  
  897. From:    Kevin Kitsemetry                       Rec'd
  898. To:      Skip Fedanzo                           Msg #1864, Nov-09-93 10:16AM
  899. Subject: realloc() under DOS4G Professional
  900.  
  901.  SF> The specific problem I refer to concerns realloc() freeing previously
  902.  SF> malloced data space.  I have an application that does a fair amount of
  903.  SF> malloc/realloc/freeing and it runs slower and slower
  904.  SF> over time, apparently because it's wending its way
  905.  SF> through memory that should have
  906.  SF> been returned to the free list.  I'm hypothesizing the cause, but the
  907.  SF> type of bug reported by Rational would produce the effect I observe;
  908.  SF> hence my interest.
  909.  
  910. No, they type of bug that Rational is talking about would report that the
  911. malloc() failed because there was insufficient memory available.  It has to do
  912. with the fact that after many malloc() and free()'s, the memory becomes
  913. fragmented.  Other DOS extenders have implimented a feature,whereby the
  914. fragmented memory is recognized as a large chunk (joining the pieces) so that
  915. the fragmentation appears non existant.  Rational does not do this.
  916.  
  917.  
  918. Kevin Kitsemetry
  919. WATCOM TECHNICAL SUPPORT
  920.  
  921. *** This is a reply to #1857.  *** See also #1867.
  922.  
  923.  
  924. From:    Kevin Kitsemetry                       Rec'd
  925. To:      Karsten Kiehlmann                      Msg #1865, Nov-09-93 10:28AM
  926. Subject: Var.Access Pmode Rmode --> MORE INFORMATION NEEDED <--
  927.  
  928.  KK> Dear Kevin,
  929.  KK> thanks for your first answer.
  930.  KK>
  931.  KK> Unfortunately it doesn't cover all of our questions
  932.  KK> which I'd tried to specify more exactly in the  last
  933.  KK> message. So could you please answer to  all of the
  934.  KK> questions in message no. 1773 ??
  935.  
  936. Sorry about the confusion.  The message I posted was in response to an earlier
  937. message from someone else (the fist message sent by I believe one of your
  938. collegues).  I have to check the answers to the questions in 1773 before I
  939. posted a reply to that message.  I believe this is the reply you were waiting
  940. for:
  941.  
  942.  
  943. KK> 1 How can proteceted mode code be called from real mode code (ISR's) ?
  944.  
  945. Protected mode code and data are not in general accessible to real mode ISRs,
  946. because they may be in extended memory, and can't be addressed in real mode.
  947. The only way to access them would be to pass up into protected mode on another
  948. interrupt vector.  32-bit protected-mode code wouldn't run in 16-bit real mode
  949. anyway.
  950.  
  951.  
  952. KK> 2 How can real mode variables be installed / declaired so that they are
  953. KK> accessable from real mode code (the stupid ISR's
  954. KK> again) as well as from protected mode code, too ?
  955.  
  956. Real mode "variables" don't exist.  You can move data to low memory so it's
  957. accessible to both protected mode code and real mode code, but the concept of
  958. a variable implies a symbolic name, and the only way to use a symbolic name is
  959. to link for the appropriate mode.  Since DOS/4GW programs are always linked
  960. for protected mode, any code one manages to coax into low memory and run as an
  961. ISR can't assume any addresses external to it are valid -- all it can assume
  962. is that it can read and write to absolute offsets within its own CS.  There's
  963. no support in DOS/4GW for more sophisticated mixed-mode programming.
  964.  
  965.  
  966. KK> 3 Are there any other possiblities to install real
  967. KK> mode code (ISR's) than you did in your example
  968. KK> 'bimodal' (that's funny but not sufficent)?
  969.  
  970. To date, that is our only programming example that we have.
  971.  
  972.  
  973. Kevin Kitsemetry
  974. WATCOM TECHNICAL SUPPORT
  975.  
  976. *** This is a reply to #1861.
  977.  
  978.  
  979. From:    Nicos Skouras                          Rec'd
  980. To:      Kevin Kitsemetry                       Msg #1866, Nov-09-93 04:21PM
  981. Subject: getvect.c (src\clibexam- C++ 9.5A )
  982.  
  983. Please see File area #12 where I uploaded a file TECHINFO.OUT
  984. Thanks for the efforts
  985. Nicos Skouras
  986.  
  987. *** This is a reply to #1862.  *** See also #1870.
  988.  
  989.  
  990. From:    Tim Anderson
  991. To:      Kevin Kreutzweiser                     Msg #1868, Nov-10-93 05:06PM
  992. Subject: C++ not compatible w/C
  993.  
  994. KK> Internal Report #10014
  995.  
  996.  
  997. Hey, it's simply amazing that you are asking questions on something I'm
  998. working on again! Just an aside, however. You don't hear me asking questions
  999. about the NT stuff anymore. This should be a WARNING to you since when I USE
  1000. stuff I generally COMMENT on it. We are still using Watcom for Windows 32bit
  1001. though...
  1002.  
  1003. Anyway, I want the function prototype generator to generate C++ compatible
  1004. function prototypes. I want to be able to dump out ALL function prototypes
  1005. whether they are STATIC or not, and I want the original TYPEDEF's or #defines
  1006. and NOT what the preprocessor sez they should be. So we need a couple new
  1007. flags. -v can be dump out non-static function prototypes -v1 can be dump out
  1008. ALL function prototypes, regardless if they are static or not. This would help
  1009. me to get our stuff to compile under C++,so that I can start playing with C++
  1010. stuff. Note: I am not having any problems doing EXACTLY THIS (sans
  1011. preprocessor unfortunately) using the development environment for NT that was
  1012. developed by a company in Redmond.
  1013.  
  1014. Oh ya, the static's HAVE to have 'static' in front of them, and the non
  1015. static's HAVE to have 'extern' in front of them. Also, there is a problem with
  1016. two dimensional array's and the function prototyper.
  1017.  
  1018. foo(int spaz[2][2]);
  1019.  
  1020. is dumped
  1021.  
  1022. int foo(int spaz(*)[2]);
  1023.  
  1024. This is OK for C land, but not OK for C++ land. All you have to do to watch
  1025. this thing explode is to generate prototypes and try to use them. Yes, we
  1026. should have been doing this from day one. Unfortunately I have quite a few
  1027. files that I need to prototype (and also create extern's for the equivolent H
  1028. file) and I want to do this automatically. We have been able to do this for C,
  1029. but noone has a prototype generator that allows CROSS PLATFORM and CROSS
  1030. LANGUAGE prototypes. I can't beleive that I am the only one in the world that
  1031. is doing this...
  1032.  
  1033. Tim
  1034.  
  1035. *** This is a reply to #1434.
  1036.  
  1037.  
  1038. From:    Russell Williamson                     Rec'd
  1039. To:      Kevin Kitsemetry                       Msg #1869, Nov-09-93 10:14PM
  1040. Subject: WVIDEO messages
  1041.  
  1042. While debugging a 32-bit C++ (9.5 level A) program built for DOS/4GW, I often
  1043. see the message 'No memory for type'.  Is this a memory shortage, or a failure
  1044. to recognize a type?  Also, WVIDEO often fails to recognize the symbol 'this'
  1045. while tracing through a member function.  Could this be related to the
  1046. first error?
  1047.  
  1048. *** See also #1872.
  1049.  
  1050.  
  1051. From:    Kevin Kitsemetry                       Rec'd
  1052. To:      Nicos Skouras                          Msg #1870, Nov-10-93 10:14AM
  1053. Subject: getvect.c (src\clibexam- C++ 9.5A )
  1054.  
  1055.  NS> Please see File area #12 where I uploaded a file TECHINFO.OUT
  1056.  NS> Thanks for the efforts
  1057.  NS> Nicos Skouras
  1058.  
  1059. I tried it with Pharlap 5.0 and it worked fine.  I have taken a look at the
  1060. techinfo output and you seem to have
  1061. everything patched correctly.  Can you try the .exe on another computer?
  1062.  
  1063.  
  1064. Kevin Kitsemetry
  1065. WATCOM TECHNICAL SUPPORT
  1066.  
  1067. *** This is a reply to #1866
  1068.  
  1069. From:    Kevin Kitsemetry                       Rec'd
  1070. To:      Russell Williamson                     Msg #1872, Nov-10-93 05:11PM
  1071. Subject: WVIDEO messages
  1072.  
  1073.  RW> While debugging a 32-bit C++ (9.5 level A) program
  1074.  RW> built for DOS/4GW, I often see the message 'No memory
  1075.  RW> for type'.  Is this a memory shortage, or a failure to
  1076.  RW> recognize a type?  Also, WVIDEO often fails to
  1077.  RW> recognize the symbol 'this' while tracing through a
  1078.  RW> member function.  Could this be related to the
  1079.  RW> first error?
  1080.  
  1081. The first problem is likely due to fact that you are running out of dymanic
  1082. memory in the debugger.  Try increasing the amount of dymanic space used by
  1083. WVIDEO by specifying /dynamic=xxx.  The default is 40K.  If this doesn't work
  1084. you may have to use one of the remote debugging methods to debug your
  1085. application.
  1086.  
  1087.  
  1088. Kevin Kitsemetry
  1089. WATCOM TECHNICAL SUPPORT
  1090.  
  1091. *** This is a reply to #1869.
  1092.  
  1093.  
  1094. From:    Kevin Blenkinsopp                      Rec'd
  1095. To:      Kevin Kitsemetry                       Msg #1877, Nov-11-93 12:45PM
  1096. Subject: Profiling
  1097.  
  1098. * Original Area: wc
  1099. * Original To  : Kevin Kitsemetry (1:221/186)
  1100.  
  1101. Kevin,
  1102.  
  1103. I've been trying to profile some code, and wprof is telling me that my code is
  1104. spending 100% of its time in OS/external stuff. This seemed pretty unlikely to
  1105. me, so I hacked up a little noddy progam and tried again. This time, wprof
  1106. tells me that there aren't any samples in the file. I've uploaded the noddy
  1107. code to the file area. It was compiled with wcl386 -d2, using c++ 9.5a and
  1108. dos4g. Incidentally, if I run samprsi with "dos4gw wsamprsi t" like it says in
  1109. the manual, I get a dos4gw error saying it can't find the loader for wsamprsi.
  1110. Just running "wsamprsi t" seems to be fine. Any ideas as to what I'm doing
  1111. wrong?
  1112.  
  1113. Cheers,
  1114.  
  1115. Kevin
  1116.  
  1117. *** See also #1881.
  1118.  
  1119.  
  1120. From:    Tim Anderson                           Rec'd
  1121. To:      Kevin Kitsemetry                       Msg #1878, Nov-12-93 11:14AM
  1122. Subject: inline
  1123.  
  1124. KK> Internal Report #10180
  1125.  
  1126.  
  1127. I have this rather simple inline using "another compiler from a company in
  1128. Redmond", and I don't know how to inline it with Watcom. Why is this so
  1129. difficult?
  1130.  
  1131. /* In reality this is page_offset = div(idx, temp_page_size); */ /* stretched
  1132. out to return two integers instead of a structure */
  1133.  
  1134. __asm {
  1135.         xor edx,edx
  1136.         mov eax,idx
  1137.         div temp_page_size
  1138.         mov iPage,eax
  1139.         mov iOffset,edx
  1140. }
  1141.  
  1142. Is there an easy way to access variables outside of the inline? The main
  1143. problem is that this 'returns' two integer values, and I can't see an easy way
  1144. to set this up using all that #pragma fake function in an inline nonsense.
  1145.  
  1146. Since this is really the 'div' function as documented in the <stdlib.h> file,
  1147. is it inlined allready?
  1148.  
  1149. tim anderson
  1150.  
  1151. PS: I was able to chop a big chunk of time off of "that other companies"
  1152. routines for this by inlining them. On the order of 34% or so! Amazing...
  1153.  
  1154.  
  1155. *** See also #1883.
  1156.  
  1157.  
  1158. From:    Lam Lee
  1159. To:      Watcom                                 Msg #1879, Nov-12-93 09:07AM
  1160. Subject: WIndows 32b DLL with 9.5A bug
  1161.  
  1162. Hi,
  1163. We just recompiled a large 32 bit DLL using C/C++ 9.5A.  This program was
  1164. working ok under 9.1E but now we will get a GPF on the very first call into
  1165. the DLL.  The app that calls this 32b DLL is a 16 bit app that use MS C
  1166. compiler 6.0AX.   From reading the msg on this forum and some one told me on
  1167. CIS that Watcom has a bug in the DLL supervisor, which there is a pre-release
  1168. fix on the BBS.  I can not seems to locate this program in this area?  Is that
  1169. the WINEXT.ZIP?  Can someone point me to where this file might be.  Thanks.
  1170.  
  1171. *** See also #1882.
  1172.  
  1173.  
  1174. From:    Kevin Kitsemetry                       Rec'd
  1175. To:      Kevin Blenkinsopp                      Msg #1881, Nov-12-93 09:47AM
  1176. Subject: Profiling
  1177.  
  1178.  KB> * Original Area: wc
  1179.  KB> * Original To  : Kevin Kitsemetry (1:221/186)
  1180.  
  1181.  KB> Kevin,
  1182.  
  1183.  KB> I've been trying to profile some code, and wprof is telling me that my
  1184.  KB> code is spending 100% of its time in OS/external
  1185.  KB> stuff. This seemed pretty unlikely to me, so I hacked
  1186.  KB> up a little noddy progam and tried again. This time,
  1187.  KB> wprof tells me that there aren't any samples in the
  1188.  KB> file. I've uploaded the noddy code to the file area.
  1189.  KB> It was compiled with wcl386 -d2, using c++ 9.5a and
  1190.  KB> dos4g. Incidentally, if I run samprsi with "dos4gw
  1191.  KB> wsamprsi t" like it says in the manual, I get a dos4gw
  1192.  KB> error saying it can't find the loader for wsamprsi.
  1193.  KB> Just running "wsamprsi t" seems to be fine. Any ideas
  1194.  KB> as to what I'm doing wrong?
  1195.  
  1196. I am not sure why it would be spending most of the time in
  1197. the OS/external.  I am unable to confirm with the develpement team on this as
  1198. the key people I need to talk to are not
  1199. available this week.
  1200.  
  1201. On the other hand, it does not surprise me that your small
  1202. program does have any samples in the file - you can only
  1203. profile larger programs that execute for a certain amount
  1204. of time.  You also probably do not want to use /d2 as that
  1205. option disables optimizations.
  1206.  
  1207.  
  1208. Kevin Kitsemetry
  1209. WATCOM TECHNICAL SUPPORT
  1210.  
  1211. *** This is a reply to #1877.
  1212.  
  1213.  
  1214. From:    Kevin Kitsemetry                       Rec'd
  1215. To:      Tim Anderson                           Msg #1883, Nov-12-93 11:01AM
  1216. Subject: inline
  1217.  
  1218. KK> Internal Report #10180
  1219.  
  1220.  
  1221.  TA> /* In reality this is page_offset = div(idx,
  1222.  TA> temp_page_size); */ /* stretched out to return two
  1223.  TA> integers instead of a structure */
  1224.  
  1225.  TA> __asm {
  1226.  TA>         xor edx,edx
  1227.  TA>         mov eax,idx
  1228.  TA>         div temp_page_size
  1229.  TA>         mov iPage,eax
  1230.  TA>         mov iOffset,edx
  1231.  TA> }
  1232.  
  1233.  TA> Is there an easy way to access variables outside of
  1234.  TA> the inline? The main problem is that this 'returns'
  1235.  TA> two integer values, and I can't see an easy way to set
  1236.  TA> this up using all that #pragma fake function in an
  1237.  TA> inline nonsense.
  1238.  
  1239.  
  1240. There are several ways of coding a div pragma.
  1241. 1)
  1242.     #pragma aux mydiv = "xor edx,edx" \
  1243.                         "div ecx"     \
  1244.                         "mov iPage,eax"\
  1245.                         "mov iOffset,edx" \
  1246.                         parm [eax] [ecx];
  1247. OR, you could pass in the address of iPage and return iOffset in a register
  1248.     extern int mydiv( int num, int divisor, int *answer );
  1249.     #pragma aux mydiv = "xor edx,edx" \
  1250.                         "div ecx"     \
  1251.                         "mov [ebx],eax"\
  1252.                         parm [eax] [ecx] [ebx] value [edx];
  1253.     page_offset = mydiv( idx, temp_page_size, &iPage );
  1254.  
  1255. If temp_page_size is a power of 2, which it most likely is, you can do much
  1256. much better by using shifting and anding since these are only 1 clock
  1257. instructions, vs the divide instruction which can take up to 40 some clocks.
  1258. If this is the case, then you can just code it as straight C code.
  1259.         iPage = idx >> n;
  1260.         iOffset = idx & mask;
  1261. where n and mask are the appropriate constants for accomplishing the same
  1262. thing as dividing by temp_page_size;
  1263.  
  1264.  TA> Since this is really the 'div' function as documented
  1265.  TA> in the <stdlib.h> file, is it inlined allready?
  1266.  
  1267. Yes, they can be inlined with the /oi compiler option.
  1268.  
  1269.  
  1270. Kevin Kitsemetry
  1271. WATCOM TECHNICAL SUPPORT
  1272.  
  1273. *** This is a reply to #1878.  *** See also #1884.
  1274.  
  1275.  
  1276. From:    Tim Anderson                           Rec'd
  1277. To:      Kevin Kitsemetry                       Msg #1884, Nov-12-93 12:04PM
  1278. Subject: inline
  1279.  
  1280. Thanks for the hints! After I got away from the computer for awhile,
  1281. I realized that there was a reasonable way to do this using the Watcom
  1282. style #pragma aux stuff. I geuss that's what I get for working too long
  1283. at one thing and then trying to change gears...
  1284.  
  1285. Nothing like some sleep and a shower to clear your head out...
  1286.  
  1287. tim
  1288.  
  1289. *** This is a reply to #1883.
  1290.  
  1291.  
  1292. From:    Phil Duvalsaint
  1293. To:      All                                    Msg #1885, Nov-12-93 01:34PM
  1294. Subject: Autocad ads_command troubles
  1295.  
  1296. I have been trying to do some block insertions in ADS and have run into
  1297.       a problem.  I get the error:
  1298. Application K:\EVENTCAD\ADS\ECINERT.EXP ERROR :incorrect request for command
  1299. list data
  1300.  
  1301. Here are three different code fragments which I have tried. They all generate
  1302. the same error.  The block 10TOP72 can be manually inserted, and AutoLisp has
  1303. no problems with it.  I've checked the order of arguments and they appear to
  1304. be correct.  Does anybody have any idea what could be the problem?
  1305.  
  1306.  
  1307. struct resbuf *tmp;
  1308. ads_point POINT;
  1309. float ROT,HEIGHT;
  1310. char *BLOCK;
  1311.  
  1312.   BLOCK=strdup("10TOP72");
  1313.   ROT=0;
  1314.   HEIGHT=32.0
  1315.   POINT[X]=2846.0;
  1316.   POINT[Y]=1842.0;
  1317.   POINT[Z]=0.0;
  1318.  
  1319. 1)
  1320.   tmp=ads_buildlist(RTSTR,"_.INSERT",
  1321.                     RTSTR,BLOCK,
  1322.                     RTPOINT,POINT,
  1323.                     RTSTR,"",RTSTR,"",
  1324.                     RTREAL,ROT,
  1325.                     RTSTR,"",0);
  1326.       ads_retlist(tmp);
  1327.       ads_cmd(tmp);
  1328.       ads_relrb(tmp);
  1329.  
  1330. 2)
  1331.      POINT[Z]=HEIGHT;
  1332.      ads_command(RTSTR,"_.INSERT",
  1333.                  RTSTR,BLOCK,
  1334.                  RT3DPOINT,POINT,
  1335.                  RTSTR,"",RTSTR,"",
  1336.                  RTREAL,ROT,
  1337.                  RTSTR,"",RTSTR,"",RTSTR,"",
  1338.                  RTSTR,"",RTSTR,"",RTSTR,"",0);
  1339.  
  1340. 3)
  1341.     ads_command(RTSTR,"_.INSERT",
  1342.                 RTSTR,"10TOP72",
  1343.                 RTPOINT,POINT,
  1344.                 RTSTR,"",RTSTR,"",RTSTR,"",RTSTR,"",0);
  1345.  
  1346. *** See also #1890.
  1347.  
  1348.  
  1349. From:    Donald Tevault                         Rec'd
  1350. To:      Dan Cummins                            Msg #1886, Nov-15-93 09:17PM
  1351. Subject: WMAKE
  1352.  
  1353. DC> Internal Report #10428
  1354.  
  1355. # Hi Kevin!
  1356. #       I made the makefile for the Calendar.cpp file as you said, and it #
  1357. does invoke the C++ compiler without any problem.  I then tried playing around
  1358. # some more with this zipcode.mak file, but no matter what I tried, I still
  1359. got # the same results.  That is, it just dumps me out to DOS without invoking
  1360. the # C++ compiler.  It's not that it can't find the compiler,because even
  1361. when I # move the compiler to the same directory as this makefile, it still
  1362. does the # same thing.  If you can figure out a way to make it work, I will be
  1363. very # grateful.
  1364. #        Many thanks in advance.
  1365. #                Donald Tevault
  1366. #
  1367. #
  1368. #
  1369. #       MakeFile Frame For Watcom C++ or better
  1370. # ~1 = APPNAME, ~2 = APPNAMEdlg, ~3 =  APPNAMEm,
  1371. # ~4 = APPNAMEdb, ~5 = APPNAMEini
  1372. # ~6 = Include Directory, ~7 = Library Directory
  1373. # ~8 = Source Directory
  1374. .EXTENSIONS: .CPP
  1375. SD = C:\DB4W\SOURCE\\
  1376.  
  1377. FILES = charf.obj pictures.obj ZIPCODDD.obj ZIPCODMM.obj\
  1378. dllutil.obj stdfile.obj database.obj toolbar.obj specscrl.obj\ stdquery.obj
  1379. linkman.obj memof.obj combo.obj dialogs.obj\
  1380. table.obj query.obj stdidx.obj lexer.obj parser.obj symbol.obj\ decor.obj
  1381. static.obj keyfilt.obj checkbox.obj btree.obj file.obj
  1382.  
  1383.  
  1384.  
  1385. INCLUDEDIR = C:\DB4W\SOURCE
  1386. LIBDIR   = C:\WATCOM\LIB386;C:\WATCOM\LIB386\WIN\\
  1387.  
  1388. COM = WIN386 1
  1389. CC = wpp386
  1390.  
  1391. # Most Compiler-Specific Items are in the following 7 lines # Almost any
  1392. Windows C++ compiler that uses a MAKEFILE can be # supported here # COMPILER =
  1393. LINKER   = wlink
  1394. RC        = wrc
  1395. RFLAGS   = /r /i=$(SOURCEDIR)
  1396. #CFLAGS  = /c /GW
  1397. CPPFLAGS = -zW -oaxt -d1 -d -w4 -fpc -i=$(INCLUDEDIR)
  1398. LFLAGS   = /Lw
  1399. LFILES   = ZIPCODE.def
  1400.  
  1401. .cpp.obj:
  1402.        $(CC) $[*.cpp $(CPPFLAGS)
  1403.  
  1404. #.c.obj:
  1405. #       $(COMPILER) $(CFLAGS) $^.
  1406.  
  1407. ZIPCODE.res: ZIPCODE.rc
  1408.         $(RC) $(RFLAGS) ZIPCODE.rc
  1409.  
  1410. ZIPCODE.EXE: ZIPCODE.obj $(FILES) ZIPCODE.rc  ZIPCODE.def
  1411.         $(LINKER) $(LFLAGS) $(FILES) $(LFILES)
  1412.         wbind ZIPCODE -R -31 ZIPCODE.res
  1413. #       rc -t -K ~1
  1414.  
  1415. #       Dependencies
  1416. CHARF =         $(SD)charf.hpp
  1417. DATABASE =      $(SD)database.hpp
  1418. PICTURES =      $(SD)pictures.hpp
  1419. GLOBAL =        $(SD)global.hpp
  1420. DLLUTIL =       $(SD)dllutil.hpp
  1421. FRAME =         $(SD)frame.hpp
  1422. STATBAR =       $(SD)statbar.hpp
  1423. MEMOF =         $(SD)memof.hpp
  1424. COMBO =         $(SD)combo.hpp
  1425. TOOLBAR =       $(SD)toolbar.hpp
  1426. SPECSCRL =      $(SD)specscrl.hpp
  1427. GENERIC =       $(SD)generic.hpp
  1428. STDQUERY =      $(SD)stdquery.hpp
  1429. DIALOGS =       $(SD)dialogs.hpp
  1430. LINKMAN =       $(SD)linkman.hpp
  1431. QUERY =         $(SD)query.hpp
  1432. TABLE =         $(SD)table.hpp
  1433. STDIDX =        $(SD)stdidx.hpp
  1434. STDFILE =       $(SD)stdfile.hpp
  1435. LEXER =  $(SD)lexer.hpp
  1436. PARSER =         $(SD)parser.hpp
  1437. SYMBOL =         $(SD)symbol.hpp
  1438. DECOR =  $(SD)decor.hpp
  1439. STATIC =         $(SD)static.hpp
  1440. KEYFILT =       $(SD)keyfilt.hpp
  1441. CHECKBOX =      $(SD)checkbox.hpp
  1442. BTREE    =      $(SD)btree.hpp
  1443. FILE     =      $(SD)file.hpp
  1444.  
  1445. stdidx.obj      : $(SD)stdidx.cpp $(STDIDX)
  1446. charf.obj       : $(SD)charf.cpp  $(CHARF) $(DLLUTIL) $(DATABASE) pictures.obj
  1447. : $(SD)pictures.cpp $(PICTURES)
  1448. ZIPCODE.obj      : ZIPCODE.cpp $(STDFILE) $(GLOBAL) $(FRAME) $(DATABASE)
  1449. $(STATBAR)\
  1450.                  $(TOOLBAR) $(SPECSCRL) $(CHARF) $(NUMF) $(COMBO) $(MEMOF)
  1451. $(DLLUTIL) ZIPCODE.cpp ZIPCODE.res      : ZIPCODE.rc ZIPCODE.h ZIPCODE.stb
  1452. ZIPCODDD.obj     : ZIPCODDD.cpp $(GENERIC) $(CHARF) $(DATABASE) ZIPCODE.cpp
  1453. ZIPCODMM.obj     : ZIPCODMM.cpp $(FRAME) $(STDFILE) $(GLOBAL) $(DATABASE)
  1454. $(STATBAR)\
  1455.                  $(TOOLBAR) ZIPCODDD.hpp ZIPCODE.h $(GENERIC) $(DIALOGS)
  1456. dllutil.obj     : $(SD)dllutil.cpp $(DLLUTIL)
  1457. stdfile.obj     : $(SD)stdfile.cpp $(DLLUTIL) $(STDQUERY) $(STDFILE) $(MKTREE)\
  1458.         $(PICTURES)
  1459. database.obj : $(SD)database.cpp $(DATABASE) $(GLOBAL) $(GENERIC) $(FRAME)\
  1460.         $(STATBAR) $(CHARF) $(DLLUTIL) $(SPECSCRL) $(DIALOGS) toolbar.obj :
  1461. $(SD)toolbar.cpp $(TOOLBAR) $(DATABASE)
  1462. statbar.obj     : $(SD)statbar.cpp $(STATBAR)
  1463. specscrl.obj : $(SD)specscrl.cpp $(SPECSCRL)
  1464. stdquery.obj : $(SD)stdquery.cpp $(STDQUERY) $(DLLUTIL)
  1465. linkman.obj     : $(SD)linkman.cpp $(LINKMAN) $(GLOBAL) $(PICTURES) memof.obj
  1466.       : $(SD)memof.cpp $(MEMOF) $(DLLUTIL) $(DATABASE) combo.obj       :
  1467. $(SD)combo.cpp $(COMBO) $(DLLUTIL) $(DATABASE) dialogs.obj     :
  1468. $(SD)dialogs.cpp $(DIALOGS) $(STDFILE) $(GLOBAL) $(GENERIC) table.obj       :
  1469. $(SD)table.cpp $(TABLE)
  1470. query.obj       : $(SD)query.cpp $(QUERY)
  1471. lexer.obj       : $(SD)lexer.cpp $(LEXER)
  1472. parser.obj      : $(SD)parser.cpp $(PARSER)
  1473. symbol.obj      : $(SD)symbol.cpp $(SYMBOL)
  1474. decor.obj       : $(SD)decor.cpp $(DECOR)
  1475. static.obj      : $(SD)static.cpp $(STATIC)
  1476. keyfilt.obj      : $(SD)keyfilt.cpp $(KEYFILT)
  1477. checkbox.obj : $(SD)checkbox.cpp $(CHECKBOX)
  1478. btree.obj       : $(SD)btree.cpp $(BTREE)
  1479. file.obj         : $(SD)file.cpp $(FILE)
  1480.  
  1481. *** See also #1970.
  1482.  
  1483.  
  1484. From:    Hal Lonas                              Rec'd
  1485. To:      Kevin Kitsemetry                       Msg #1887, Nov-15-93 09:36PM
  1486. Subject: FSETENV patch
  1487.  
  1488. DC> Internal report #10429
  1489.  
  1490. Kevin,
  1491. I was told on the Compuserve forum that there are preliminary B-level patches
  1492. available for c++ 32 for the FSETENV bug in the Windows DLL supervisor...
  1493. Could I get the patch?
  1494. Hal
  1495.  
  1496. *** See also #1891.
  1497.  
  1498.  
  1499. From:    Rainer Schupp
  1500. To:      Watcom Technical Support               Msg #1888, Nov-15-93 09:39PM
  1501. Subject: comparison bug ?
  1502.  
  1503. DC> Internal Report #10430
  1504.  
  1505. The result of the following test-program will
  1506. be RIGHT if compiled with the 9.0 E-level
  1507. compiler, but will be WRONG if compiled with
  1508. the 9.5 A-level C++ compiler.
  1509.  
  1510.  
  1511. #include <stdio.h>
  1512.  
  1513. unsigned char GetValue( void );
  1514.  
  1515.  
  1516. main()
  1517. {
  1518.  unsigned char stat = GetValue();
  1519.  if ((signed char)stat < 0)
  1520.    {
  1521.    if (stat < (unsigned char)0xC0)
  1522.      printf( "wrong" );
  1523.    else
  1524.      printf( "right" );
  1525.    }
  1526. }
  1527.  
  1528.  
  1529. unsigned char GetValue() {return (0xF0);}
  1530.  
  1531.  
  1532. From:    Dan Cummins
  1533. To:      Nigel Evans                            Msg #1889, Nov-15-93 08:28PM
  1534. Subject: DPMI and Interrupts using WATCOM C/386 v9.01
  1535.  
  1536.  NE> I need to write an ISR to handle DOS int 24 (critical
  1537.  NE> error handler), using the DOS4GW option within WATCOM
  1538.  NE> C/386 v9.01.
  1539.  
  1540. I placed some examples of critical error handling under DOS4GW on the BBS for
  1541. you, as I mentioned in my fax.  Hope these helped.
  1542.  
  1543. (This was Internal report #7387)
  1544.  
  1545. Dan
  1546.  
  1547. *** This is a reply to #1681.
  1548.  
  1549.  
  1550. From:    Dan Cummins                            Rec'd
  1551. To:      Phil Duvalsaint                        Msg #1890, Nov-15-93 09:04PM
  1552. Subject: Autocad ads_command troubles
  1553.  
  1554.  PD> I have been trying to do some block insertions in ADS
  1555.  PD> and have run into              a problem.  I get the
  1556.  PD> error:
  1557.  PD> Application K:\EVENTCAD\ADS\ECINERT.EXP ERROR
  1558.  PD> :incorrect request for command list data
  1559.  
  1560.  PD> Here are three different code fragments which I have
  1561.  PD> tried. They all generate the same error.  The block
  1562.  PD> 10TOP72 can be manually inserted, and AutoLisp has no
  1563.  PD> problems with it.  I've checked the order of arguments
  1564.  PD> and they appear to be correct.  Does anybody have any
  1565.  PD> idea what could be the problem?
  1566.  
  1567.  
  1568.  PD> struct resbuf *tmp;
  1569.  PD> ads_point POINT;
  1570.  PD> float ROT,HEIGHT;
  1571.  PD> char *BLOCK;
  1572.  PD>
  1573.  PD>   BLOCK=strdup("10TOP72");
  1574.  PD>   ROT=0;
  1575.  PD>   HEIGHT=32.0
  1576.  PD>   POINT[X]=2846.0;
  1577.  PD>   POINT[Y]=1842.0;
  1578.  PD>   POINT[Z]=0.0;
  1579.  
  1580.  PD> 1)
  1581.  PD>   tmp=ads_buildlist(RTSTR,"_.INSERT",
  1582.  PD>                     RTSTR,BLOCK,
  1583.  PD>                     RTPOINT,POINT,
  1584.  PD>                     RTSTR,"",RTSTR,"",
  1585.  PD>                     RTREAL,ROT,
  1586.  PD>                     RTSTR,"",0);
  1587.  PD>       ads_retlist(tmp);
  1588.  PD>       ads_cmd(tmp);
  1589.  PD>       ads_relrb(tmp);
  1590.  PD>
  1591.  PD> 2)
  1592.  PD>      POINT[Z]=HEIGHT;
  1593.  PD>      ads_command(RTSTR,"_.INSERT",
  1594.  PD>                  RTSTR,BLOCK,
  1595.  PD>                  RT3DPOINT,POINT,
  1596.  PD>                  RTSTR,"",RTSTR,"",
  1597.  PD>                  RTREAL,ROT,
  1598.  PD>                  RTSTR,"",RTSTR,"",RTSTR,"",
  1599.  PD>                  RTSTR,"",RTSTR,"",RTSTR,"",0);
  1600.  
  1601.  PD> 3)
  1602.  PD>     ads_command(RTSTR,"_.INSERT",
  1603.  PD>                 RTSTR,"10TOP72",
  1604.  PD>                 RTPOINT,POINT,
  1605.  PD>                 RTSTR,"",RTSTR,"",RTSTR,"",RTSTR,"",0);
  1606.  
  1607. I'm guessing that you're looking for help from some other ADS developers.  I'm
  1608. in Technical Support here at WATCOM, and I'm afraid that the error message you
  1609. mentioned doesn't sound
  1610. like a WATCOM message.  Also, the above functions (ads_*) are unfamiliar. Have
  1611. you tried calling AutoCAD support?  If you find that it traces down to a
  1612. WATCOM problem, I'd be more than happy to
  1613. investigate.
  1614.  
  1615. Dan Cummins
  1616. WATCOM Languages Support
  1617.  
  1618. *** This is a reply to #1885.
  1619.  
  1620.  
  1621. From:    Jason Blochowiak                       Rec'd
  1622. To:      Kevin Kitsemetry                       Msg #1894, Nov-16-93 06:47AM
  1623. Subject: Locking for VM
  1624.  
  1625.  Ok, that makes sense - thanks. How does one go about locking down the entire
  1626. code segment (or chunk of code, or whatever you want to call it) and the
  1627. static data segment? Or, more specifically, how does one find the addresses of
  1628. the start & end of the code & data segments?
  1629.  
  1630.  Jason
  1631.  
  1632. *** This is a reply to #1825.  *** See also #1899.
  1633.  
  1634.  
  1635. From:    Anthony Scian                          Rec'd
  1636. To:      Rainer Schupp                          Msg #1897, Nov-16-93 04:38PM
  1637. Subject: comparison bug ?
  1638.  
  1639. DC> Internal Report #10430
  1640.  
  1641.  RS> The result of the following test-program will
  1642.  RS> be RIGHT if compiled with the 9.0 E-level
  1643.  RS> compiler, but will be WRONG if compiled with
  1644.  RS> the 9.5 A-level C++ compiler.
  1645.  
  1646. I've duplicated the problem but I'm not sure when a fix
  1647. will be available.
  1648.  
  1649. Anthony
  1650.  
  1651.  
  1652.  RS> #include <stdio.h>
  1653.  
  1654.  RS> unsigned char GetValue( void );
  1655.  
  1656.  
  1657.  RS> main()
  1658.  RS> {
  1659.  RS>  unsigned char stat = GetValue();
  1660.  RS>  if ((signed char)stat < 0)
  1661.  RS>    {
  1662.  RS>    if (stat < (unsigned char)0xC0)
  1663.  RS>      printf( "wrong" );
  1664.  RS>    else
  1665.  RS>      printf( "right" );
  1666.  RS>    }
  1667.  RS> }
  1668.  
  1669.  
  1670.  RS> unsigned char GetValue() {return (0xF0);}
  1671.  
  1672. *** This is a reply to #1888.  *** See also #1900.
  1673.  
  1674.  
  1675. From:    Dan Cummins                            Rec'd
  1676. To:      Jason Blochowiak                       Msg #1899, Nov-16-93 09:48PM
  1677. Subject: Locking for VM
  1678.  
  1679.  JB>  Ok, that makes sense - thanks. How does one go about
  1680.  JB> locking down the entire code segment (or chunk of
  1681.  JB> code, or whatever you want to call it) and the static
  1682.  JB> data segment? Or, more specifically, how does one find
  1683.  JB> the addresses of the start & end of the code & data
  1684.  JB> segments?
  1685.  
  1686.  JB>  Jason
  1687.  
  1688. I'm no expert - but here's a suggestion.  You can find out
  1689. what your CS and DS are using the library function segread(). Then (it
  1690. appears) you can pass the CS value, for example,
  1691. to DPMI function 000Bh, "Get Descriptor".  This will allow
  1692. you to obtain a copy of the descriptor table entry for your CS (you need to
  1693. pass an 8-byte buffer to hold the copy).
  1694.  
  1695. From this entry, you can extract the base address and limit of your selector.
  1696. This should be all the info you need.
  1697. Please refer to your nearest 80386 Programming Guide/Technical Reference for
  1698. the format of the descriptor table entry.  You will need to extract specific
  1699. bits to get the values you need.
  1700.  
  1701. Hope this helps.
  1702.  
  1703. Dan Cummins
  1704. WATCOM Languages Support
  1705.  
  1706. *** This is a reply to #1894.  *** See also #1925.
  1707.  
  1708.  
  1709. From:    Tom Hollins
  1710. To:      Tech support 9.5a C++32                Msg #1903, Nov-18-93 12:00AM
  1711. Subject: DVX XLIB compile problem its a C hdr with C++ processing nested class.
  1712.  
  1713. Hello, I have tried to solve this problem myself but have been unable to do
  1714. so. I just bought my compiler last week, the techinfo states it is at
  1715. patchlevel a. My makefile, and output follow, additional source can be
  1716. uploaded as you need. Essentially the C++ compiler will not process the Xlib.h
  1717. (which is a C header with correct protos) even though I have surrounded the
  1718. include files with the extern "C" { } directive. The compiler balks with an
  1719. error 263 nested class %N has not been defined and you guys write it off with
  1720. a "some working C code will not work unchanged" message in your manual. Well,
  1721. that won't float. We need some sort of work around or fix because I cannot go
  1722. into the X source and modify everything to the liking of this compiler. We
  1723. have tested this exact code with the GNU 2.2.2 compiler that came with DVX and
  1724. it worked fine, ran fine. Now its time to port to a commercial compiler
  1725. (license restrictions on GNU). Why is there a difference in the two
  1726. implementations of the compilers? Please give me a work around or a patch or
  1727. something to go by so I can continue my development otherwise we will have to
  1728. use the Microbrains uh microsoft compiler. Thank you for your time.
  1729.  
  1730. #
  1731. # Makefile for artemis.cc
  1732. #
  1733. # ATTENTION!!!   Do NOT use deadcode elimination because it will crash the
  1734. #                  program when it is run under dvx. yep.
  1735. #
  1736.  
  1737. extension        = .exe
  1738. filename         = artemis
  1739. additional_files = @linkfile.lst
  1740.  
  1741. obj_file1  = \x\global\sharemem
  1742. obj_file2  = artobj
  1743. obj_file3  = butwind
  1744. obj_file4  = artutil
  1745. obj_file5  = xpm
  1746. obj_file6  = mainwind
  1747. obj_file7  = statwind
  1748. obj_file8  = wind1
  1749. obj_file9  = wind2
  1750. obj_file10 = inputman
  1751.  
  1752. objs = $(obj_file1).obj $(obj_file2).obj $(obj_file3).obj $(obj_file4).obj &
  1753.  $(obj_file5).obj $(obj_file6).obj $(obj_file7).obj $(obj_file8).obj &
  1754.  $(obj_file9).obj $(obj_file10).obj $(filename).obj
  1755.  
  1756. exe_file      = $(filename)$(extension)
  1757. wcl_options   = /bt=dos /mf /l=dos4g /c
  1758. cpp_options   =
  1759. wlink_options = @\x\watlink.fle name $^@ file $^*
  1760.  
  1761. $(exe_file) : $(objs)
  1762.    wlink $(wlink_options) $(additional_files)
  1763.    !copy $(exe_file) \artemis\prog
  1764.  
  1765. $(obj_file1).obj: $(obj_file1).c
  1766.    wcl386 $(obj_file1) $(wcl_options) /fo=$^:
  1767.  
  1768. $(obj_file2).obj: $(obj_file2).cc
  1769.    wcl386 $(obj_file2) $(wcl_options) /fo=$^: $(cpp_options)
  1770.  
  1771. $(obj_file3).obj: $(obj_file3).cc
  1772.    wcl386 $(obj_file3) $(wcl_options) /fo=$^: $(cpp_options)
  1773.  
  1774. $(obj_file4).obj: $(obj_file4).cc
  1775.    wcl386 $(obj_file4) $(wcl_options) /fo=$^: $(cpp_options)
  1776.  
  1777. $(obj_file5).obj: $(obj_file5).c
  1778.    wcl386 $(obj_file5) $(wcl_options) /fo=$^:
  1779.  
  1780. $(obj_file6).obj: $(obj_file6).cc
  1781.    wcl386 $(obj_file6) $(wcl_options) /fo=$^: $(cpp_options)
  1782.  
  1783. $(obj_file7).obj: $(obj_file7).cc
  1784.    wcl386 $(obj_file7) $(wcl_options) /fo=$^: $(cpp_options)
  1785.  
  1786. $(obj_file8).obj: $(obj_file8).cc
  1787.    wcl386 $(obj_file8) $(wcl_options) /fo=$^: $(cpp_options)
  1788.  
  1789. $(obj_file9).obj: $(obj_file9).cc
  1790.    wcl386 $(obj_file9) $(wcl_options) /fo=$^: $(cpp_options)
  1791.  
  1792. $(obj_file10).obj: $(obj_file10).cc
  1793.    wcl386 $(obj_file10) $(wcl_options) /fo=$^: $(cpp_options)
  1794.  
  1795. $(filename).obj: $(filename).cc
  1796.    wcl386 $(filename) $(wcl_options) $(cpp_options)
  1797.  
  1798. WATCOM Make Version 3.2
  1799. Copyright by WATCOM International Corp. 1988, 1993. All rights reserved.
  1800. WATCOM is a trademark of WATCOM International Corp.
  1801. wcl386 artobj /bt=dos /mf /l=dos4g /c /fo=
  1802. WATCOM C/C++32 Compile and Link Utility Version 9.5
  1803. Copyright by WATCOM International Corp. 1988, 1993. All rights reserved.
  1804. WATCOM is a trademark of WATCOM International Corp.
  1805.        wpp386 artobj.cc  /bt=dos /mf /fo=
  1806. WATCOM C++32 Optimizing Compiler  Version 9.5a
  1807. Copyright by WATCOM International Corp. 1989, 1993. All rights reserved.
  1808.  
  1809. *** See also #1913.
  1810.  
  1811.  
  1812. From:    Tom Hollins
  1813. To:      Tech Support C++32 9.5a                Msg #1904, Nov-18-93 12:16AM
  1814. Subject: Desqview/X Xlib Header under C++ gives a nested class error
  1815.  
  1816. Okay, hopefully this message doesn't get trashed.
  1817. When compiling a C++ module using make with WCL an error 263 Nested class %N
  1818. has not been defined. Your manual writes this off with a "well some C stuff
  1819. won't run under C++ without modification". Well we have verified the code with
  1820. the GNU C++ compiler 2.2.2 which came with DVX and everything seemed to work
  1821. (except their licensing policy). I need an answer or workaround fast. I cannot
  1822. continue development with your compiler (which is a whole week old) and I will
  1823. be forced to use the Microbrain er Microsoft compiler. Please save us!!!!
  1824. Seriously, this should not occur since I have function protos (or DVX placed
  1825. them in the XLIB.H file) and I have an extern "C" {} around the #include files
  1826. (does this work for include files? you might want to check).
  1827. What I need from you folks: 1) a straight out fix, 2) a work around that
  1828. doesn't adversle impact my schedule (like going into all of the Xlib header
  1829. files and modifying them).
  1830. I will upload my compiler output (hopefully it won't trash this message again).
  1831. WATCOM Make Version 3.2
  1832. Copyright by WATCOM International Corp. 1988, 1993. All rights reserved.
  1833. WATCOM is a trademark of WATCOM International Corp.
  1834.         wcl386 artobj /bt=dos /mf /l=dos4g /c /fo=
  1835. WATCOM C/C++32 Compile and Link Utility Version 9.5
  1836. Copyright by WATCOM International Corp. 1988, 1993. All rights reserved.
  1837. WATCOM is a trademark of WATCOM International Corp.
  1838.        wpp386 artobj.cc  /bt=dos /mf /fo=
  1839. WATCOM C++32 Optimizing Compiler  Version 9.5a
  1840. Copyright by WATCOM International Corp. 1989, 1993. All rights reserved.
  1841. WATCOM is a trademark of WATCOM International Corp.
  1842. c:\watcom\h\X11/Xlib.h(304): Error! E263: (col 1) nested class '_XDisplay' has
  1843. not been defined
  1844. c:\watcom\h\X11/Xlib.h(304): Note! N393: (col 1) included from
  1845. c:\watcom\h\X11/Intrinsi.h(33)
  1846. c:\watcom\h\X11/Xlib.h(304): Note! N393: (col 1) included from artobj.cc(42)
  1847. c:\watcom\h\X11/Xlib.h(613): Error! E263: (col 1) nested class 'XKeytrans' has
  1848. not been defined
  1849. c:\watcom\h\X11/Xlib.h(613): Error! E263: (col 1) nested class
  1850. '_XrmHashBucketRec' has not been defined
  1851. c:\watcom\h\X11/Xlib.h(613): Error! E263: (col 1) nested class '_XSQEvent' has
  1852. not been defined
  1853. c:\watcom\h\sys/time.h(25): Warning! W481: (col 17) class/enum has the same
  1854. name as the function/variable 'timezone'
  1855. c:\watcom\h\sys/time.h(25): Note! N392: (col 17) 'long timezone' defined in:
  1856. c:\watcom\h\time.h(76) (col 17)
  1857. c:\watcom\h\sys/time.h(25): Note! N393: (col 17) included from
  1858. c:\watcom\h\X11/Xos.h(164)
  1859. c:\watcom\h\sys/time.h(25): Note! N393: (col 17) included from
  1860. c:\watcom\h\X11/Intrinsi.h(36)
  1861. c:\watcom\h\sys/time.h(25): Note! N393: (col 17) included from artobj.cc(42)
  1862. artemis.h(49): Error! E117: (col 22) too many storage class specifiers
  1863. artemis.h(49): Note! N393: (col 22) included from artobj.cc(53)
  1864. artemis.h(49): Error! E326: (col 38) defining 'fname_language' is not possible
  1865. because its type has unknown size
  1866. artemis.h(49): Note! N392: (col 38) 'char * fname_language[]' defined in:
  1867. artemis.h(49) (col 22)
  1868. artemis.g(47): Error! E328: (col 32) storage class of 'fname_language'
  1869. conflicts with previous declaration
  1870. artemis.g(47): Note! N392: (col 32) 'char * fname_language[]' defined in:
  1871. artemis.g(47) (col 15)
  1872. artemis.g(47): Note! N393: (col 32) included from artobj.cc(54)
  1873. artemis.g(47): Error! E042: (col 32) symbol 'fname_language' already defined
  1874. artemis.g(47): Note! N392: (col 32) 'char * fname_language[]' defined in:
  1875. artemis.h(49) (col 22)
  1876. artobj.cc: 384 lines, included 14157, 1 warning, 8 errors
  1877. Error: Compiler returned a bad status compiling 'artobj.cc'
  1878. Error(E42): Last command making (artobj.obj) returned a bad status
  1879. Error(E02): Make execution terminated
  1880.  
  1881.  
  1882. From:    Ron Smith
  1883. To:      Tech Support                           Msg #1906, Nov-18-93 04:19PM
  1884. Subject: Dynamic Overlays
  1885.  
  1886. The Dynamic Overlay option DOES NOT WORK!!!!
  1887. We have a VERY SIMPLE program that illustrates the effect.  It is called
  1888. BADOVLS.ZIP and is in the C/C++ 9.5 Problems and Fixes File Area.
  1889. PLEASE HELP.  We are waiting for a call back from your tech support but we
  1890. need an answer SOON!
  1891. THANKS.
  1892.  
  1893. BTW - Hasn't anyone else used this option???
  1894.  
  1895. *** See also #1908.
  1896.  
  1897.  
  1898. From:    Mike Brennen
  1899. To:      Tech Support                           Msg #1907, Nov-18-93 04:57PM
  1900. Subject: wildargs under C++
  1901.  
  1902. while I'm logged in to get 9.5 patch a, i'll throw a question in also.  i
  1903. noticed today that linking wildargv into a c++ link causes the linker to abort
  1904. with undefined symbols; is wildargv not allowed with c++????  thanks
  1905.  
  1906. *** See also #1909.
  1907.  
  1908.  
  1909. From:    Mike Paola
  1910. To:      Ron Smith                              Msg #1908, Nov-18-93 05:12PM
  1911. Subject: Dynamic Overlays
  1912.  
  1913.  RS> The Dynamic Overlay option DOES NOT WORK!!!!
  1914.  RS> We have a VERY SIMPLE program that illustrates the
  1915.  RS> effect.  It is called BADOVLS.ZIP and is in the C/C++
  1916.  RS> 9.5 Problems and Fixes File Area.
  1917.  RS> PLEASE HELP.  We are waiting for a call back from your
  1918.  RS> tech support but we need an answer SOON!
  1919.  RS> THANKS.
  1920.  
  1921. Ron, we're looking into it - thanks for the concise example. Incident Number:
  1922. 10776
  1923.  
  1924. *** This is a reply to #1906.
  1925.  
  1926.  
  1927. From:    Mike Paola                             Rec'd
  1928. To:      Mike Brennen                           Msg #1909, Nov-18-93 05:28PM
  1929. Subject: wildargs under C++
  1930.  
  1931.  MB> while I'm logged in to get 9.5 patch a, i'll throw a
  1932.  MB> question in also.  i noticed today that linking
  1933.  MB> wildargv into a c++ link causes the linker to abort
  1934.  MB> with undefined symbols; is wildargv not allowed with
  1935.  MB> c++????  thanks
  1936.  
  1937. In the B-level patches, we've modified WILDARGV so that it can be compiled
  1938. with C++ as well.  The current one can't.
  1939.  
  1940. *** This is a reply to #1907.
  1941.  
  1942.  
  1943. From:    Mike Paola
  1944. To:      Ron Smith                              Msg #1910, Nov-18-93 05:29PM
  1945. Subject: Dynamic Overlays
  1946.  
  1947.  RS> The Dynamic Overlay option DOES NOT WORK!!!!
  1948.  RS> We have a VERY SIMPLE program that illustrates the
  1949.  RS> effect.  It is called BADOVLS.ZIP and is in the C/C++
  1950.  RS> 9.5 Problems and Fixes File Area.
  1951.  RS> PLEASE HELP.  We are waiting for a call back from your
  1952.  RS> tech support but we need an answer SOON!
  1953.  RS> THANKS.
  1954.  
  1955. The problem turned out to be your use of the -zc option.  You can't use this
  1956. with overlays since the code segment can move around on you.  Turning this
  1957. option off fixed the problem.
  1958.  
  1959. *** This is a reply to #1906.
  1960.  
  1961.  
  1962. From:    Mans Agevik
  1963. To:      All                                    Msg #1911, Nov-18-93 05:39PM
  1964. Subject: Free memory
  1965.  
  1966. Hi!
  1967.  
  1968. I have a question regarding how to determine the amount of free memory left.
  1969. When I use _memavl() (which according to the manual should work with DOS/32)
  1970. it reports 4004 bytes left when there actually is more than 30MB left...
  1971. I also tried the DPMI function 500, but when I free some allocated memory
  1972. the amount of free memory returned is not increased. Am I missing something
  1973. here or am I just plain stupid? Thanks in advance.
  1974.  
  1975. //MCA
  1976.  
  1977. *** See also #1913.
  1978.  
  1979.  
  1980. From:    Lam Lee                                Rec'd
  1981. To:      Dan Cummins                            Msg #1912, Nov-18-93 09:43PM
  1982. Subject: Watcom C9.5A DLL Bug
  1983.  
  1984. DC> Internal Report #10689
  1985.  
  1986. Hi,
  1987.  
  1988. I'm still having big problem rebuild our 32 bit DLL under the new C compiler
  1989. 9.5a.  I have called in tech support but so far has not received an answer,so
  1990. I thought I will provide some additional info:
  1991.  
  1992. * We have a 16 bit windows program (using MSC 60AX) called a Watcom 32bit DLL
  1993. program, which is about 1.3 MB.  Everything was working OK under C 9.01e
  1994. release.
  1995.  
  1996. * We just added support for this product to talk to Watcom SQL, using the just
  1997. released version which forced us to upgrade to 9.5 (since the latest Watcom
  1998. SQL does not work with 9.01).
  1999.  
  2000. * We got 9.5, but could not use it because of the StrechDiBit bug, since we do
  2001. a lots of graphic operation.
  2002.  
  2003. * We waited and upgrade to patch A as soon as it was available.  Changed the
  2004. makefile to take care of the new windows include directory, the new 'wrc'
  2005. command, recompile the whole 32 bit DLL appication.  Not a single line of code
  2006. has changed.  We have GPF as soon as a call from the 16 bit code is made to
  2007. the 32bit DLL.
  2008.  
  2009. * We downloaded the latest supervisors (dated 10/5) and relink our dll. Same
  2010. GPF at same place.  We also tried in bump up the stack/heap space but same
  2011. result.
  2012.  
  2013. So please help because we got a big release coming up.  I have zip up several
  2014. log file from Dr.Watcom and Heapwalker to provide some more data.  Here are
  2015. some additional info:
  2016.  
  2017. The 16 bit code is compiled using medium memory model.  It's about 300K. I
  2018. compiled Watcom's DLL test program MSC16 & DLL32, and it works.  I use the
  2019. same MSC16.EXE program to call our large 32b DLL and it WORKED.
  2020.  
  2021. We recompile using 9.5 without patch A and it seems to work (there is some
  2022. other GPF but at least I was talking to the DLL).
  2023.  
  2024. So, can someone tell me a little more about what changes between 9.5 and 9.5A
  2025. that could cause this problem.  I would zip our code and send it up if I have
  2026. to (but it is too large).  Any help would be greatly appreciated.
  2027.  
  2028. Lam Le
  2029. Enc. watbug.zip
  2030.  
  2031.  
  2032. From:    Dan Cummins                            Rec'd
  2033. To:      Mans Agevik                            Msg #1913, Nov-18-93 09:26PM
  2034. Subject: Free memory
  2035.  
  2036.  MA> Hi!
  2037.  
  2038.  MA> I have a question regarding how to determine the
  2039.  MA> amount of free memory left.
  2040.  MA> When I use _memavl() (which according to the manual
  2041.  MA> should work with DOS/32)
  2042.  MA> it reports 4004 bytes left when there actually is more than 30MB left...
  2043.  MA> I also tried the DPMI function 500, but when I free some allocated memory
  2044.  MA> the amount of free memory returned is not increased.
  2045.  MA> Am I missing something here or am I just plain stupid?
  2046.  MA> Thanks in advance.
  2047.  
  2048.  MA> //MCA
  2049.  
  2050. The _memavl() "works" but does not always return meaningful results,even in
  2051. the 16-bit world, and is documented as such.  The example for _memavl() calls
  2052. _nheapgrow() - and you will notice that the _heapgrow functions are not
  2053. supported in the 32-bit library.  The information you are looking for will
  2054. probably not be provided by these library functions.
  2055.  
  2056. If you use DPMI 500h you will be getting information about free memory in the
  2057. system.  If your application has malloced memory before this call, and you
  2058. free the memory, you will not see the memory returned to the system heap
  2059. space.  This is because it remains in the application heap space, in case your
  2060. app does another malloc later.  Once you do a malloc(), memory is
  2061. moved from the system heap to the application heap.  The CLIB memory
  2062. management routines take over the management of your application's memory.
  2063.  
  2064. If you want mallocs and frees to go directly to and from
  2065. system memory then you can use DPMI 501h, 502h and 503h.
  2066.  
  2067. Dan Cummins
  2068. WATCOM Languages Support
  2069.  
  2070. *** This is a reply to #1911.  *** See also #1918.
  2071.  
  2072.  
  2073. From:    Brian Burton                           Rec'd
  2074. To:      Kevin Kitsemetry                       Msg #1914, Nov-18-93 09:40PM
  2075. Subject: Windows NT exception handling
  2076.  
  2077. Could you please share the current status with the rest of us?
  2078. Is there any preliminary estimate of when NT style exceptions
  2079. will be supported?
  2080.  
  2081. Thanks
  2082. KK> Contacted customer directly.
  2083.  
  2084.  
  2085.  NK> Some time ago I left a message saying that we wanted
  2086.  NK> to use Watcom on our NT project, but that we needed to
  2087.  NK> be able to catch the NT exceptions (thrown by
  2088.  NK> RaiseException()). I received a reply that said
  2089.  NK> that,although Watcom didn't currently work with the NT
  2090.  NK> exception handling scheme,Watcom was "looking into it".
  2091.  
  2092.  NK> I did some more investigation, thinking I
  2093.  NK> could get something working. I
  2094.  NK> was wrong: there is an undocumented interface to the
  2095.  NK> Windows NT exception handling that Microsoft only
  2096.  NK> shows to compiler vendors.
  2097.  
  2098.  NK> So I'm back to asking for help from Watcom. I'd like
  2099.  NK> to talk to whoever is "looking at" NT exception
  2100.  NK> handling, so I can tell them about our immediate needs
  2101.  NK> in this area.
  2102.  
  2103.  NK> What we need right now is a way to catch NT software
  2104.  NK> exceptions raised by system calls (especially the RPC
  2105.  NK> calls), and throw real C++ exceptions which correspond
  2106.  NK> to the NT exception code.
  2107.  
  2108.  NK> I can be reached at (407)262-8084, or on compuserve as
  2109.  NK> 76046,223, or via the Internet as
  2110.  NK> Ned_Konz%Conner_Software@mcimail.com
  2111.  
  2112.  NK> Thanks.
  2113.  
  2114. *** This is a reply to #1656.  *** See also #1930.
  2115.  
  2116.  
  2117. From:    Kip Compton                            Rec'd
  2118. To:      Kevin Kitsemetry                       Msg #1915, Nov-19-93 02:23AM
  2119. Subject: NT Stuff
  2120.  
  2121. I recently bought your compiler mostly for NT work...I have a few
  2122. comments/questions:
  2123.  
  2124. (1) I can't seem to call some of the Win32 functions.  I noticed that most of
  2125. the header files aren't there.  Do I need to buy some extra SDK to be able to
  2126. call Win32 functions?  It seems that some of the API is there (in particular
  2127. the console API -- is part of the SDK there and not the rest?)  If I do buy
  2128. the Win32 SDK, what parts do I use with WATCOM?  I know that it comes with the
  2129. Microsoft compiler, or at least the pre-release version did.
  2130.  
  2131. (2) I compiled a program where I had forgotten the ) on a call to malloc and
  2132. right after wpp386 spit up the error NT claimed that wcpp386 had attempted to
  2133. read memory location 0...
  2134.  
  2135. (3) When will patch level B be available?  I noticed that you said in a msg
  2136. that problems with wmake and long paths will be fixed in them.
  2137.  
  2138. Thanks,
  2139. Kip
  2140.  
  2141. *** See also #1921.
  2142.  
  2143.  
  2144. From:    Mats Manhav                            Rec'd
  2145. To:      Kevin Kitsemetry                       Msg #1916, Nov-19-93 06:03AM
  2146. Subject: reading files and Watcom 9.5
  2147.  
  2148. Hallo Watcom,
  2149.  
  2150. In the file %WATCOM%\src\win\edit\efile.c there is a function FileEdit. In
  2151. that function you open a file with open(), and read it with _dos_read().
  2152.  
  2153. I have an editor where I open a file with OpenFile() and read it with read().
  2154.  
  2155. This worked fine in WATCOM C386 9.01d with patch level e applied. It does not
  2156. work under 9.5.
  2157.  
  2158. If I instead use OpenFile() and _dos_read() it works.
  2159.  
  2160. Here is the function FileEdit edited to not work under 9.5
  2161.  
  2162. void FileEdit( LPEDATA ed, BOOL openfile )
  2163. {
  2164.     LOCALHANDLE hbuff_new,hbuff_old;
  2165.     char        fname[_MAX_PATH];
  2166.     char        str[128];
  2167.     long int    len=0;
  2168.     char        _FAR *buff;
  2169.     int  rc;
  2170.     int  h;
  2171.     unsigned    bytes;
  2172.  
  2173.     if( !CheckFileSave( ed ) ) return;
  2174.     if( openfile ) {
  2175.         if( !GetFileName( ed, FILE_OPEN, fname ) ) return;
  2176.     } else {
  2177.         fname[0] = 0;
  2178.     }
  2179.  
  2180.     /*
  2181.      * get file size, and get a buffer
  2182.      */
  2183.     if( fname[0] != 0 ) {
  2184. //      h = open( fname, O_RDONLY | O_BINARY );
  2185.  
  2186.    h = OpenFile( fname, (LPOFSTRUCT)&OfStruct, OF_READ);
  2187.  
  2188.         if( h < 0 ) {
  2189.             sprintf( str,"Could not open file %s", fname );
  2190.             MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2191.             return;
  2192.         }
  2193.         len = filelength( h );
  2194.     }
  2195.     if( len >= 0xFFFFL || (hbuff_new = LocalAlloc( LMEM_MOVEABLE |
  2196.          LMEM_ZEROINIT, (WORD) len+1 ) ) == NULL ) {
  2197.         sprintf( str, "File %s is too big (%ld bytes)", fname, len+1 );
  2198.         MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2199.         return;
  2200.     }
  2201.  
  2202.     /*
  2203.      * read into temp. buffer, then copy to edit area
  2204.      */
  2205.     if( fname[0] != 0 ) {
  2206.         buff = MemAlloc( len + 1 );
  2207. //      rc = _dos_read( h, buff, len, &bytes );
  2208.    bytes = read(h, buff, len);
  2209.    close( h );
  2210. //      if( rc || bytes != len ) {
  2211.         if( bytes != len ) {
  2212.             sprintf( str,"Could not read file %s", fname );
  2213.             MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2214.             LocalFree( hbuff_new );
  2215.             MemFree( buff );
  2216.             return;
  2217.         }
  2218.         _fmemcpy( MK_LOCAL32( LocalLock( hbuff_new ) ), buff, len );
  2219.         LocalUnlock( hbuff_new );
  2220.         MemFree( buff );
  2221.     }
  2222.  
  2223.     /*
  2224.      * clear out old buffer, and set new one
  2225.      */
  2226.     hbuff_old = SendMessage( ed->editwnd, EM_GETHANDLE, 0, 0L );
  2227.     LocalFree( hbuff_old );
  2228.     SendMessage( ed->editwnd, EM_SETHANDLE, hbuff_new, 0L );
  2229.     NewFileName( ed, fname );
  2230.     ed->needs_saving = FALSE;
  2231.  
  2232. } /* FileEdit */
  2233.  
  2234.  
  2235.  
  2236. I don't need a fix or something for this since I solved the problem. I just
  2237. like to adress you of the problem, cause maybe it is a bug somewhere.
  2238.  
  2239. / Moonsea
  2240.  
  2241. *** See also #1940.
  2242.  
  2243.  
  2244. From:    Mans Agevik                            Rec'd
  2245. To:      Dan Cummins                            Msg #1918, Nov-19-93 09:53AM
  2246. Subject: Free memory
  2247.  
  2248.  MA> When I use _memavl() (which according to the manual
  2249.  MA> should work with DOS/32)
  2250.  MA> it reports 4004 bytes left when there actually is
  2251.  MA> more than 30MB left...
  2252.  
  2253.  DC> functions are not supported in the 32-bit library.  The
  2254.  DC> information you are looking for will probably not be
  2255.  DC> provided by these library functions.
  2256.  
  2257. Yes, I realize that but is there some other way to get the memory
  2258. amount (short of allocating and calculating how much you end up with)?
  2259. I have grown quiet attached to the new and delete operators
  2260. and I would hate to have to go through the DPMI interface...
  2261.  
  2262. //MCA
  2263.  
  2264. *** This is a reply to #1913.  *** See also #1922.
  2265.  
  2266.  
  2267. From:    Christer Palm                          Rec'd
  2268. To:      Phil Duvalsaint                        Msg #1919, Nov-19-93 09:55AM
  2269. Subject: Autocad ads_command troubles
  2270.  
  2271. I tried to duplicate your problem. But here it just went fine.
  2272. The error message you got is typical when you try to do ads_cmd or ads_command
  2273. when a dialog box is on-screen.
  2274.  
  2275. Looking at your code, however, reveals some secondary errors:
  2276.  
  2277. First, the angle should be declared as an ads_real (which is typedef'd to
  2278. double), and not float. However since the compiler always pushes a double for
  2279. floating-point values in a variable argument list, this is not a problem in
  2280. your case.
  2281.  
  2282. Secondly, you shouldn't do strdup() on the strings passed to ads_buildlist(),
  2283. since ads_buildlist does this for you.
  2284.  
  2285.         /Christer Palm
  2286.          TeamCAD AB
  2287.  
  2288. *** This is a reply to #1885.
  2289.  
  2290.  
  2291. From:    Christer Palm                          Rec'd
  2292. To:      Kevin Kitsemetry                       Msg #1920, Nov-19-93 10:08AM
  2293. Subject: WVIDEO and A level patch
  2294.  
  2295. Finally, I've now got my hands on the A-level patches..
  2296. However, after I applied the patches, WVIDEO started to behave strange.
  2297. I use a secondary monochrome adapter for WVIDEO debugging AutoCAD ADS programs.
  2298. When first activated, and while loading AutoCAD, WVIDEO looks like before. But
  2299. when WVIDEO traps into my program, part of the screen turns into reversed
  2300. video(!), and I get horizontal lines all over the screen.
  2301. We have two completely different systems set up here, and both behaves the
  2302. same way after applying the patch.
  2303.  
  2304. It seems like WVIDEO fiddles with the character generator or some MDA
  2305. registers in the wrong way.
  2306.  
  2307. Very annoying!
  2308.  
  2309.   /Christer Palm
  2310.    TeamCAD AB
  2311.  
  2312. *** See also #1941.
  2313.  
  2314.  
  2315. From:    Dan Cummins                            Rec'd
  2316. To:      Kip Compton                            Msg #1921, Nov-19-93 11:24AM
  2317. Subject: NT Stuff
  2318.  
  2319.  KC> I recently bought your compiler mostly for NT work...I
  2320.  KC> have a few comments/questions:
  2321.  
  2322.  KC> (1) I can't seem to call some of the Win32 functions.  I noticed that
  2323.  KC> most of the header files aren't there.  Do I need to
  2324.  KC> buy some extra SDK to be able to call Win32 functions?
  2325.  KC>  It seems that some of the API is there (in particular
  2326.  KC> the console API -- is part of the SDK there and not
  2327.  KC> the rest?)  If I do buy the Win32 SDK, what parts do I
  2328.  KC> use with WATCOM?  I know that it comes with the
  2329.  KC> Microsoft compiler, or at least the pre-release
  2330.  KC> version did.
  2331.  
  2332. We only provide the WINDOWS.H and WINCON.H.  The rest of the header files come
  2333. from Microsoft.  You will have to purchase the NT SDK if you don't have it
  2334. already.
  2335.  
  2336.  KC> (2) I compiled a program where I had forgotten the )
  2337.  KC> on a call to malloc and right after wpp386 spit up the
  2338.  KC> error NT claimed that wcpp386 had attempted to read
  2339.  KC> memory location 0...
  2340.  
  2341. We would need a short example that reproduces the problem
  2342. as well as the compile and link options you used to build it.
  2343.  
  2344.  KC> (3) When will patch level B be available?  I noticed
  2345.  KC> that you said in a msg that problems with wmake and
  2346.  KC> long paths will be fixed in them.
  2347.  
  2348. The B-level patches must still go through the proper builds and QA stages.
  2349. They are targeted for "the next few weeks",but I can't give any guarantees as
  2350. to the time frame.
  2351.  
  2352.  KC> Thanks,
  2353.  KC> Kip
  2354.  
  2355. Dan Cummins
  2356. WATCOM Languages Supoprt
  2357.  
  2358. *** This is a reply to #1915.
  2359.  
  2360.  
  2361. From:    Dan Cummins                            Rec'd
  2362. To:      Mans Agevik                            Msg #1922, Nov-19-93 11:55AM
  2363. Subject: Free memory
  2364.  
  2365.  MA> When I use _memavl() (which according to the manual
  2366.  MA> should work with DOS/32)
  2367.  MA> it reports 4004 bytes left when there actually is
  2368.  MA> more than 30MB left...
  2369.  
  2370.  DC> functions are not supported in the 32-bit library.  The
  2371.  DC> information you are looking for will probably not be
  2372.  DC> provided by these library functions.
  2373.  
  2374.  MA> Yes, I realize that but is there some other way to get the memory
  2375.  MA> amount (short of allocating and calculating how much you end up with)?
  2376.  MA> I have grown quiet attached to the new and delete operators
  2377.  MA> and I would hate to have to go through the DPMI interface...
  2378.  
  2379.  MA> //MCA
  2380.  
  2381. Unfortunately the answer is... not that I know of.  If you have to allocate-
  2382. and-calculate, start with a very large amount and allocate succesively smaller
  2383. chunks until you get a successful malloc (or something along those lines).
  2384.  
  2385. Do not do it the other way (allocating successively larger chunks until you
  2386. run out) or it will appear that you will not be able to allocate all of your
  2387. memory (due to behavioural issues of our memory mamager).
  2388.  
  2389. Dan Cummins
  2390. WATCOM Languages Support
  2391.  
  2392. *** This is a reply to #1918.
  2393.  
  2394.  
  2395. From:    Michael Hung
  2396. To:      Watcom                                 Msg #1923, Nov-19-93 07:10PM
  2397. Subject: Computer hangs
  2398.  
  2399. I have been using WatcomC 9.5a to compile some raytracing programs,
  2400. I used the /fpi option.  The program work fine in 386 machines but
  2401. DOS4GW received an "Unexpected Interrupt" before the program starts on
  2402. the other machine with a 387.  Also, when tried to run the program
  2403. compiled with /4r /7 option on a 486 machine, the situation also
  2404. happened.  Is anyone experienced that ?  The program worked fine with
  2405. all the machines without math-coprocessor I tried.  (386-33, 386-25, and
  2406. a 386SX-16)
  2407.  
  2408. Thanks
  2409. Michael
  2410.  
  2411. *** See also #1931.
  2412.  
  2413.  
  2414. From:    Tom Hollins
  2415. To:      C/C++32 9.5 Tech Support               Msg #1924, Nov-19-93 10:32PM
  2416. Subject: Linking Watcom C libs into Watcom C++ progs
  2417.  
  2418. I am not sure as to what the exact problem is, except that it looks like the C
  2419. libraries for Desqview/X cannot be recognized by the C++ compiler (unknown
  2420. record length during link). Is this the problem I am having? I have "fixed" my
  2421. code to work with the Watcom 9.5a C++ compiler and when I finally get all of
  2422. the modules "fixed" then I get a link error message stating that the records
  2423. cannot be recognized.
  2424. The exact message is "invalid record type 0x002f" then the next line is
  2425. "premature end of file".
  2426. Can you guys and quartedeck figure this out? Is there a fix in the works, or
  2427. are you writing off the compiler for Quarterdeck operations. I really need to
  2428. know, because if you are writing it off then I have to port the C++ code I've
  2429. already written back into C.
  2430. I have to say this has been a terrible lesson to learn. My development
  2431. schedule just got hacked a full week by switching to your compiler. Something
  2432. I thought would take two days (programmer days, not man days).
  2433. Thank you for your time.
  2434. -T-
  2435.  
  2436. *** See also #1932.
  2437.  
  2438.  
  2439. From:    Jason Blochowiak                       Rec'd
  2440. To:      Dan Cummins                            Msg #1925, Nov-20-93 06:37AM
  2441. Subject: Locking for VM
  2442.  
  2443.  Ok, that makes sense - thanks. Actually, it make so much sense, I'm
  2444. embarassed I didn't think of it... :)
  2445.  
  2446.  Will that work for DS as well? Will it only work before doing a malloc(), or
  2447. does malloc() even mess with DS's limit? Remember, I'm only interested in
  2448. locking down the predefined data.
  2449.  
  2450.  Thanks again,
  2451.   Jason
  2452.  
  2453. *** This is a reply to #1899.  *** See also #1944.
  2454.  
  2455.  
  2456. From:    John Hamilton
  2457. To:      Tech Support                           Msg #1927, Nov-21-93 12:53AM
  2458. Subject: Allocating all memory
  2459.  
  2460. I'm attempting to allocate the largest available block as reported
  2461. by DPMI function 500h.  I'm using DPMI function 501h to allocate
  2462. the memory.  The largest available chunk reported by 500h cannot
  2463. be allocated.  I've tried various ways to try and find out
  2464. the actual amount, but none are reliable.  How can I determine
  2465. the actual largest available chunk?
  2466.  
  2467. Thanks,
  2468.  
  2469. John Hamilton
  2470.  
  2471. *** See also #1933.
  2472.  
  2473.  
  2474. From:    Stephen Baum
  2475. To:      All                                    Msg #1928, Nov-21-93 10:30AM
  2476. Subject: DOS4GW and OS/2
  2477.  
  2478. I have a shipping product which runs under the Rational extender. A few
  2479. customers use it in a DOS box under OS/2. Configuration is something of a
  2480. bear, but they can generally get it to work well enough. The application
  2481. drives a variety of scanners and does OCR. One customer is reporting that
  2482. sometimes when he starts scanning (he's using an HP IIC scanner, which I drive
  2483. using HPII.SYS) the program exits with a Transfer Stack Overflow message. If
  2484. he successfully completes the first scan, the product will behave itself
  2485. thereafter. He has been unable to discern any real pattern to it other than
  2486. that.
  2487.  
  2488. Can anyone give me a hint as to what I should look for?
  2489.  
  2490. Stephen Baum
  2491.  
  2492. *** See also #1934.
  2493.  
  2494.  
  2495. From:    Mans Agevik
  2496. To:      Tech support                           Msg #1929, Nov-22-93 10:33AM
  2497. Subject: Exception
  2498.  
  2499. Hi!
  2500. When I try to use WCValSListIter::current() it throws an exception back
  2501. at me and the manual does not say which exceptions it can throw or what
  2502. causes the exceptions, could you help me? By the way, is the RTL source
  2503. available for purchase?
  2504.  
  2505. //MCA
  2506.  
  2507. *** See also #1935.
  2508.  
  2509.  
  2510. From:    Kevin Kitsemetry
  2511. To:      Brian Burton                           Msg #1930, Nov-22-93 06:08PM
  2512. Subject: Windows NT exception handling
  2513.  
  2514.  BB> Could you please share the current status with the rest of us?
  2515.  BB> Is there any preliminary estimate of when NT style exceptions
  2516.  BB> will be supported?
  2517.  BB>
  2518.  BB> Thanks
  2519.  
  2520. I talked with the C++ development team, but they could only tell me that it
  2521. was on the list of things to do.  So no time estimate yet.
  2522.  
  2523.  
  2524. Kevin Kitsemetry
  2525. WATCOM TECHNICAL SUPPORT
  2526.  
  2527. *** This is a reply to #1914.
  2528.  
  2529.  
  2530. From:    Kevin Kitsemetry                       Rec'd
  2531. To:      Michael Hung                           Msg #1931, Nov-22-93 06:21PM
  2532. Subject: Computer hangs
  2533.  
  2534.  MH> I have been using WatcomC 9.5a to compile some raytracing programs,
  2535.  MH> I used the /fpi option.  The program work fine in 386 machines but
  2536.  MH> DOS4GW received an "Unexpected Interrupt" before the program starts on
  2537.  MH> the other machine with a 387.  Also, when tried to run the program
  2538.  MH> compiled with /4r /7 option on a 486 machine, the situation also
  2539.  MH> happened.  Is anyone experienced that ?  The program worked fine with
  2540.  MH> all the machines without math-coprocessor I tried.  (386-33, 386-25, and
  2541.  MH> a 386SX-16)
  2542.  
  2543. I haven't head of this happending with the A-level patches.  This is the
  2544. default option (/fpi) if no other floating point option is specified. Can you
  2545. send us a sample that reproduced the problem?
  2546.  
  2547.  
  2548. Kevin Kitsemetry
  2549. WATCOM TECHNICAL SUPPORT
  2550.  
  2551. *** This is a reply to #1923.
  2552.  
  2553.  
  2554. From:    Kevin Kitsemetry                       Rec'd
  2555. To:      Tom Hollins                            Msg #1932, Nov-22-93 06:31PM
  2556. Subject: Linking Watcom C libs into Watcom C++ progs
  2557.  
  2558.  TH> I am not sure as to what the exact problem is, except
  2559.  TH> that it looks like the C libraries for Desqview/X
  2560.  TH> cannot be recognized by the C++ compiler (unknown
  2561.  TH> record length during link). Is this the problem I am
  2562.  TH> having? I have "fixed" my code to work with the Watcom
  2563.  TH> 9.5a C++ compiler and when I finally get all of the
  2564.  TH> modules "fixed" then I get a link error message
  2565.  TH> stating that the records cannot be recognized.
  2566.  TH> The exact message is "invalid record type 0x002f" then
  2567.  TH> the next line is "premature end of file".
  2568.  TH> Can you guys and quartedeck figure this out? Is there
  2569.  TH> a fix in the works, or are you writing off the
  2570.  TH> compiler for Quarterdeck operations. I really need to
  2571.  TH> know, because if you are writing it off then I have to
  2572.  TH> port the C++ code I've already written back into C.
  2573.  
  2574. It sounds from your message like you have been talking to someone,but I am not
  2575. sure who and I don't recognize the kind of errors that you are running into.
  2576. What have the people at Quaterdeck told you?
  2577.  
  2578.  
  2579. Kevin Kitsemetry
  2580. WATCOM TECHNICAL SUPPORT
  2581.  
  2582. *** This is a reply to #1924.  *** See also #1938.
  2583.  
  2584.  
  2585. From:    Kevin Kitsemetry                       Rec'd
  2586. To:      John Hamilton                          Msg #1933, Nov-22-93 06:38PM
  2587. Subject: Allocating all memory
  2588.  
  2589.  JH> I'm attempting to allocate the largest available block as reported
  2590.  JH> by DPMI function 500h.  I'm using DPMI function 501h to allocate
  2591.  JH> the memory.  The largest available chunk reported by 500h cannot
  2592.  JH> be allocated.  I've tried various ways to try and find out
  2593.  JH> the actual amount, but none are reliable.  How can I determine
  2594.  JH> the actual largest available chunk?
  2595.  
  2596. There are a couple of files relating to memory issues with the Rational DOS
  2597. extender in File Area 10.  Specifically, take a look at the file called
  2598. RSIMEM.C.  It is an example of how to allocate the largest available block of
  2599. memory with the Rational extender.
  2600.  
  2601.  
  2602. Kevin Kitsemetry
  2603. WATCOM TECHNICAL SUPPORT
  2604.  
  2605. *** This is a reply to #1927.  *** See also #1936.
  2606.  
  2607.  
  2608. From:    Kevin Kitsemetry                       Rec'd
  2609. To:      Stephen Baum                           Msg #1934, Nov-22-93 06:44PM
  2610. Subject: DOS4GW and OS/2
  2611.  
  2612.  SB> I have a shipping product which runs under the Rational extender. A few
  2613.  SB> customers use it in a DOS box under OS/2.
  2614.  SB> Configuration is something of a bear, but they can
  2615.  SB> generally get it to work well enough. The application
  2616.  SB> drives a variety of scanners and does OCR. One
  2617.  SB> customer is reporting that sometimes when he starts
  2618.  SB> scanning (he's using an HP IIC scanner, which I drive
  2619.  SB> using HPII.SYS) the program exits with a Transfer
  2620.  SB> Stack Overflow message. If he successfully completes
  2621.  SB> the first scan, the product will behave itself
  2622.  SB> thereafter. He has been unable to discern any real
  2623.  SB> pattern to it other than that.
  2624.  
  2625. I am not sure why the problem would be so intermittent.  Usually,this error is
  2626. causes by a recursive interrupt overloading the transfer stack (a small stack
  2627. maintained by DOS/4GW to pass data between real and protected mode) or by an
  2628. attemp to long jump out of your own handler (contrary to DPMI spec.).
  2629.  
  2630.  
  2631. Kevin Kitsemetry
  2632. WATCOM TECHNICAL SUPPORT
  2633.  
  2634. *** This is a reply to #1928.  *** See also #1937.
  2635.  
  2636.  
  2637. From:    Kevin Kitsemetry
  2638. To:      Mans Agevik                            Msg #1935, Nov-22-93 06:49PM
  2639. Subject: Exception
  2640.  
  2641.  MA> Hi!
  2642.  MA> When I try to use WCValSListIter::current() it throws an exception back
  2643.  MA> at me and the manual does not say which exceptions it can throw or what
  2644.  MA> causes the exceptions, could you help me? By the way, is the RTL source
  2645.  MA> available for purchase?
  2646.  
  2647. Send us a small example that demonstrates the problem and we will try to
  2648. reproduce it here.
  2649.  
  2650.  
  2651. Kevin Kitsemetry
  2652. WATCOM TECHNICAL SUPPORT
  2653.  
  2654. *** This is a reply to #1929.
  2655.  
  2656.  
  2657. From:    John Hamilton                          Rec'd
  2658. To:      Kevin Kitsemetry                       Msg #1936, Nov-22-93 11:19PM
  2659. Subject: Allocating all memory
  2660.  
  2661. Thanks.  Rsimem.c had the answer.
  2662.  
  2663. *** This is a reply to #1933.
  2664.  
  2665.  
  2666. From:    Dan Teven                              Rec'd
  2667. To:      Kevin Kitsemetry                       Msg #1937, Nov-23-93 04:27PM
  2668. Subject: DOS4GW and OS/2
  2669.  
  2670. Which version of DOS/4GW?
  2671.  
  2672. Dan Teven
  2673. Rational Systems
  2674.  
  2675. *** This is a reply to #1934.
  2676.  
  2677.  
  2678. From:    Tom Hollins                            Rec'd
  2679. To:      Kevin Kitsemetry                       Msg #1938, Nov-23-93 11:08PM
  2680. Subject: Linking Watcom C libs into Watcom C++ progs
  2681.  
  2682. I have a direct line into Quarterdeck DVX support. THey understand that C++
  2683. Watcom should not be used because of problems, but the C compiler definitely
  2684. works (which I agree with). Well the point is moot currently since we will be
  2685. porting the current code back into C and will have to stick with C from now on.
  2686. Most of the research into the problems I have found I have done with some
  2687. additional info from Qdeck support.
  2688. Also, I have heard that the C compiler 9.5 is supposed to be at rev level "c".
  2689. Is this for the genereal public (like me?). If it is on the board as of the
  2690. last few days I haven't looked yet and I will download it if I find it, but
  2691. could only find rev level "a" stuff.
  2692. Thank you for your time.
  2693. -T-
  2694.  
  2695. *** This is a reply to #1932.  *** See also #1943.
  2696.  
  2697.  
  2698. From:    Dan Cummins                            Rec'd
  2699. To:      Mats Manhav                            Msg #1940, Nov-24-93 12:42AM
  2700. Subject: reading files and Watcom 9.5
  2701.  
  2702.  MM> Hallo Watcom,
  2703.  
  2704.  MM> In the file %WATCOM%\src\win\edit\efile.c there is a
  2705.  MM> function FileEdit. In that function you open a file
  2706.  MM> with open(), and read it with _dos_read().
  2707.  
  2708.  MM> I have an editor where I open a file with OpenFile()
  2709.  MM> and read it with read().
  2710.  
  2711.  MM> This worked fine in WATCOM C386 9.01d with patch level
  2712.  MM> e applied. It does not work under 9.5.
  2713.  
  2714.  MM> If I instead use OpenFile() and _dos_read() it works.
  2715.  
  2716.  MM> Here is the function FileEdit edited to not work under 9.5
  2717.  
  2718.  MM> void FileEdit( LPEDATA ed, BOOL openfile )
  2719.  MM> {
  2720.  MM>     LOCALHANDLE hbuff_new,hbuff_old;
  2721.  MM>     char        fname[_MAX_PATH];
  2722.  MM>     char        str[128];
  2723.  MM>     long int    len=0;
  2724.  MM>     char        _FAR *buff;
  2725.  MM>     int  rc;
  2726.  MM>     int  h;
  2727.  MM>     unsigned    bytes;
  2728.  
  2729.  MM>     if( !CheckFileSave( ed ) ) return;
  2730.  MM>     if( openfile ) {
  2731.  MM>         if( !GetFileName( ed, FILE_OPEN, fname ) ) return;
  2732.  MM>     } else {
  2733.  MM>         fname[0] = 0;
  2734.  MM>     }
  2735.  
  2736.  MM>     /*
  2737.  MM>      * get file size, and get a buffer
  2738.  MM>      */
  2739.  MM>     if( fname[0] != 0 ) {
  2740.  MM> //      h = open( fname, O_RDONLY | O_BINARY );
  2741.  
  2742.  MM>    h = OpenFile( fname, (LPOFSTRUCT)&OfStruct, OF_READ);
  2743.  
  2744.  MM>         if( h < 0 ) {
  2745.  MM>             sprintf( str,"Could not open file %s", fname );
  2746.  MM>             MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2747.  MM>             return;
  2748.  MM>         }
  2749.  MM>         len = filelength( h );
  2750.  MM>     }
  2751.  MM>     if( len >= 0xFFFFL || (hbuff_new = LocalAlloc( LMEM_MOVEABLE |
  2752.  MM>          LMEM_ZEROINIT, (WORD) len+1 ) ) == NULL ) {
  2753.  MM>         sprintf( str, "File %s is too big (%ld bytes)", fname, len+1 );
  2754.  MM>         MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2755.  MM>         return;
  2756.  MM>     }
  2757.  
  2758.  MM>     /*
  2759.  MM>      * read into temp. buffer, then copy to edit area
  2760.  MM>      */
  2761.  MM>     if( fname[0] != 0 ) {
  2762.  MM>         buff = MemAlloc( len + 1 );
  2763.  MM> //      rc = _dos_read( h, buff, len, &bytes );
  2764.  MM>    bytes = read(h, buff, len);
  2765.  MM>    close( h );
  2766.  MM> //      if( rc || bytes != len ) {
  2767.  MM>         if( bytes != len ) {
  2768.  MM>             sprintf( str,"Could not read file %s", fname );
  2769.  MM>             MessageBox( ed->hwnd, str, EditTitle, MB_OK );
  2770.  MM>             LocalFree( hbuff_new );
  2771.  MM>             MemFree( buff );
  2772.  MM>             return;
  2773.  MM>         }
  2774.  MM>         _fmemcpy( MK_LOCAL32( LocalLock( hbuff_new ) ), buff, len );
  2775.  MM>         LocalUnlock( hbuff_new );
  2776.  MM>         MemFree( buff );
  2777.  MM>     }
  2778.  
  2779.  MM>     /*
  2780.  MM>      * clear out old buffer, and set new one
  2781.  MM>      */
  2782.  MM>     hbuff_old = SendMessage( ed->editwnd, EM_GETHANDLE, 0, 0L );
  2783.  MM>     LocalFree( hbuff_old );
  2784.  MM>     SendMessage( ed->editwnd, EM_SETHANDLE, hbuff_new, 0L );
  2785.  MM>     NewFileName( ed, fname );
  2786.  MM>     ed->needs_saving = FALSE;
  2787.  
  2788.  MM> } /* FileEdit */
  2789.  
  2790.  
  2791.  
  2792.  MM> I don't need a fix or something for this since I
  2793.  MM> solved the problem. I just like to adress you of the
  2794.  MM> problem, cause maybe it is a bug somewhere.
  2795.  
  2796.  MM> / Moonsea
  2797.  
  2798. Thanks, I will log your problem report.  If I have any
  2799. problems reproducing it, etc. I'll let you know.
  2800.  
  2801. Dan Cummins
  2802. WATCOM Languages Support
  2803.  
  2804. *** This is a reply to #1916.
  2805.  
  2806.  
  2807. From:    Dan Cummins                            Rec'd
  2808. To:      Christer Palm                          Msg #1941, Nov-24-93 12:44AM
  2809. Subject: WVIDEO and A level patch
  2810.  
  2811.  CP> Finally, I've now got my hands on the A-level patches..
  2812.  CP> However, after I applied the patches, WVIDEO started to behave strange.
  2813.  CP> I use a secondary monochrome adapter for WVIDEO
  2814.  CP> debugging AutoCAD ADS programs.
  2815.  CP> When first activated, and while loading AutoCAD,
  2816.  CP> WVIDEO looks like before. But when WVIDEO traps into
  2817.  CP> my program, part of the screen turns into reversed
  2818.  CP> video(!), and I get horizontal lines all over the
  2819.  CP> screen.
  2820.  CP> We have two completely different systems set up here, and both behaves
  2821.  CP> the same way after applying the patch.
  2822.  
  2823.  CP> It seems like WVIDEO fiddles with the character
  2824.  CP> generator or some MDA registers in the wrong way.
  2825.  
  2826.  CP> Very annoying!
  2827.  
  2828.  CP>   /Christer Palm
  2829.  CP>    TeamCAD AB
  2830.  
  2831. I haven't heard of this problem.  It sounds like we would
  2832. need an example from you to reproduce it here.
  2833.  
  2834. Dan Cummins
  2835. WATCOM Languages Support
  2836.  
  2837. *** This is a reply to #1920.  *** See also #1981.
  2838.  
  2839.  
  2840. From:    Kevin Kitsemetry                       Rec'd
  2841. To:      Edward Palandri                        Msg #1942, Nov-24-93 01:47PM
  2842. Subject: 32 bit Fortran Windows DLL, ok with Fortran 9.01, fails with 9.5a
  2843.  
  2844.  EP> Problem with Watcom Fortran 32 bit DLL's compiled using Fortran/386 9.5a
  2845.  EP> ========================================================================
  2846.  EP>
  2847.  EP>
  2848.  EP> I have recently attempted to upgrade to C and Fortran 9.5 and I have
  2849.  EP> run into a problem.
  2850.  EP>
  2851.  EP> Basically the 32 bit DLL's that I compile and run successfully using
  2852.  EP> Fortran and C 9.01e do not work or work erratically if I compile them
  2853.  EP> using Fortran and C 9.5a.
  2854.  EP>
  2855.  EP> Please let me know if there is some obvious modification I need to
  2856.  EP> make to get this to work under 9.5a
  2857.  
  2858. A couple of things have to be changed.  Our development team did find a
  2859. problem in one of the startup modules for DLL's.  I have placed this in the
  2860. secret file area as per the voice message I left for you.  Just link this
  2861. object file in with the DLL source when creating the DLL.
  2862.  
  2863. Secondly, you must modify either the 16-bit caller or the 32-bit DLL to ensure
  2864. that the size of the parameters (16-bit vs 32-bit integers) match.  If you
  2865. wish to change the 16-bit C code, make the integers being passed to the DLL
  2866. 'LONG'.  Alternatively, you can make the DLL accpet INTEGER*2.
  2867.  
  2868.  
  2869. Kevin Kitsemetry
  2870. WATCOM TECHNICAL SUPPORT
  2871.  
  2872. *** This is a reply to #1733.
  2873.  
  2874.  
  2875. From:    Kevin Kitsemetry                       Rec'd
  2876. To:      Tom Hollins                            Msg #1943, Nov-24-93 01:44PM
  2877. Subject: Linking Watcom C libs into Watcom C++ progs
  2878.  
  2879.  TH> I have a direct line into Quarterdeck DVX support.
  2880.  TH> THey understand that C++ Watcom should not be used
  2881.  TH> because of problems, but the C compiler definitely
  2882.  TH> works (which I agree with). Well the point is moot
  2883.  TH> currently since we will be porting the current code
  2884.  TH> back into C and will have to stick with C from now on.
  2885.  TH> Most of the research into the problems I have found I
  2886.  TH> have done with some additional info from Qdeck support.
  2887.  
  2888. It sounds like they will have to contact us directly to get support going for
  2889. our C++ compiler.  I am sure the C++
  2890. development team would be willing to help them get through
  2891. any snags they may have hit.
  2892.  
  2893.  
  2894.  TH> Also, I have heard that the C compiler 9.5 is supposed to be at rev
  2895.  TH> level "c". Is this for the genereal public (like me?).
  2896.  TH> If it is on the board as of the last few days I
  2897.  TH> haven't looked yet and I will download it if I find
  2898.  TH> it, but could only find rev level "a" stuff.
  2899.  TH> Thank you for your time.
  2900.  
  2901. Version 9.5 is currently at patch level 'a'.  The previous version (9.01) was
  2902. at level 'e'.
  2903.  
  2904.  
  2905. Kevin Kitsemetry
  2906. WATCOM TECHNICAL SUPPORT
  2907.  
  2908. *** This is a reply to #1938.  *** See also #1947.
  2909.  
  2910.  
  2911. From:    Dan Cummins                            Rec'd
  2912. To:      Jason Blochowiak                       Msg #1944, Nov-24-93 02:24PM
  2913. Subject: Locking for VM
  2914.  
  2915.  JB>  Ok, that makes sense - thanks. Actually, it make so
  2916.  JB> much sense, I'm embarassed I didn't think of it... :)
  2917.  
  2918.  JB>  Will that work for DS as well? Will it only work
  2919.  JB> before doing a malloc(), or does malloc() even mess
  2920.  JB> with DS's limit? Remember, I'm only interested in
  2921.  JB> locking down the predefined data.
  2922.  
  2923.  JB>  Thanks again,
  2924.  JB>   Jason
  2925.  
  2926. I asked our development team for more information regarding this problem.
  2927. Here's the response:
  2928. -------------------------------
  2929. Dan,
  2930.  
  2931. The code and data both start at offset 0 of their respective segments. (cs and
  2932. ds)
  2933.  
  2934. The end of initialized data can be found by looking at the _edata symbol.
  2935.  
  2936. The end of the code can be found by using the 'lsl' assembly instruction. Note
  2937. that the 'lsl' instruction is only available from protected mode. (i.e.
  2938. protected mode 286 or 386)
  2939.  
  2940. For example:
  2941.  
  2942. extern unsigned _get_cs_limit( void );
  2943. #ifdef __386__
  2944. #pragma aux _get_cs_limit = \
  2945.         "push   ebx"            /* save ebx */ \
  2946.         "xor    eax,eax"        /* clear eax */ \
  2947.         "mov    ax,cs"          /* get current code selector */ \
  2948.         "lsl    ebx,eax"        /* get segement limit */ \
  2949.         "mov    eax,ebx"        /* move segment limit to ax */ \
  2950.         "pop    ebx"            /* restore ebx */ \
  2951.         value [eax];
  2952. #else
  2953. #pragma aux _get_cs_limit = \
  2954.         "push   bx"             /* save bx */ \
  2955.         "mov    ax,cs"          /* get current code selector */ \
  2956.         "lsl    bx,ax"          /* get segement limit */ \
  2957.         "mov    ax,bx"          /* move segment limit to ax */ \
  2958.         "pop    bx"             /* restore bx */ \
  2959.         value [ax];
  2960. #endif
  2961.  
  2962. *** This is a reply to #1925.  *** See also #1957.
  2963.  
  2964.  
  2965. From:    Tim Anderson                           Rec'd
  2966. To:      Dan Cummins                            Msg #1946, Nov-26-93 03:22PM
  2967. Subject: problem 11298
  2968.  
  2969. When running under windows we are haveing a bunch of multiple instance
  2970. problems.
  2971.  
  2972. First, if there are two EXE's, but one has some 'changes' and we are trying to
  2973. run the old and new side by side - we only get multiple copies of the first
  2974. one that was executed. I'm doing the wsprintf(cClassName,
  2975. "Class%d",hInstance); stuff as per the doc's. This does NOT appear to be
  2976. enough to force multiple instances correctly. Also, when running one instance
  2977. plain and then starting the debugger up on the other WVIDEO gets confused. It
  2978. starts asking which <subroutine_name> that I want, and lists two references to
  2979. the exact same address. This leads me to beleive that multiple instances
  2980. really are sharing code (when they are not supposed to...).
  2981.  
  2982. Second, both applications call one single 16bit dll. All information is passed
  2983. by pointers into the DLL. It seems that repeated calls into the DLL with one
  2984. of the pointers starts using information out of the other pointers data area.
  2985. COLORREF values that are stored in the transfered pointer information start
  2986. referencing the palette that is set for the other instance of our application.
  2987. It's really quite strange...
  2988.  
  2989. Anyway, I want to be able to force multiple different instances, but it
  2990. doesn't work. Any suggestions?
  2991.  
  2992. *** See also #1955.
  2993.  
  2994.  
  2995. From:    Tom Hollins                            Rec'd
  2996. To:      Kevin Kitsemetry                       Msg #1947, Nov-24-93 10:38PM
  2997. Subject: Linking Watcom C libs into Watcom C++ progs
  2998.  
  2999. Hey Kevin,
  3000. The C vs C++ library linking problem I had was a programmer error. My link
  3001. list were ".c" instead of ".obj" that is why the "bad record" was being
  3002. reported. Your compiler works fine.
  3003. Thanks for your help.
  3004. If anyone is into DVX development the following changes need to be made to the
  3005. Watcom environment:
  3006. 1) copy \dvx\xstub.exe \watcom\binb\wstub.exe
  3007. 2) Create the following include file and include it BEFORE any of the X
  3008. libraries (header files).
  3009. /*
  3010.  * File: watincl.h
  3011.  * Purpose: Watcom's C++ implementation cannot support nested structures
  3012.  *   Therefore include this file BEFORE ALL X11 includes
  3013.  * NOTE: Use extern "C" {} on this file and the X11 files
  3014.  *   -T-
  3015.  *
  3016.  */
  3017.  
  3018. struct _XDisplay;
  3019. struct XKeytrans;
  3020. struct _XrmHashBucketRec;
  3021. struct _XSQEvent;
  3022.  
  3023. #define XTFUNCPROTO
  3024. 3) All C libraries/header files must have extern "C" { (library files) }
  3025. around them otherwise the linker will fail (pretty standard stuff).
  3026. 4) The C++ compiler is extremely picky so you will have to implement (void
  3027. *)calloc(...  on all of your callocs. Also pointer conversion is a no-no in
  3028. C++. void * is NOT a conversion type is is implemented as an actual type (the
  3029. previous void *calloc will work in the C compiler only).
  3030.  
  3031. Any additional problems should be posted maybe I could help I'm not as stupid
  3032. as the above mistake makes me out to be.
  3033.  
  3034. -T-
  3035.  
  3036. *** This is a reply to #1943
  3037.  
  3038. From:    Kevin Blenkinsopp
  3039. To:      Kevin K / Anthony Scian                Msg #1948, Nov-26-93 03:46PM
  3040. Subject: Prototyping hole
  3041.  
  3042. KK> Internal Report #11426
  3043.  
  3044.  
  3045. Guys, this snippet compiles without error under 9.5a. The Sun and some other
  3046. PC compiler rightly flag an error on the "???" line.
  3047.  
  3048. class JimHandle;
  3049.  
  3050. typedef void (*fn)(JimHandle *pJH, int nClient);
  3051.  
  3052. class JimHandle {
  3053. public:
  3054.         JimHandle();
  3055.         static fn mgpfn;
  3056. };
  3057.  
  3058. class FredHandle : public JimHandle {
  3059. public:
  3060.         FredHandle();
  3061. };
  3062.  
  3063. FredHandle::FredHandle() : JimHandle()
  3064. {
  3065.         mgpfn();         // ??? What about my args ???
  3066. }
  3067.  
  3068. The weird thing is that if you call it with "mgpfn(32)" it realises that it
  3069. can't convert 32 to a JimHandle, so why doesn't it realise that there are args
  3070. missing? Anyway, please look into it when you get a chance. PS, any idea when
  3071. the b-level is coming out? I really want that zero-sized array trick back!
  3072.  
  3073. Cheers,
  3074.  
  3075. Kevin
  3076.  
  3077. *** See also #1951.
  3078.  
  3079.  
  3080. From:    Kevin Kitsemetry                       Rec'd
  3081. To:      Kevin Blenkinsopp                      Msg #1951, Nov-26-93 04:06PM
  3082. Subject: Prototyping hole
  3083.  
  3084. KK> Internal Report #11426
  3085.  
  3086.  
  3087.  KB> Guys, this snippet compiles without error under 9.5a.
  3088.  KB> The Sun and some other PC compiler rightly flag an
  3089.  KB> error on the "???" line.
  3090.  
  3091.  KB> class JimHandle;
  3092.  
  3093.  KB> typedef void (*fn)(JimHandle *pJH, int nClient);
  3094.  
  3095.  KB> class JimHandle {
  3096.  KB> public:
  3097.  KB>         JimHandle();
  3098.  KB>         static fn mgpfn;
  3099.  KB> };
  3100.  
  3101.  KB> class FredHandle : public JimHandle {
  3102.  KB> public:
  3103.  KB>         FredHandle();
  3104.  KB> };
  3105.  
  3106.  KB> FredHandle::FredHandle() : JimHandle()
  3107.  KB> {
  3108.  KB>         mgpfn();         // ??? What about my args ???
  3109.  KB> }
  3110.  
  3111.  KB> The weird thing is that if you call it with
  3112.  KB> "mgpfn(32)" it realises that it can't convert 32 to a
  3113.  KB> JimHandle, so why doesn't it realise that there are
  3114.  KB> args missing? Anyway, please look into it when you get
  3115.  KB> a chance. PS, any idea when the b-level is coming out?
  3116.  KB> I really want that zero-sized array trick back!
  3117.  
  3118.  KB> Cheers,
  3119.  
  3120.  KB> Kevin
  3121.  
  3122. This problem has been fixed (as well has the one for the
  3123. zero sized array).  What you can do is give me a call
  3124. at 1-519-886-3700 and I will set you up with a pre
  3125. 'b' level version of the compiler for you to try out (rather than waiting two
  3126. or three more weeks for the patches).
  3127.  
  3128.  
  3129. Kevin Kitsemetry
  3130. WATCOM TECHNICAL SUPPORT
  3131.  
  3132. *** This is a reply to #1948.
  3133.  
  3134.  
  3135. From:    Jim Ehrismann                          Rec'd
  3136. To:      Kevin Kitsemetry                       Msg #1952, Nov-26-93 04:03PM
  3137. Subject: Diamond Viper
  3138.  
  3139. I have a customer with a Diamond Viper card. When he runs our software
  3140. using your graphics library, it appears to be able to set the video mode
  3141. however "the image is scrunched, taking up the top 1/8 of the screen",
  3142. using his words. Do you know if your library supports this card?
  3143.  
  3144.                         Thanks,
  3145.  
  3146.                                 Jim (Handle)
  3147.  
  3148. *** See also #1953.
  3149.  
  3150.  
  3151. From:    Kevin Kitsemetry                       Rec'd
  3152. To:      Jim Ehrismann                          Msg #1953, Nov-26-93 04:23PM
  3153. Subject: Diamond Viper
  3154.  
  3155.  JE> I have a customer with a Diamond Viper card. When he runs our software
  3156.  JE> using your graphics library, it appears to be able to set the video mode
  3157.  JE> however "the image is scrunched, taking up the top 1/8 of the screen",
  3158.  JE> using his words. Do you know if your library supports this card?
  3159.  
  3160. I am not sure if it does or not.  What you can do is have him run the
  3161. VGAINFO.C program available on this BBS (in the general file area). Also, we
  3162. will be adding support for VESA graphics cards in the B-level patches to the
  3163. compiler, so you will want to make sure that you get them when they come out!
  3164. (two to three weeks, hopefully).
  3165.  
  3166.  
  3167. Kevin Kitsemetry
  3168. WATCOM TECHNICAL SUPPORT
  3169.  
  3170. *** This is a reply to #1952.  *** See also #1954.
  3171.  
  3172.  
  3173. From:    Dan Cummins
  3174. To:      Tim Anderson                           Msg #1955, Nov-29-93 09:26AM
  3175. Subject: problem 11298
  3176.  
  3177.  TA> When running under windows we are haveing a bunch of
  3178.  TA> multiple instance problems.
  3179.  
  3180.  TA> First, if there are two EXE's, but one has some 'changes' and we are
  3181.  TA> trying to run the old and new side by side - we only
  3182.  TA> get multiple copies of the first one that was
  3183.  TA> executed. I'm doing the wsprintf(cClassName,
  3184.  TA> "Class%d",hInstance); stuff as per the doc's. This
  3185.  TA> does NOT appear to be enough to force multiple
  3186.  TA> instances correctly. Also, when running one instance
  3187.  TA> plain and then starting the debugger up on the other
  3188.  TA> WVIDEO gets confused. It starts asking which
  3189.  TA> <subroutine_name> that I want, and lists two
  3190.  TA> references to the exact same address. This leads me to
  3191.  TA> beleive that multiple instances really are sharing
  3192.  TA> code (when they are not supposed to...).
  3193.  
  3194.  TA> Second, both applications call one single 16bit dll. All information is
  3195.  TA> passed by pointers into the DLL. It seems that
  3196.  TA> repeated calls into the DLL with one of the pointers
  3197.  TA> starts using information out of the other pointers
  3198.  TA> data area. COLORREF values that are stored in the
  3199.  TA> transfered pointer information start referencing the
  3200.  TA> palette that is set for the other instance of our
  3201.  TA> application. It's really quite strange...
  3202.  
  3203.  TA> Anyway, I want to be able to force multiple different
  3204.  TA> instances, but it doesn't work. Any suggestions?
  3205.  
  3206. Tim,
  3207.  
  3208. I checked with our development team for any tips, as you asked. It looks like
  3209. we will need an example to investigate the problem.
  3210.  
  3211. Dan Cummins
  3212. WATCOM Languages Support
  3213.  
  3214. *** This is a reply to #1946.
  3215.  
  3216.  
  3217. From:    Roman Lewkow                           Rec'd
  3218. To:      Dan Cummins                            Msg #1957, Nov-29-93 03:25PM
  3219. Subject: Finding adresses & stuff
  3220.  
  3221. Dan, for some reason you seem to reply to these messages about VM
  3222. locking,address finding and stuff. I wonder if you could advise me if and how
  3223. I can find a physical address associated with a pointer ( malloc-ed ) under
  3224. 4GW. My app needs to progran
  3225. program ( damn this editor ) a DMA controller with a bunch of starting
  3226. addresses for lines in my frame buffer ( some 40 to 50 MB, roughly 4500 lines,
  3227. 12k each ). One solution would be to hardwire DMA ctrlr to make it blast all
  3228. data somewhere high and then man "somewhere high" into linear selector via
  3229. DPMI 800h. But this is ugly and hardly portable. PharLap API has function
  3230. DosGetPhysAddr which does just that, yet I was told before ( by
  3231. Watcom/Rational team ) this is not possible under DPMI. I have a feeling you
  3232. might know otherwise, if so please let me know ASAP since I have PO ready for
  3233. signing next week to purchase PharLap TNT. I would rather stay with 4GW than
  3234. change to PHAPI calls.
  3235.  
  3236. thanks, Roman
  3237.  
  3238. *** This is a reply to #1944.  *** See also #1964.
  3239.  
  3240.  
  3241. From:    Paul Tletski                           Rec'd
  3242. To:      Kevin Kitsemetry                       Msg #1958, Nov-30-93 12:34PM
  3243. Subject: bimodal interrupt & linking
  3244.  
  3245. Kevin,
  3246.  
  3247. I'm having trouble getting an executable which has a bimodal interrupt to run.
  3248. The program I am running is similar to that which is in the
  3249. _Commonly_Asked_Questions_and_Answers_ book with one exception.  Rather than
  3250. copying down the interrupt handler into a DOS memory block I am attempting to
  3251. run in place.  I am using the Phar Lap 386asm assembler.
  3252.  
  3253. The error that I am getting occurs at runtime.  The following messages are
  3254. displayed.
  3255.  
  3256. "LINEXE: Unhandled alias16 reference to unaliased object"
  3257. "DOS/4GW Fatal Error: Loader Failed.  Unable to resolve external refernces"
  3258.  
  3259. My link is clean, i.e., no warnings or errors.  Any idea what is up?
  3260.  
  3261. Thanks,
  3262.  
  3263. Paul Tletski
  3264. Allen-Bradley Co. Inc.
  3265. Highland Hts., OH
  3266.  
  3267. *** See also #1959.
  3268.  
  3269.  
  3270. From:    Kevin Kitsemetry                       Rec'd
  3271. To:      Paul Tletski                           Msg #1959, Nov-30-93 03:29PM
  3272. Subject: bimodal interrupt & linking
  3273.  
  3274.  PT> Kevin,
  3275.  
  3276.  PT> The error that I am getting occurs at runtime.  The
  3277.  PT> following messages are displayed.
  3278.  
  3279.  PT> "LINEXE: Unhandled alias16 reference to unaliased object"
  3280.  PT> "DOS/4GW Fatal Error: Loader Failed.  Unable to
  3281.  PT> resolve external refernces"
  3282.  
  3283. There was a reported problem with the latest version (1.92) of DOS/4GW that
  3284. caused this error message to appear.  This will be fixed in the next version
  3285. of the DOS extender.  You can also use the previous version in the meantime
  3286. (1.9).  Finally,
  3287. one other person observed that the problem went away if he
  3288. changed one of his MASM options from /ZI to /ZD.
  3289.  
  3290.  
  3291. Kevin Kitsemetry
  3292. WATCOM TECHNICAL SUPPORT
  3293.  
  3294. *** This is a reply to #1958.
  3295.  
  3296.  
  3297. From:    Kevin Blenkinsopp                      Rec'd
  3298. To:      Kevin Kitsemetry                       Msg #1960, Nov-30-93 03:51PM
  3299. Subject: Real mode stuff
  3300.  
  3301. Kevin,
  3302.  
  3303. Couple of quick questions:
  3304.  
  3305. 1) This explodes. Any ideas why?
  3306.  
  3307. #include <Dos.H>
  3308. #include <IOStream.H>
  3309.  
  3310. #include "Defs.H"
  3311.  
  3312. Void main(Count cArg, Strz azArg[])
  3313. {
  3314.    union REGS regs;
  3315.    struct SREGS sregs;
  3316.  
  3317.    regs.w.ax = 0x7A00;
  3318.    int386x(0x2F, ®s, ®s, &sregs);
  3319.  
  3320.    if (regs.h.al == 0xFF) {
  3321.       cout << "IPX installed\n";
  3322.    } else cout << "IPX not installed\n";
  3323. }
  3324.  
  3325.  
  3326. 2) This call returns the address of a real-mode function is ES:BP. How can I
  3327. call it?
  3328.  
  3329. Thanks,
  3330.  
  3331. Kevin
  3332.  
  3333. *** See also #1961.
  3334.  
  3335.  
  3336. From:    Kevin Kitsemetry                       Rec'd
  3337. To:      Kevin Blenkinsopp                      Msg #1961, Nov-30-93 04:01PM
  3338. Subject: Real mode stuff
  3339.  
  3340.  KB> Kevin,
  3341.  
  3342.  KB> Couple of quick questions:
  3343.  
  3344.  KB> 1) This explodes. Any ideas why?
  3345.  
  3346.  KB> #include <Dos.H>
  3347.  KB> #include <IOStream.H>
  3348.  
  3349.  KB> #include "Defs.H"
  3350.  
  3351.  KB> Void main(Count cArg, Strz azArg[])
  3352.  KB> {
  3353.  KB>    union REGS regs;
  3354.  KB>    struct SREGS sregs;
  3355.  
  3356.  KB>    regs.w.ax = 0x7A00;
  3357.  KB>    int386x(0x2F, ®s, ®s, &sregs);
  3358.  
  3359.  KB>    if (regs.h.al == 0xFF) {
  3360.  KB>       cout << "IPX installed\n";
  3361.  KB>    } else cout << "IPX not installed\n";
  3362.  KB> }
  3363.  
  3364. Try using DPMI function 300h to issue the real mode interrupt. There is an
  3365. example of using this function on the BBS called RINTCALL.C in one of the file
  3366. areas.
  3367.  
  3368.  
  3369.  KB> 2) This call returns the address of a real-mode
  3370.  KB> function is ES:BP. How can I call it?
  3371.  
  3372. Same as above.
  3373.  
  3374.  
  3375. Kevin Kitsemetry
  3376. WATCOM TECHNICAL SUPPORT
  3377.  
  3378. *** This is a reply to #1960.
  3379.  
  3380.  
  3381. From:    Dan Teven                              Rec'd
  3382. To:      Kevin Kitsemetry                       Msg #1962, Nov-30-93 03:55PM
  3383. Subject: realloc() under DOS4G Professional
  3384.  
  3385. Another customer asked me about your reply to Skip Fedanzo's message,
  3386. so I thought I would clarify.  The bug we've documented is that
  3387. when you realloc() a block of memory, and grab more memory from the
  3388. operating system (us), you don't return the previously used memory to
  3389. the operating system.  No DOS extender is going to be able to combine
  3390. small chunks of memory into large chunks if the blocks are in use,
  3391. which they are in this case (your heap manager still owns them, though
  3392. the application program isn't using them any longer).
  3393.  
  3394. Fragmentation is going to happen with any run-time library heap
  3395. manager under some conditions; one can always invent a pattern of
  3396. allocations and frees that causes gaps in the free list, and causes
  3397. large allocations of contiguous memory to fail even if there's enough
  3398. total memory available to satisfy the allocation request.  The
  3399. particular case I've discussed before shows up when you use realloc()
  3400. to grow a large block (or blocks) repeatedly.  If you don't use
  3401. realloc(), it won't bite you.  There may be other situations under
  3402. which fragmentation will occur, but there's nothing the DOS extender
  3403. can do to solve those situations, either.  Fragmentation of the
  3404. memory managed by the run-time library is most probably caused
  3405. by unusual allocate/free patterns in the application program, and
  3406. the best way to avoid it is for the application programmer to
  3407. be aware of the possibility...
  3408.  
  3409. Dan
  3410.  
  3411. *** This is a reply to #1864.  *** See also #1968.
  3412.  
  3413.  
  3414. From:    Robert Baker
  3415. To:      Watcom Tech Support                    Msg #1963, Nov-30-93 04:33PM
  3416. Subject: fread() in C32 for DOS
  3417.  
  3418. I have a large application that we compile using C32 for DOS to get a DOS
  3419. Extended version and also with MS C/C++ 7.00 to get a real mode version.  We
  3420. have a problem with reading (using fread) data from a file in that the fread
  3421. returns correctly but does not read the correct data.  It works fine under MS.
  3422.  I saw msg 1671 about reading across the 0x1000 boundary and checked our data.
  3423.  The point in the file we are reading is at 4118 and we are trying to read 9
  3424. bytes (ie - fread (buf, 9, 1, fp)).  Our C32 system is patched to level A.  My
  3425. customers are not happy, so any help would be greatly appreciated...
  3426.  
  3427. *** See also #1966.
  3428.  
  3429.  
  3430. From:    Dan Cummins                            Rec'd
  3431. To:      Roman Lewkow                           Msg #1964, Nov-30-93 05:28PM
  3432. Subject: Finding adresses & stuff
  3433.  
  3434.  RL> Dan, for some reason you seem to reply to these
  3435.  RL> messages about VM locking,address finding and stuff. I
  3436.  RL> wonder if you could advise me if and how I can find a
  3437.  RL> physical address associated with a pointer ( malloc-ed
  3438.  RL> ) under 4GW. My app needs to progran
  3439.  RL> program ( damn this editor ) a DMA controller with a bunch of starting
  3440.  RL> addresses for lines in my frame buffer ( some 40 to 50
  3441.  RL> MB, roughly 4500 lines, 12k each ). One solution would
  3442.  RL> be to hardwire DMA ctrlr to make it blast all data
  3443.  RL> somewhere high and then man "somewhere high" into
  3444.  RL> linear selector via DPMI 800h. But this is ugly and
  3445.  RL> hardly portable. PharLap API has function
  3446.  RL> DosGetPhysAddr which does just that, yet I was told
  3447.  RL> before ( by Watcom/Rational team ) this is not
  3448.  RL> possible under DPMI. I have a feeling you might know
  3449.  RL> otherwise, if so please let me know ASAP since I have
  3450.  RL> PO ready for signing next week to purchase PharLap
  3451.  RL> TNT. I would rather stay with 4GW than change to PHAPI
  3452.  RL> calls.
  3453.  RL>
  3454.  RL> thanks, Roman
  3455.  
  3456. It's true that under DPMI you can't ask for physical addresses from linear
  3457. ones because of the paging mechanism.
  3458.  
  3459. I believe DPMI 800h is the way to go.  There is an example
  3460. of using such calls on this BBS.  It's called ACCMEM.C and
  3461. it's under the WATCOM C file area.  The numbers in this
  3462. example are bogus, but you'll have to change them anyway
  3463. for your application.  The example just serves as a skeleton.
  3464.  
  3465. I looked up Phar Lap's "Convert Linear Address to Physical Address" function,
  3466. which is called _dx_tophys() in my manual.  As expected,it always returns an
  3467. error code if called while running under DPMI.
  3468.  
  3469. Dan Cummins
  3470. WATCOM Languages Support
  3471.  
  3472. *** This is a reply to #1957.
  3473.  
  3474.  
  3475. From:    Jason Blochowiak                       Rec'd
  3476. To:      Dan Cummins                            Msg #1965, Dec-01-93 09:53AM
  3477. Subject: Locking for VM
  3478.  
  3479.  I appreciate the response. I tried getting/decoding the selector data, and
  3480. (for C/C++ v9.5a under DOS/4GW 1.92) the base was 0, and the limit was
  3481. something very large (~4Gb, if memory serves). In retrospect, this makes
  3482. sense, given the context of the "flat" memory model. What I ended up doing to
  3483. get some values that I could use was poking through the asm startup code, and
  3484. finding the "special" symbols that denote the boundaries of the various
  3485. regions (code/initialized data/bss). I used their addresses for the locking
  3486. functions, and everything seemed to work fine - I ran my test app in a DOS box
  3487. under Windows 3.1 with VM enabled, and it no longer croaks.
  3488.  
  3489.  So, unless I'm doing something heinously wrong (always a possibility :), it
  3490. looks like this problem is no more. Thanks again for your help,
  3491.  
  3492.  Jason
  3493.  
  3494. *** This is a reply to #1944.
  3495.  
  3496.  
  3497. From:    Kevin Blenkinsopp                      Rec'd
  3498. To:      Robert Baker                           Msg #1966, Dec-01-93 01:59PM
  3499. Subject: fread() in C32 for DOS
  3500.  
  3501. I had the same problem. I went for a brute force solution and used open and
  3502. read instead of fopen and fread, which worked fine. There wasn't any
  3503. noticeable performance hit.
  3504.  
  3505. *** This is a reply to #1963.
  3506.  
  3507.  
  3508. From:    Kevin Blenkinsopp                      Rec'd
  3509. To:      Kevin Kitsemetry                       Msg #1967, Dec-02-93 09:34AM
  3510. Subject: More real mode stuff
  3511.  
  3512. KK> Internal Report #11809
  3513.  
  3514.  
  3515. Thanks for the help. I still have a problem with part two though...
  3516.  
  3517. extern Word InitSPX(Void (*func)(Void));
  3518. #pragma aux InitSPX = \
  3519.         "push   bp"             \
  3520.         "mov    ebx, 0x10"      \
  3521.         "call   eax"            \
  3522.         "pop    bp"             \
  3523.         parm [eax] modify [ebx ecx edx];
  3524.  
  3525. Void main(Count cArg, Strz azArg[])
  3526. {
  3527.         .
  3528.         .
  3529.         .
  3530.  
  3531.         // use DMPI to issue the DOS interrupt
  3532.         regs.w.ax = 0x0300;
  3533.         regs.h.bl = 0x2F;
  3534.         regs.h.bh = 0;
  3535.         regs.w.cx = 0;
  3536.         sregs.es = FP_SEG(&rmi);
  3537.         regs.x.edi = FP_OFF(&rmi);
  3538.         int386x(0x31, ®s, ®s, &sregs);
  3539.         // this now returns nicely and gives the right results
  3540.         // the next thing to do is initialise the SPX driver by
  3541.         // setting bx to 16 and calling the real-mode function
  3542.         // that was just returned in es:di
  3543.         // This is the bit I still have a problem with
  3544.  
  3545.         typedef Void (*PFN)(Void);
  3546.         if ((rmi.eax & 0xFF) == 0xFF) {
  3547.          PFN pfn = (PFN)MK_FP(rmi.es, (rmi.edi & 0xFFFF));
  3548.          cout << "IPX installed - Call address is " << pfn << endl;
  3549.          // nuclear holocaust now ensues...
  3550.          cout << "SPX Init returned " << InitSPX(pfn) << endl;
  3551.         } else cout << "IPX not installed\n";
  3552. }
  3553.  
  3554. Because the IPX/SPX calling mechanism is so obnoxious, I'm guessing that I
  3555. have to use a code burst like the one above. I've got that "out of my depth"
  3556. feeling here, so I'm going to ask you to bail me out again! I've been coming
  3557. down with something over the last couple of days, so I may not be thinking too
  3558. clearly right now. I'll be out for the rest of the week, so I don't need an
  3559. answer on this immediately.
  3560.  
  3561. Thanks,
  3562.  
  3563. Kevin
  3564.  
  3565. *** See also #1994.
  3566.  
  3567.  
  3568. From:    Kevin Kitsemetry                       Rec'd
  3569. To:      Dan Teven                              Msg #1968, Dec-01-93 06:12PM
  3570. Subject: realloc() under DOS4G Professional
  3571.  
  3572.  DT> to grow a large block (or blocks) repeatedly.  If you don't use
  3573.  DT> realloc(), it won't bite you.  There may be other situations under
  3574.  DT> which fragmentation will occur, but there's nothing the DOS extender
  3575.  DT> can do to solve those situations, either.  Fragmentation of the
  3576.  
  3577. This sounds logical to me.  I understand that the problem has been rectified
  3578. for the next level of patches anyway.  But I still don't understand why other
  3579. extenders (such as Pharlap) don't encounter this problem?
  3580.  
  3581. Kevin
  3582.  
  3583. *** This is a reply to #1962.  *** See also #1969.
  3584.  
  3585.  
  3586. From:    Dan Teven                              Rec'd
  3587. To:      Kevin Kitsemetry                       Msg #1969, Dec-01-93 08:32PM
  3588. Subject: realloc() under DOS4G Professional
  3589.  
  3590. I believe it's because your library support for those extenders
  3591. uses a different interface, not int 31h calls.  The problem is
  3592. in the way those int 31h calls are used (actually, not used),
  3593. not how the extender responds to the int 31h calls.
  3594.  
  3595. Dan
  3596.  
  3597. *** This is a reply to #1968.
  3598.  
  3599.  
  3600. From:    Dan Cummins
  3601. To:      Donald Tevault                         Msg #1970, Dec-02-93 12:43PM
  3602. Subject: WMAKE
  3603.  
  3604. DC> Internal Report #10428
  3605.  
  3606.  DT> # Hi Kevin!
  3607.  DT> #       I made the makefile for the Calendar.cpp file as you said, and
  3608.  DT> it # does invoke the C++ compiler without any problem.
  3609.  DT>  I then tried playing around # some more with this
  3610.  DT> zipcode.mak file, but no matter what I tried, I still
  3611.  DT> got # the same results.  That is, it just dumps me out
  3612.  DT> to DOS without invoking the # C++ compiler.  It's not
  3613.  DT> that it can't find the compiler,because even when I #
  3614.  DT> move the compiler to the same directory as this
  3615.  DT> makefile, it still does the # same thing.  If you can
  3616.  DT> figure out a way to make it work, I will be very #
  3617.  DT> grateful.
  3618.  DT> #        Many thanks in advance.
  3619.  DT> #                Donald Tevault
  3620.  DT> #
  3621.  DT> #
  3622.  DT> #
  3623.  DT> #       MakeFile Frame For Watcom C++ or better
  3624.  DT> # ~1 = APPNAME, ~2 = APPNAMEdlg, ~3 =  APPNAMEm,
  3625.  DT> # ~4 = APPNAMEdb, ~5 = APPNAMEini
  3626.  DT> # ~6 = Include Directory, ~7 = Library Directory
  3627.  DT> # ~8 = Source Directory
  3628.  DT> .EXTENSIONS: .CPP
  3629.  DT> SD = C:\DB4W\SOURCE\\
  3630.  
  3631.  DT> FILES = charf.obj pictures.obj ZIPCODDD.obj ZIPCODMM.obj\
  3632.  DT> dllutil.obj stdfile.obj database.obj toolbar.obj
  3633.  DT> specscrl.obj\ stdquery.obj linkman.obj memof.obj
  3634.  DT> combo.obj dialogs.obj\
  3635.  DT> table.obj query.obj stdidx.obj lexer.obj parser.obj
  3636.  DT> symbol.obj\ decor.obj static.obj keyfilt.obj
  3637.  DT> checkbox.obj btree.obj file.obj
  3638.  
  3639.  
  3640.  
  3641.  DT> INCLUDEDIR = C:\DB4W\SOURCE
  3642.  DT> LIBDIR   = C:\WATCOM\LIB386;C:\WATCOM\LIB386\WIN\\
  3643.  
  3644.  DT> COM = WIN386 1
  3645.  DT> CC = wpp386
  3646.  
  3647.  DT> # Most Compiler-Specific Items are in the following 7 lines # Almost any
  3648.  DT> Windows C++ compiler that uses a MAKEFILE can be #
  3649.  DT> supported here # COMPILER = LINKER   = wlink
  3650.  DT> RC        = wrc
  3651.  DT> RFLAGS   = /r /i=$(SOURCEDIR)
  3652.  DT> #CFLAGS  = /c /GW
  3653.  DT> CPPFLAGS = -zW -oaxt -d1 -d -w4 -fpc -i=$(INCLUDEDIR)
  3654.  DT> LFLAGS   = /Lw
  3655.  DT> LFILES   = ZIPCODE.def
  3656.  
  3657.  DT> .cpp.obj:
  3658.  DT>        $(CC) $[*.cpp $(CPPFLAGS)
  3659.  
  3660.  DT> #.c.obj:
  3661.  DT> #       $(COMPILER) $(CFLAGS) $^.
  3662.  
  3663.  DT> ZIPCODE.res: ZIPCODE.rc
  3664.  DT>         $(RC) $(RFLAGS) ZIPCODE.rc
  3665.  
  3666.  DT> ZIPCODE.EXE: ZIPCODE.obj $(FILES) ZIPCODE.rc  ZIPCODE.def
  3667.  DT>         $(LINKER) $(LFLAGS) $(FILES) $(LFILES)
  3668.  DT>         wbind ZIPCODE -R -31 ZIPCODE.res
  3669.  DT> #       rc -t -K ~1
  3670.  
  3671.  DT> #       Dependencies
  3672.  DT> CHARF =         $(SD)charf.hpp
  3673.  DT> DATABASE =      $(SD)database.hpp
  3674.  DT> PICTURES =      $(SD)pictures.hpp
  3675.  DT> GLOBAL =        $(SD)global.hpp
  3676.  DT> DLLUTIL =       $(SD)dllutil.hpp
  3677.  DT> FRAME =         $(SD)frame.hpp
  3678.  DT> STATBAR =       $(SD)statbar.hpp
  3679.  DT> MEMOF =         $(SD)memof.hpp
  3680.  DT> COMBO =         $(SD)combo.hpp
  3681.  DT> TOOLBAR =       $(SD)toolbar.hpp
  3682.  DT> SPECSCRL =      $(SD)specscrl.hpp
  3683.  DT> GENERIC =       $(SD)generic.hpp
  3684.  DT> STDQUERY =      $(SD)stdquery.hpp
  3685.  DT> DIALOGS =       $(SD)dialogs.hpp
  3686.  DT> LINKMAN =       $(SD)linkman.hpp
  3687.  DT> QUERY =         $(SD)query.hpp
  3688.  DT> TABLE =         $(SD)table.hpp
  3689.  DT> STDIDX =        $(SD)stdidx.hpp
  3690.  DT> STDFILE =       $(SD)stdfile.hpp
  3691.  DT> LEXER =  $(SD)lexer.hpp
  3692.  DT> PARSER =         $(SD)parser.hpp
  3693.  DT> SYMBOL =         $(SD)symbol.hpp
  3694.  DT> DECOR =  $(SD)decor.hpp
  3695.  DT> STATIC =         $(SD)static.hpp
  3696.  DT> KEYFILT =       $(SD)keyfilt.hpp
  3697.  DT> CHECKBOX =      $(SD)checkbox.hpp
  3698.  DT> BTREE    =      $(SD)btree.hpp
  3699.  DT> FILE     =      $(SD)file.hpp
  3700.  
  3701.  DT> stdidx.obj      : $(SD)stdidx.cpp $(STDIDX)
  3702.  DT> charf.obj       : $(SD)charf.cpp  $(CHARF) $(DLLUTIL)
  3703.  DT> $(DATABASE) pictures.obj : $(SD)pictures.cpp
  3704.  DT> $(PICTURES)
  3705.  DT> ZIPCODE.obj      : ZIPCODE.cpp $(STDFILE) $(GLOBAL)
  3706.  DT> $(FRAME) $(DATABASE) $(STATBAR)\
  3707.  DT>                  $(TOOLBAR) $(SPECSCRL) $(CHARF) $(NUMF) $(COMBO)
  3708.  DT> $(MEMOF) $(DLLUTIL) ZIPCODE.cpp ZIPCODE.res      :
  3709.  DT> ZIPCODE.rc ZIPCODE.h ZIPCODE.stb ZIPCODDD.obj     :
  3710.  DT> ZIPCODDD.cpp $(GENERIC) $(CHARF) $(DATABASE)
  3711.  DT> ZIPCODE.cpp ZIPCODMM.obj     : ZIPCODMM.cpp $(FRAME)
  3712.  DT> $(STDFILE) $(GLOBAL) $(DATABASE) $(STATBAR)\
  3713.  DT>                  $(TOOLBAR) ZIPCODDD.hpp ZIPCODE.h
  3714.  DT> $(GENERIC) $(DIALOGS) dllutil.obj     :
  3715.  DT> $(SD)dllutil.cpp $(DLLUTIL)
  3716.  DT> stdfile.obj     : $(SD)stdfile.cpp $(DLLUTIL)
  3717.  DT> $(STDQUERY) $(STDFILE) $(MKTREE)\
  3718.  DT>         $(PICTURES)
  3719.  DT> database.obj : $(SD)database.cpp $(DATABASE) $(GLOBAL)
  3720.  DT> $(GENERIC) $(FRAME)\
  3721.  DT>         $(STATBAR) $(CHARF) $(DLLUTIL) $(SPECSCRL)
  3722.  DT> $(DIALOGS) toolbar.obj : $(SD)toolbar.cpp $(TOOLBAR)
  3723.  DT> $(DATABASE)
  3724.  DT> statbar.obj     : $(SD)statbar.cpp $(STATBAR)
  3725.  DT> specscrl.obj : $(SD)specscrl.cpp $(SPECSCRL)
  3726.  DT> stdquery.obj : $(SD)stdquery.cpp $(STDQUERY) $(DLLUTIL)
  3727.  DT> linkman.obj     : $(SD)linkman.cpp $(LINKMAN)
  3728.  DT> $(GLOBAL) $(PICTURES) memof.obj
  3729.  DT>       : $(SD)memof.cpp $(MEMOF) $(DLLUTIL) $(DATABASE) combo.obj       :
  3730.  DT> $(SD)combo.cpp $(COMBO) $(DLLUTIL) $(DATABASE)
  3731.  DT> dialogs.obj     : $(SD)dialogs.cpp $(DIALOGS)
  3732.  DT> $(STDFILE) $(GLOBAL) $(GENERIC) table.obj       :
  3733.  DT> $(SD)table.cpp $(TABLE)
  3734.  DT> query.obj       : $(SD)query.cpp $(QUERY)
  3735.  DT> lexer.obj       : $(SD)lexer.cpp $(LEXER)
  3736.  DT> parser.obj      : $(SD)parser.cpp $(PARSER)
  3737.  DT> symbol.obj      : $(SD)symbol.cpp $(SYMBOL)
  3738.  DT> decor.obj       : $(SD)decor.cpp $(DECOR)
  3739.  DT> static.obj      : $(SD)static.cpp $(STATIC)
  3740.  DT> keyfilt.obj      : $(SD)keyfilt.cpp $(KEYFILT)
  3741.  DT> checkbox.obj : $(SD)checkbox.cpp $(CHECKBOX)
  3742.  DT> btree.obj       : $(SD)btree.cpp $(BTREE)
  3743.  DT> file.obj         : $(SD)file.cpp $(FILE)
  3744.  
  3745. At first I thought when you said 'dumped out to DOS' you
  3746. meant that WMAKE was somehow not being invoked or crashing
  3747. somehow.  A member of our development team pointed out that in your makefile,
  3748. the first target defined.
  3749.  
  3750. If you invoke wmake without specifying a target, it will
  3751. default to the first target.  Hence in your case if ZIPCODE.RES is up to date,
  3752. then make has nothing to do.
  3753.  
  3754. You should put ZIPCODE.EXE as the first target, and have it depend on
  3755. ZIPCODE.RES (in your file it depends on ZIPCODE.RC).  The ZIPCODE.RES rule
  3756. should appear after this.
  3757.  
  3758. Dan Cummins
  3759. WATCOM Languages Support
  3760.  
  3761. P.S. To make a specific target, you can use 'wmake <targetname>' on the
  3762. command line.
  3763.  
  3764.  
  3765. *** This is a reply to #1886.
  3766.  
  3767.  
  3768. From:    Jim Ehrismann                          Rec'd
  3769. To:      Kevin Kitsemetry                       Msg #1971, Dec-02-93 10:04AM
  3770. Subject: Diamond Viper
  3771.  
  3772.  KK> I am not sure if it does or not.  What you can do is
  3773.  KK> have him run the VGAINFO.C program available on this
  3774.  KK> BBS (in the general file area). Also, we will be adding
  3775.  KK> support for VESA graphics cards in the B-level patches
  3776.  KK> to the compiler, so you will want to make sure that you
  3777.  KK> get them when they come out! (two to three weeks,
  3778.  KK> hopefully).
  3779.  
  3780. VGAINFO recognized the Viper card as an S3. Setting the video
  3781. modes was not the problem, putting images was. I will wait for the
  3782. VESA support and try again then. Thanks.
  3783.  
  3784.                 Jim Ehrismann
  3785.  
  3786. *** This is a reply to #1953.  *** See also #1982.
  3787.  
  3788.  
  3789. From:    Jerry Rice                             Rec'd
  3790. To:      Jim Ehrismann                          Msg #1972, Dec-05-93 04:44AM
  3791. Subject: Diamond Viper
  3792.  
  3793. JE> KK> I am not sure if it does or not.  What you can do is
  3794. JE> KK> have him run the VGAINFO.C program available on this
  3795. JE> KK> BBS (in the general file area). Also, we will be adding
  3796. JE> KK> support for VESA graphics cards in the B-level patches
  3797. JE> KK> to the compiler, so you will want to make sure that you
  3798. JE> KK> get them when they come out! (two to three weeks,
  3799. JE> KK> hopefully).
  3800.  
  3801. JE>VGAINFO recognized the Viper card as an S3. Setting the video
  3802. JE>modes was not the problem, putting images was. I will wait for the
  3803. JE>VESA support and try again then. Thanks.
  3804.  
  3805. JE>                Jim Ehrismann
  3806.  
  3807.  
  3808.       First, I don't  think the viper is an  S3. The Stealth
  3809. cards  are S3's.  I think  it's a  Weitech. Why its "saying"
  3810. that  it  is  an  S3,  I  don't  know. Memory structuring is
  3811. definitely different. Second, if it  is an S3 it has changed
  3812. considerably since  the Stealth versions  which had 1Meg  of
  3813. memory.  (The  S3  driver  from  Watcom  works well with the
  3814. Stealth  cards  using  the  S3  chipset)  What  you formerly
  3815. described is the classical  paging problem. What your client
  3816. is actually  displaying on is  the first 64k  chunk of video
  3817. memory.  Knowing  where  and  how  to  set  the  page select
  3818. register  is  where  the  difficulty  is.  Its  not  able to
  3819. select(activate) the proper page  number for continued video
  3820. display. That it  is scrunched and only 1/8th  of the screen
  3821. indicates this.  Only every 8th line  is being displayed and
  3822. in the wrong place, at  that. Its writing to A000:0000 every
  3823. 8th line, which  will work with most cards,  but when it has
  3824. to  change to  the next  page to  continue, the  page select
  3825. register is not being set correctly. Sort of like this: line
  3826. one of the display,is on page  one; Line 2 of the display is
  3827. on page 2,  etc. So every 8th line will  be on page one, and
  3828. that's  all that's  being activated.  VESA should  work, but
  3829. realize that  it will be  slower. I have  an S3 Stealth  and
  3830. Watcom drivers  are 3-4 times faster  with their direct mode
  3831. than  the  equivalent  VESA  drivers,  even  though the VESA
  3832. support is  on ROM! It has  to go through a  second layer of
  3833. instructions  every time  it  writes.  Because the  Viper is
  3834. probably the  most popular 'fastest'  card on the  market, I
  3835. hope that  Watcom will support  it in direct  mode. But they
  3836. will have to get one first  and 'play' with it. Many Many of
  3837. the VL Bus video systems are  being sent with the Viper card
  3838. as standard. For instance, Zeos and Gateway.
  3839.  
  3840.  
  3841.                                     Jer
  3842. ___
  3843.  X SLMR 2.1a X
  3844.  
  3845. *** See also #2005.
  3846.  
  3847.  
  3848. From:    Jerry Rice                             Rec'd
  3849. To:      Kevin Kitsemetry                       Msg #1973, Dec-05-93 04:44AM
  3850. Subject: Diamond Viper
  3851.  
  3852. JE> KK> I am not sure if it does or not.  What you can do is
  3853. JE> KK> have him run the VGAINFO.C program available on this
  3854. JE> KK> BBS (in the general file area). Also, we will be adding
  3855. JE> KK> support for VESA graphics cards in the B-level patches
  3856. JE> KK> to the compiler, so you will want to make sure that you
  3857. JE> KK> get them when they come out! (two to three weeks,
  3858. JE> KK> hopefully).
  3859.  
  3860. JE>VGAINFO recognized the Viper card as an S3. Setting the video
  3861. JE>modes was not the problem, putting images was. I will wait for the
  3862. JE>VESA support and try again then. Thanks.
  3863.  
  3864. JE>                Jim Ehrismann
  3865.  
  3866.  
  3867.       First, I don't  think the viper is an  S3. The Stealth
  3868. cards  are S3's.  I think  it's a  Weitech. Why its "saying"
  3869. that  it  is  an  S3,  I  don't  know. Memory structuring is
  3870. definitely different. Second, if it  is an S3 it has changed
  3871. considerably since  the Stealth versions  which had 1Meg  of
  3872. memory.  (The  S3  driver  from  Watcom  works well with the
  3873. Stealth  cards  using  the  S3  chipset)  What  you formerly
  3874. described is the classical  paging problem. What your client
  3875. is actually  displaying on is  the first 64k  chunk of video
  3876. memory.  Knowing  where  and  how  to  set  the  page select
  3877. register  is  where  the  difficulty  is.  Its  not  able to
  3878. select(activate) the proper page  number for continued video
  3879. display. That it  is scrunched and only 1/8th  of the screen
  3880. indicates this.  Only every 8th line  is being displayed and
  3881. in the wrong place, at  that. Its writing to A000:0000 every
  3882. 8th line, which  will work with most cards,  but when it has
  3883. to  change to  the next  page to  continue, the  page select
  3884. register is not being set correctly. Sort of like this: line
  3885. one of the display,is on page  one; Line 2 of the display is
  3886. on page 2,  etc. So every 8th line will  be on page one, and
  3887. that's  all that's  being activated.  VESA should  work, but
  3888. realize that  it will be  slower. I have  an S3 Stealth  and
  3889. Watcom drivers  are 3-4 times faster  with their direct mode
  3890. than  the  equivalent  VESA  drivers,  even  though the VESA
  3891. support is  on ROM! It has  to go through a  second layer of
  3892. instructions  every time  it  writes.  Because the  Viper is
  3893. probably the  most popular 'fastest'  card on the  market, I
  3894. hope that  Watcom will support  it in direct  mode. But they
  3895. will have to get one first  and 'play' with it. Many Many of
  3896. the VL Bus video systems are  being sent with the Viper card
  3897. as standard. For instance, Zeos and Gateway.
  3898.  
  3899.  
  3900.                                     Jer
  3901. ___
  3902.  X SLMR 2.1a X
  3903.  
  3904. *** See also #1978.
  3905.  
  3906.  
  3907. From:    John Hamilton
  3908. To:      Tech Support                           Msg #1974, Dec-05-93 07:08PM
  3909. Subject: Freeing memory under DOS/4GW
  3910.  
  3911. Is it necessary to free allocated memory when exiting a program
  3912. written using DOS/4GW?  It appears that the memory I've allocated
  3913. is already being given back.
  3914.  
  3915. *** See also #1979.
  3916.  
  3917.  
  3918. From:    Mike Brennen
  3919. To:      Tech Support                           Msg #1976, Dec-06-93 09:31AM
  3920. Subject: C++32 B level patches
  3921.  
  3922. In response to 1909, when will B level patches be available?  I don't see them
  3923. in the file areas.   Thanks...
  3924.  
  3925. *** See also #1980.
  3926.  
  3927.  
  3928. From:    Kevin Kitsemetry                       Rec'd
  3929. To:      Jerry Rice                             Msg #1978, Dec-06-93 10:21AM
  3930. Subject: Diamond Viper
  3931.  
  3932. Thanks for the information, I will pass it on to the developer in charge of
  3933. the graphics library right away.
  3934.  
  3935.  
  3936. Kevin Kitsemetry
  3937. WATCOM TECHNICAL SUPPORT
  3938.  
  3939. *** This is a reply to #1973.  *** See also #1990.
  3940.  
  3941.  
  3942. From:    Kevin Kitsemetry                       Rec'd
  3943. To:      John Hamilton                          Msg #1979, Dec-06-93 10:26AM
  3944. Subject: Freeing memory under DOS/4GW
  3945.  
  3946.  JH> Is it necessary to free allocated memory when exiting a program
  3947.  JH> written using DOS/4GW?  It appears that the memory I've allocated
  3948.  JH> is already being given back.
  3949.  
  3950. It is not necessary, but it is always a good programming practice!
  3951.  
  3952.  
  3953. Kevin Kitsemetry
  3954. WATCOM TECHNICAL SUPPORT
  3955.  
  3956. *** This is a reply to #1974.
  3957.  
  3958.  
  3959. From:    Kevin Kitsemetry                       Rec'd
  3960. To:      Mike Brennen                           Msg #1980, Dec-06-93 10:28AM
  3961. Subject: C++32 B level patches
  3962.  
  3963.  MB> In response to 1909, when will B level patches be
  3964.  MB> available?  I don't see them in the file areas.
  3965.  
  3966. Although there is no set date, we hope to have them
  3967. released in about two weeks.
  3968.  
  3969.  
  3970. Kevin Kitsemetry
  3971. WATCOM TECHNICAL SUPPORT
  3972.  
  3973. *** This is a reply to #1976.  *** See also #2030.
  3974.  
  3975.  
  3976. From:    Christer Palm                          Rec'd
  3977. To:      Dan Cummins                            Msg #1981, Dec-06-93 12:15PM
  3978. Subject: WVIDEO and A level patch
  3979.  
  3980.  DC> I haven't heard of this problem.  It sounds like we would
  3981.  DC> need an example from you to reproduce it here.
  3982.  
  3983. Actually, no example is needed. I discovered later that the problem wasn't
  3984. related to AutoCAD or the program I debug, it's always there.
  3985. As I said before, it looks like WVIDEO is redefining the MDA character set or
  3986. something, horizontal lines all over the screen and reverse video.
  3987. NOTE that everything looks great until the source code pops into the window..
  3988.  
  3989. As I also said before, I have two different systems setup here, with different
  3990. brands of MDAs, and the problems are exactly the same on both systems.
  3991.  
  3992. I just tried to rename config.sys and autoexec.bat to be absolutely certain
  3993. that nothing there caused the trouble, but the problem remained. I also ran
  3994. WVIDEO 9.01e (Which I also had installed), it ran just fine, but i KNOW that
  3995. 9.5 didn't behave like that before I applied the A-level patches.
  3996.  
  3997. / Christer
  3998.  
  3999. *** This is a reply to #1941.  *** See also #1996.
  4000.  
  4001.  
  4002. From:    Christer Palm                          Rec'd
  4003. To:      Jim Ehrismann                          Msg #1982, Dec-06-93 12:37PM
  4004. Subject: Diamond Viper
  4005.  
  4006. I have encountered that problem on S3 adapters using AMIs BIOS with other
  4007. drivers. For me the problem occured when switching from HI-RES (1024x768+) to
  4008. text and then to 640x480 (i.e shelling out of Windows to run a DOS graphics
  4009. app). It seems like the BIOS doesn't reset some registers properly, this can
  4010. be fixed in software however. I suggest you guys at Watcom check this out with
  4011. S3 for a workaround on this.
  4012.  
  4013.  / Christer
  4014.  
  4015. *** This is a reply to #1971.
  4016.  
  4017.  
  4018. From:    Kevin Kitsemetry                       Rec'd
  4019. To:      Mike Brennen                           Msg #1983, Dec-06-93 02:43PM
  4020. Subject: C++32 B level patches
  4021.  
  4022.  MB> In response to 1909, when will B level patches be
  4023.  MB> available?  I don't see them in the file areas.
  4024.  
  4025. At least two more weeks.  Keep an eye on the Bulletins
  4026. when you login for the announcement.
  4027.  
  4028.  
  4029. Kevin Kitsemetry
  4030. WATCOM TECHNICAL SUPPORT
  4031.  
  4032. *** This is a reply to #1976.
  4033.  
  4034.  
  4035. From:    Nicos Skouras                          Rec'd
  4036. To:      Kevin Kitsemetry                       Msg #1984, Dec-08-93 11:27AM
  4037. Subject: W9.5a function problem
  4038.  
  4039. KK> Internal Report #12307
  4040.  
  4041.  
  4042. Please reference file STRERR.ZIP uploaded in the file area
  4043. with str.c & the result of it.
  4044. In short: the strtol () function does not recognize a hex
  4045. valua as signrd but treats it as unsigned.
  4046. Thanks
  4047. Nicos Skouras
  4048.  
  4049. *** See also #2032.
  4050.  
  4051.  
  4052. From:    Joseph Schachner
  4053. To:      Kevin Kisemetry                        Msg #1985, Dec-08-93 11:44AM
  4054. Subject: Locking for VM
  4055.  
  4056. KK> Internal Report #12313
  4057.  
  4058.  
  4059. I've followed the "Locking for VM" discussion with interest - locking the
  4060. entire code and static data segment is exactly what I want to do, to.
  4061.  
  4062. So I wrote a little test program to see if I could figure out what to lock.
  4063. The program did the following:
  4064. 1) called segread and printed out sregs.cs and sregs.ds
  4065. 2) Did DPMI function 6 to get the base address for cs and ds 3) Printed out
  4066. the address of an initialized array and an uninit'd
  4067.    variable, just by doing (for example) printf("inited is at %08X\n",
  4068.    inited );
  4069. 4) Printed out &_edata and &_end (symbols assigned in the startup file). 5)
  4070. Did DPMI function 0x0B to get the LDT entry for sregs.cs and sregs.ds.
  4071.    Printed out the seglimit field.
  4072. Note: I checked regs.x.cflag after each DPMI call, there were no errors.
  4073.  
  4074. The results were:
  4075. 1) cs was 0227 and ds was 022F, on every run.  Looks OK to me. 2) base address
  4076. reported was 0 for both cs and ds, on every run. OK. 3) "inited is at
  4077. 80A9D160" and "uninit is at 80A9D4B0"
  4078.     (Over 2G?  must be something I don't understand about these values.) 4)
  4079. "_edata is at 80A9D4B0" and "_end is at 80A9D4D4"
  4080. 5) "cs seglimit (in bytes) is 64256" and "ds seglimit (in bytes) is 62208"
  4081.     This doesn't look OK: cs seglimit > ds seglimit???  Also, I expected
  4082.     the G bit to be set (4K pages), but it wasn't.
  4083.  
  4084. I added a declaration of an array of 8192 ints, and the address of uninit and
  4085. the address of _end went up by 32768.  Perfect.  But, cs and ds's seglimits
  4086. did not change.
  4087.  
  4088. I then added a little extra code.  As I expected, the addresses of
  4089. inited,uninit, _edata and _end all went up by a a few dozen bytes.  However,cs
  4090. and ds seglimits were still unchanged.
  4091.  
  4092. Could someone explain to me what the value that got printed for &_end means?
  4093. Remember, the goal is to lock all of cs and ds.  We know they start at 0,but
  4094. they sure don't end at above 2G.  How I get from this value to a linear
  4095. address, so I can call the DPMI function to lock memory?
  4096.  
  4097. Also, here's the piece of C code from my program which gets ds's LDT and
  4098. prints its seglimit.  I welcome any corrections and comments. Note: ldtbuff is
  4099. declared unsigned int ldtbuff[2].  seglimit is unsigned.
  4100.  
  4101.     ldtbuff[0] = 0;           /* make sure value is due to assignment */
  4102.     ldtbuff[1] = 0;
  4103.     regs.w.ax = 0x0B;         /* DPMI function 0Bh: get LDT */
  4104.     regs.w.bx = sregs.ds;
  4105.     sregs.es = FP_SEG(&ldtbuff);
  4106.     regs.x.edi = FP_OFF(&ldtbuff);
  4107.     int386x( 0x31, ®s, ®s, &sregs );
  4108.     if (regs.x.cflag)
  4109.         printf("*** Get ldt failed!\n");
  4110.     seglimit = ldtbuff[0] & 0xF0000;
  4111.     seglimit += ldtbuff[1] & 0xFFFF;
  4112.     if (ldtbuff[0] & 0x800000)
  4113.     {
  4114.         printf(" Seglimit was in pages!\n");
  4115.         seglimit *= 4096;
  4116.     }
  4117.     printf("ds seglimit (in bytes) is %d\n", seglimit );
  4118.  
  4119. Thank you, WATCOM tech support, for any response.
  4120. Joe Schachner, LeCroy Corp, voice (914) 425-2000 x2282.  FAX (914) 578-5985.
  4121.  
  4122. *** See also #2029.
  4123.  
  4124.  
  4125. From:    Chris Boogmans                         Rec'd
  4126. To:      Kevin Kitsemetry                       Msg #1986, Dec-07-93 03:45AM
  4127. Subject: Warning problem in C32/9.5a
  4128.  
  4129. // Kevin, the WatCom C32 compiler version 9.5a is mistaken with regard to
  4130. // it's 'Warning! W200' messages on the code below.  It issues this warning
  4131. // on the call of WatComFunc2(), which is correct, but it issues the same
  4132. // warning on the call of MscFunc2(), i.s.o. on the call of MscFunc1().
  4133. // Since the MscFuncs are declared 'cdecl', arguments are stacked in the
  4134. // order right to left.
  4135. // It is no big deal ofcourse, but it's best if a compiler only issues
  4136. // warnings when there are any.  Regards, Chris.
  4137.  
  4138. #include <stdio.h>
  4139. #include <stdlib.h>
  4140.  
  4141. unsigned AssignValueTo(void *Variable);
  4142.  
  4143. // following 2 functions will be assumed to use WatCom calling convention :
  4144. void WatComFunc1(unsigned, void (*)(void));
  4145. void WatComFunc2(void (*)(void), unsigned);
  4146.  
  4147. // and these 2 will be assumed to use MSC calling convention :
  4148. void cdecl MscFunc1(unsigned, void (*)(void));
  4149. void cdecl MscFunc2(void (*)(void), unsigned);
  4150.  
  4151. void main(void)
  4152. {
  4153.         void (*Function1)(void);
  4154.         void (*Function2)(void);
  4155.         void (*Function3)(void);
  4156.         void (*Function4)(void);
  4157.  
  4158.         WatComFunc1(AssignValueTo(&Function1), Function1);
  4159.         WatComFunc2(Function2, AssignValueTo(&Function2));
  4160.  
  4161.         MscFunc1(AssignValueTo(&Function3), Function3);
  4162.         MscFunc2(Function4, AssignValueTo(&Function4));
  4163. }
  4164.  
  4165.  
  4166. *** See also #1987.
  4167.  
  4168.  
  4169. From:    Anthony Scian                          Rec'd
  4170. To:      Chris Boogmans                         Msg #1987, Dec-07-93 10:29AM
  4171. Subject: Warning problem in C32/9.5a
  4172.  
  4173.  CB> // Kevin, the WatCom C32 compiler version 9.5a is mistaken with regard to
  4174.  CB> // it's 'Warning! W200' messages on the code below.
  4175.  CB> It issues this warning
  4176.  CB> // on the call of WatComFunc2(), which is correct, but it issues the same
  4177.  CB> // warning on the call of MscFunc2(), i.s.o. on the call of MscFunc1().
  4178.  CB> // Since the MscFuncs are declared 'cdecl', arguments are stacked in the
  4179.  CB> // order right to left.
  4180.  CB> // It is no big deal ofcourse, but it's best if a compiler only issues
  4181.  CB> // warnings when there are any.  Regards, Chris.
  4182.  
  4183.  The arguments are being analysed by the compiler as they are being seen
  4184.  in the source file.  This is consistent behaviour.  The __cdecl attribute
  4185.  is a runtime attribute of the call, it doesn't suddenly cause the compiler
  4186.  to parse and check expressions differently.  Furthermore, there is no
  4187.  guarantee that the compiler will evaluate the expressions in *any* order
  4188.  (even for __cdecl!).  Correct portable code should not have arguments
  4189.  that depend on side-effects of other arguments being evaluated.  The warning
  4190.  is correct in that the compiler is analysing arguments in left to right
  4191.  order regardless of the calling convention.
  4192.  
  4193.  CB>
  4194.  CB> #include <stdio.h>
  4195.  CB> #include <stdlib.h>
  4196.  CB>
  4197.  CB> unsigned AssignValueTo(void *Variable);
  4198.  CB>
  4199.  CB> // following 2 functions will be assumed to use WatCom
  4200.  CB> calling convention :
  4201.  CB> void WatComFunc1(unsigned, void (*)(void));
  4202.  CB> void WatComFunc2(void (*)(void), unsigned);
  4203.  CB>
  4204.  CB> // and these 2 will be assumed to use MSC calling convention :
  4205.  CB> void cdecl MscFunc1(unsigned, void (*)(void));
  4206.  CB> void cdecl MscFunc2(void (*)(void), unsigned);
  4207.  CB>
  4208.  CB> void main(void)
  4209.  CB> {
  4210.  CB>         void (*Function1)(void);
  4211.  CB>         void (*Function2)(void);
  4212.  CB>         void (*Function3)(void);
  4213.  CB>         void (*Function4)(void);
  4214.  CB>
  4215.  CB>         WatComFunc1(AssignValueTo(&Function1), Function1);
  4216.  CB>         WatComFunc2(Function2, AssignValueTo(&Function2));
  4217.  CB>
  4218.  CB>         MscFunc1(AssignValueTo(&Function3), Function3);
  4219.  CB>         MscFunc2(Function4, AssignValueTo(&Function4));
  4220.  CB> }
  4221.  CB>
  4222.  
  4223. *** This is a reply to #1986.
  4224.  
  4225.  
  4226. From:    Kevin Blenkinsopp                      Rec'd
  4227. To:      Kevin Kitsemetry                       Msg #1990, Dec-07-93 02:03PM
  4228. Subject: Diamond Viper
  4229.  
  4230. Kevin,
  4231.  
  4232. I've been doing some work with the Viper board for a while: what you need to
  4233. do is get a hold of Craig Rush at Diamond (he's in charge of third-party
  4234. stuff) and see what help he can give you. Diamond will release technical specs
  4235. and sample code to you, but only under a non-disclosure agreement.
  4236.  
  4237. Kevin
  4238.  
  4239. *** This is a reply to #1978.  *** See also #1998.
  4240.  
  4241.  
  4242. From:    Hal Schwab
  4243. To:      Tech Support                           Msg #1991, Dec-07-93 02:15PM
  4244. Subject: _dos_setvect in protect mode.
  4245.  
  4246. I am porting some real mode code to protect mode with the 9.5 compiler.
  4247. I am currently using the borland setvect() to set the address of my
  4248. isrs. Does the Watcom _dos_setvect() set the real and protect mode vectors ?
  4249.  
  4250. *** See also #1999.
  4251.  
  4252.  
  4253. From:    Jason Fesler
  4254. To:      All                                    Msg #1992, Dec-07-93 05:42PM
  4255. Subject: Video mode switch time?
  4256.  
  4257. Does anyone know why the following code fragment takes one and a half
  4258. seconds under Rational Systems's extender?  Is it because of the extender,
  4259. the compiler, or my source code (g)?
  4260.  
  4261.  ..
  4262. _setvideomode(_TEXTC80);
  4263. _settextrows(_MAXTEXTROWS);
  4264.  ..
  4265.  
  4266. Also, has anyone had any luck running fossil communications drivers while
  4267. in protected mode?  Or, does anyone have a pointer to interrupt-driven
  4268. serial port communications?
  4269.  
  4270. Thanks!
  4271.  
  4272.  
  4273.  
  4274. ... Two most common elements in the universe: Hydrogen & Stupidity.
  4275. ___ Blue Wave/QWK v2.12
  4276.  
  4277. *** See also #2000.
  4278.  
  4279.  
  4280. From:    Chris Boogmans                         Rec'd
  4281. To:      Kevin Kitsemetry                       Msg #1993, Dec-08-93 11:57AM
  4282. Subject: _scrolltextwindow
  4283.  
  4284. Kevin,
  4285. the function call _scrolltextwindow(_GSCROLLUP) runs 4 to 5 times slower under
  4286. version 9.5 (level a) than under version 9.01 (level d and e).  For detailed
  4287. info about the selected video mode, pls see the sources. The following things
  4288. have no influence on this difference : - wether you'r in a Windows DOS box or
  4289. in DOS itself
  4290. - the DOS4GW version
  4291. - VMM or not
  4292. - the drivers and/or TSR you've loaded
  4293. - the PC you run it on (tried on an Intel, a Compaq, an Acer & a white product)
  4294. I uploaded a file called 'SCROLL.ZIP' which contains a very simple example of
  4295. it.  Try running it under version 9.5a, but be sure you have enough coffee at
  4296. hand !  Could you guys please have a look at it, cuz it just is too slow ...
  4297. Thanks, Chris.
  4298.  
  4299. *** See also #2001.
  4300.  
  4301.  
  4302. From:    Kevin Kitsemetry                       Rec'd
  4303. To:      Kevin Blenkinsopp                      Msg #1994, Dec-08-93 10:23AM
  4304. Subject: More real mode stuff
  4305.  
  4306. KK> Internal Report #11809
  4307.  
  4308. I only looked at it briefly, but if the interrupt is returning a real mode
  4309. address in ES:DI, you need to convert it to a protected mode address, which
  4310. will be given by CS:((ES << 4) + DI) -- convert the real mode segment in ES to
  4311. a linear address, add the offset, then the linear address is equivalent to a
  4312. near pointer.
  4313.  
  4314. Note that having a protected mode function pointer and being able to CALL the
  4315. pointer are two different things.  The function has to be able to run in
  4316. protected mode; it has to understand the WATCOM 386 calling conventions; it
  4317. has to do the appropriate kind of return.  In general, you CAN'T call a real
  4318. mode function from a DOS/4GW application -- you'd have to write your own real
  4319. mode code to call the function, install your code as a real mode interrupt
  4320. handler, and signal a real mode interrupt.  You'd probably want to use your
  4321. own buffer in low memory to stash parameters that the real mode function
  4322. needed.
  4323.  
  4324. *** This is a reply to #1967.
  4325.  
  4326.  
  4327. From:    Christer Palm                          Rec'd
  4328. To:      Dan Cummins                            Msg #1996, Dec-08-93 12:03PM
  4329. Subject: WVIDEO and A level patch
  4330.  
  4331.  CP> As I said before, it looks like WVIDEO is redefining
  4332.  CP> the MDA character set or something, horizontal lines
  4333.  CP> all over the screen and reverse video.
  4334.  
  4335. Perhaps I should make myself even a bit more clear about this.. Actually the
  4336. horizontal lines are not really all over the screen, only on the characters
  4337. making up the window frame. It came to my mind that this has to be WVIDEO
  4338. writing the wrong attributes, causing the window frame characters to be
  4339. underlined, and the area inside the windows to be reverse video. I recall that
  4340. the colors cand be redefined, this might be a workaround ?? Anyway, it still
  4341. behaves differently than before I applied the B-patch, and it certainly
  4342. doesn't behave they way I want it.
  4343.  
  4344.  / Christer
  4345.  
  4346. *** This is a reply to #1981.
  4347.  
  4348.  
  4349. From:    Kevin Kitsemetry                       Rec'd
  4350. To:      Kevin Blenkinsopp                      Msg #1998, Dec-08-93 11:51AM
  4351. Subject: Diamond Viper
  4352.  
  4353.  KB> Kevin,
  4354.  
  4355.  KB> I've been doing some work with the Viper board for a
  4356.  KB> while: what you need to do is get a hold of Craig Rush
  4357.  KB> at Diamond (he's in charge of third-party stuff) and
  4358.  KB> see what help he can give you. Diamond will release
  4359.  KB> technical specs and sample code to you, but only under
  4360.  KB> a non-disclosure agreement.
  4361.  
  4362. Thanks for the info.  We are working on this issue, and
  4363. getting the necessary information to support this card.
  4364.  
  4365.  
  4366. Kevin Kitsemetry
  4367. WATCOM TECHNICAL SUPPORT
  4368.  
  4369. *** This is a reply to #1990.
  4370.  
  4371.  
  4372. From:    Kevin Kitsemetry
  4373. To:      Hal Schwab                             Msg #1999, Dec-08-93 11:52AM
  4374. Subject: _dos_setvect in protect mode.
  4375.  
  4376.  HS> I am porting some real mode code to protect mode with the 9.5 compiler.
  4377.  HS> I am currently using the borland setvect() to set the address of my
  4378.  HS> isrs. Does the Watcom _dos_setvect() set the real and
  4379.  HS> protect mode vectors ?
  4380.  
  4381. It does, as long as it is in the autopassup range.  See the User's Guide for
  4382. details.
  4383.  
  4384.  
  4385. Kevin Kitsemetry
  4386. WATCOM TECHNICAL SUPPORT
  4387.  
  4388. *** This is a reply to #1991.
  4389.  
  4390.  
  4391. From:    Kevin Kitsemetry                       Rec'd
  4392. To:      Jason Fesler                           Msg #2000, Dec-08-93 11:55AM
  4393. Subject: Video mode switch time?
  4394.  
  4395.  JF> Does anyone know why the following code fragment takes one and a half
  4396.  JF> seconds under Rational Systems's extender?  Is it
  4397.  JF> because of the extender,
  4398.  JF> the compiler, or my source code (g)?
  4399.  
  4400.  JF>  ..
  4401.  JF> _setvideomode(_TEXTC80);
  4402.  JF> _settextrows(_MAXTEXTROWS);
  4403.  JF>  ..
  4404.  
  4405. Most likely, it has to do with the switching between protected mode and real
  4406. mode DOS during the interrupt.  Are you implying that it is faster with other
  4407. extenders?
  4408.  
  4409.  
  4410. Kevin Kitsemetry
  4411. WATCOM TECHNICAL SUPPORT
  4412.  
  4413. *** This is a reply to #1992.
  4414.  
  4415.  
  4416. From:    Kevin Kitsemetry                       Rec'd
  4417. To:      Chris Boogmans                         Msg #2001, Dec-08-93 11:59AM
  4418. Subject: _scrolltextwindow
  4419.  
  4420.  CB> I uploaded a file called 'SCROLL.ZIP' which contains a
  4421.  CB> very simple example of it.  Try running it under
  4422.  CB> version 9.5a, but be sure you have enough coffee at
  4423.  
  4424. I could not find this file on our system.  Did you upload
  4425. it?  We do not have any record of it being uploaded.
  4426.  
  4427.  
  4428. Kevin Kitsemetry
  4429. WATCOM TECHNICAL SUPPORT
  4430.  
  4431. *** This is a reply to #1993.  *** See also #2006.
  4432.  
  4433.  
  4434. From:    Tom Makowski
  4435. To:      Tech Support                           Msg #2002, Dec-09-93 10:02AM
  4436. Subject: AllocHugeAlias16 Problem
  4437.  
  4438. KK> Internal Report #12413
  4439.  
  4440.  
  4441. Our 32bit Windows application, in order to save time, caches 16:16 pointer
  4442. aliases to 32bit pointers which are then passed to a 16bit DLL. We were using
  4443. the AllocHugeAlias16() function to create the 16:16 pointers until a bug was
  4444. discovered in it when large buffers (~1Mbyte) were aliased. A patch for the
  4445. compiler came to late to get in the release.
  4446.  
  4447. To fix this, we created our own 16:16 alias using DPMI calls.  The problem is
  4448. that the linear base address of the 32bit pointers appears to change under
  4449. certain circumstances (mallocs?) causing our 16:16 alias to become invalid
  4450. causing Page Faults or corrupting memory.  The 16:16 aliases created by the
  4451. AllocHugeAlias16() get their linear base addresses correctly updated when the
  4452. 16:32bit pointers base address changes.
  4453.  
  4454. I know the current version of the AllocHugeAlias16() function has been fixed
  4455. in the current version of the compiler, but we are trying to get a patch out
  4456. to our current customers.  So, is there some other function we can call to
  4457. prevent the linear base address from changing on the 16:32 pointer.  Or is
  4458. there some way to get our 16:16 alias to be updated when the base address of
  4459. the 16:32 pointer changes?
  4460.  
  4461.        Thanks. Tom
  4462.  
  4463. *** See also #2008.
  4464.  
  4465.  
  4466. From:    Christer Palm                          Rec'd
  4467. To:      Kevin Kitsemetry                       Msg #2003, Dec-08-93 01:12PM
  4468. Subject: Serious bug in stream I/O
  4469.  
  4470. In my work with a binary file I/O class, based on fstream, I encountered
  4471. some very strange bugs.  After about 2 days of debugging I began to
  4472. suspect that there was something wrong with the stream I/O.
  4473.  
  4474. I put together some very small test programs; mktest.cpp, which creates a
  4475. 90000 bytes long file filled entierly with 0xaa's - test.cpp which tries
  4476. to read that file and display its contents to the screen - and test.c which
  4477. does the same thing in plain C.
  4478.  
  4479. Sometimes, when I run test (I often have to run it about 10-30 times),
  4480. strange things happens. Typical sympthoms are lost characters, total
  4481. hangup, exception throws (C++), general protection faults or failure
  4482. to detect EOF. The plain C version seems to crash more seldom though.
  4483.  
  4484. To test wheather DOS4GW is the problem, I compiled test.c/test.cpp with
  4485. Borland C and also with WATCOM linking for PharLap. Both seemed to work
  4486. fine, so the problem is probably with DOS4GW although, because of the
  4487. intermittent nature of the problem, cannot tell 100%.
  4488.  
  4489.  / Christer
  4490.  
  4491. // C/C++32 9.5a
  4492. // Compile & link: wcl386 [-cc++] [-l=pharlap] [*.c|*.cpp]
  4493.  
  4494. // mktest.cpp:
  4495. // -----------
  4496. #include <fstream.h>
  4497.  
  4498. void main( void )
  4499. {
  4500.   ofstream Stream;
  4501.  
  4502.   Stream.open( "test.dat", Stream.out | Stream.binary );
  4503.   for( int n = 0; n < 90000; n++ )
  4504.     Stream.put( (unsigned char)0xaa );
  4505.   Stream.close();
  4506. }
  4507.  
  4508. // test.cpp:
  4509. // ---------
  4510. #include <fstream.h>
  4511.  
  4512. void main( void )
  4513. {
  4514.   ifstream Stream;
  4515.  
  4516.   Stream.open( "test.dat", Stream.in | Stream.binary | Stream.nocreate );
  4517.   while( !Stream.eof())
  4518.     cout << hex << Stream.get();
  4519.   Stream.close();
  4520. }
  4521.  
  4522. /* test.c: */
  4523. /* ------- */
  4524. #include <stdio.h>
  4525.  
  4526. void main( void )
  4527. {
  4528.   FILE *fp = fopen( "test.dat", "rb" );
  4529.  
  4530.   while( !feof( fp ))
  4531.     printf( "%x", getc( fp ));
  4532.   close( fp );
  4533. }
  4534.  
  4535. *** See also #2022.
  4536.  
  4537.  
  4538. From:    Denis Dyack
  4539. To:      All                                    Msg #2004, Dec-08-93 02:47PM
  4540. Subject: Net Bios Help
  4541.  
  4542. Hello,
  4543.  
  4544. Has anyone out there done some net bios code.  If so you please point me
  4545. in the direction of a good book and perhaps some sample source.
  4546.  
  4547. All I really need to do is establish a connection between two
  4548. nodes and pass some info back and forth.
  4549.  
  4550. Another question as well:
  4551.  
  4552. I decided to use net bios so I can support both lantastic and novell.
  4553. Was this a good choice?
  4554.  
  4555. Thanks, Denis.
  4556.  
  4557. *** See also #2019.
  4558.  
  4559.  
  4560. From:    John Miles
  4561. To:      Jerry Rice                             Msg #2005, Dec-09-93 12:17AM
  4562. Subject: Diamond Viper
  4563.  
  4564. Newer Diamond Vipers use the Weitek 9XXX chipset, which may be identified
  4565. as an older 5186 chip.  Needless to say, there's no backward-compatibility
  4566. mode (at least not one that comes up automatically), so
  4567. older 5186 code is liable to fail.
  4568.  
  4569. The chip is supposedly hot under Windows, but, as has become a custom
  4570. among narrow-minded, market-ignorant chipset makers, it's a dog under
  4571. DOS.  You will never notice a significant speed increase for chipset
  4572. access with this card vis-a-vis VESA, unless the code is poorly
  4573. structured enough to perform repeated, redundant, or misplaced bank
  4574. access.  There's no point writing chip-specific drivers, due to the
  4575. disposable, chip-of-the-week design mentality that currently holds sway
  4576. over the market.
  4577.  
  4578. Of course, by the time you read this, the Viper cards will probably be
  4579. using a different chipset that does happen to work with an older
  4580. driver..... :)
  4581.  
  4582. -- john
  4583.  
  4584. *** This is a reply to #1972.
  4585.  
  4586.  
  4587. From:    Chris Boogmans                         Rec'd
  4588. To:      Kevin Kitsemetry                       Msg #2006, Dec-09-93 03:08AM
  4589. Subject: _scrolltextwindow
  4590.  
  4591. Now, i indeed forgot to upload it.  I'll do that now.
  4592. Thanks.
  4593.  
  4594. *** This is a reply to #2001.  *** See also #2007.
  4595.  
  4596.  
  4597. From:    Kevin Kitsemetry                       Rec'd
  4598. To:      Chris Boogmans                         Msg #2007, Dec-09-93 10:18AM
  4599. Subject: _scrolltextwindow
  4600.  
  4601.  CB> Now, i indeed forgot to upload it.  I'll do that now.
  4602.  CB> Thanks.
  4603.  
  4604. I have reproduced the problem and will have to investigate
  4605. further.  This is incident report #12416.
  4606.  
  4607.  
  4608. Kevin Kitsemetry
  4609. WATCOM TECHNICAL SUPPORT
  4610.  
  4611. *** This is a reply to #2006.  *** See also #2009.
  4612.  
  4613.  
  4614. From:    Julian Ayling                          Rec'd
  4615. To:      Kevin Kitsemetry                       Msg #2009, Dec-09-93 11:51AM
  4616. Subject: _scrolltextwindow
  4617.  
  4618.  
  4619. *** This is a reply to #2007.
  4620.  
  4621.  
  4622. From:    Donald Macmillan                       Rec'd
  4623. To:      Kevin Kitsemetry                       Msg #2010, Dec-09-93 04:17PM
  4624. Subject: DDE, WATCOM 9.5, PENTIUM, WINDOWS 3.1
  4625.  
  4626. Over the last two years we have developed a large (25K lines) C programme
  4627. using the Rational DOS Extender. It works and all is well.
  4628. Now, I wish to link it to a Windows 3.1 application running under
  4629. OS/2 2.1
  4630. Is there Watcom expertize in this area? ie a routine to add DDE capability to
  4631. my former DOS programme. More than likely, I will recompile my software with
  4632. the OS2 switch...but I am still concerned with the DDE link.
  4633.  
  4634. *** See also #2013.
  4635.  
  4636.  
  4637. From:    Kevin Kitsemetry                       Rec'd
  4638. To:      Donald Macmillan                       Msg #2013, Dec-10-93 10:41AM
  4639. Subject: DDE, WATCOM 9.5, PENTIUM, WINDOWS 3.1
  4640.  
  4641.  DM> Now, I wish to link it to a Windows 3.1 application running under
  4642.  DM> OS/2 2.1
  4643.  DM> Is there Watcom expertize in this area? ie a routine
  4644.  DM> to add DDE capability to my former DOS programme. More
  4645.  DM> than likely, I will recompile my software with the OS2
  4646.  DM> switch...but I am still concerned with the DDE link.
  4647.  
  4648. Using version 9.5, you should recompile the source with the appropriate /bt
  4649. option.  You can link the programme for OS2V2 or WIN386 and (unless you have
  4650. any DOS specific calls, ie. to graphics routines) then it should work for you.
  4651.  We provide a default Windowing system for Windows 3.x which will create stdin
  4652. and stdout Windows for you.  Under OS/2,the application will run in text mode,
  4653. unless you convert it to a PM application.
  4654.  
  4655.  
  4656. Kevin Kitsemetry
  4657. WATCOM TECHNICAL SUPPORT
  4658.  
  4659. *** This is a reply to #2010.
  4660.  
  4661.  
  4662. From:    Tj Bandrowsky
  4663. To:      Jerry Rice                             Msg #2017, Dec-11-93 07:42PM
  4664. Subject: Watcom C32 for Dos
  4665.  
  4666. Is it possible to generate a list of chipsets by looking at the functions
  4667. in the graphics library?  I am new to this watcom world, and am trying
  4668. to port a video game that uses an undocumented svga mode to watcom.
  4669. During a furious session, I noticed there are a set of functions:
  4670. pagetseng3_  pagetseng4 that seem to deal with a bank select issue that tends
  4671. to vary from card to card.  The drivers seem to deal with chipsets,
  4672. not cards, so am I right in guessing that whether or not a card is
  4673. supported is a watcom customer service issue and not a graphics driver
  4674. issue.
  4675.  
  4676. *** This is a reply to #1324.  *** See also #2020.
  4677.  
  4678.  
  4679. From:    Tj Bandrowsky
  4680. To:      Chris Guerra                           Msg #2018, Dec-13-93 10:07AM
  4681. Subject: re: hires video modes
  4682.  
  4683. KK> Internal Report #12628
  4684.  
  4685.  
  4686. Chris,
  4687. In my wanderings, and for the benefit of everyone who is looking and not
  4688. finding the file mentioned in Dan's message, I stumbled accidently,and
  4689. certainly not in violation of my license, a set of functions in the graphics
  4690. library for 9.5 c/c++ 32 that seem to do this switching.
  4691.  
  4692. They are in the form pageXXXX where XXXX seems to be the name of the chipset
  4693. manufacturer.  Egs pageTseng3_ pageTseng4_ etc.
  4694.  
  4695. Now, is there any chance Watcom could cobble together some sort of docs for
  4696. these things and post them for those of us such as myself that need to do
  4697. custom blits...
  4698.  
  4699. OR, if you could stick these three functions in your next patch set...
  4700. blitPixelsThatDontMatchColor()
  4701. blit32()
  4702. Get32()
  4703. All of which work in pixels and obey no mapping modes or other such things
  4704. that would detract from shareware video game development glory.
  4705.  
  4706. I have the functions, and have the bank select for trident, but all those
  4707. folks out there I'm sure would appreciate the ability to use all of those
  4708. sweet card details already handled by your library.  I know such low calling
  4709. make it hard to make sweeping changes, but this functionality is a key to a
  4710. lot of interesting vga stuff.
  4711.  
  4712. Help us Obi Watcomenobi, your our only hope.
  4713.  
  4714. *** This is a reply to #851.  *** See also #2023.
  4715.  
  4716.  
  4717. From:    Chris Boogmans
  4718. To:      Denis Dyack                            Msg #2019, Dec-13-93 03:42AM
  4719. Subject: Net Bios Help
  4720.  
  4721. Denis,
  4722. i have indeed done some NetBIOS programming.  That was under 16 bit DOS, the
  4723. port to WatCom C + DOS/4GW will follow mid 1994.  Regarding your questions :
  4724. 1- since NetBIOS is a standard, i think it's certainly not a bad choice; i
  4725.    chose it for the same reason.
  4726. 2- (in my opinion) a very good reference work regarding the various network
  4727.    interfaces (including NetBIOS) is the 'LanSmart Programmer's Reference',
  4728.    from D-Link.  But it may be possible that it is not for sale separately,
  4729.    (bundled with their SDK), and it is a reference work, NOT a tutorial.
  4730.    There doesn't seem to exist a LanTastic equivalent, and moreover, Artisoft
  4731.    does not officially provide customer support for NetBIOS programming (but i
  4732.    faxed them twice, and on both occasions they gave me immediate & accurate
  4733.    answers anyway, including the remark that they officially don't do that).
  4734.    A work that i do NOT like, is 'Inside NetBIOS'.  It tells less (technical)
  4735.    details about more things.
  4736. 3- if you plan to exchange messages between network stations, try to group the
  4737.    messages if possible.  During my tests, i experienced that sending short
  4738.    frames took a good part off the throughput.
  4739. Best regards, Chris.
  4740.  
  4741. *** This is a reply to #2004.
  4742.  
  4743.  
  4744. From:    Kevin Kitsemetry
  4745. To:      Tj Bandrowsky                          Msg #2020, Dec-13-93 10:02AM
  4746. Subject: Watcom C32 for Dos
  4747.  
  4748.  TB> Is it possible to generate a list of chipsets by looking at the functions
  4749.  TB> in the graphics library?  I am new to this watcom world, and am trying
  4750.  TB> to port a video game that uses an undocumented svga mode to watcom.
  4751.  TB> During a furious session, I noticed there are a set of functions:
  4752.  TB> pagetseng3_  pagetseng4 that seem to deal with a bank
  4753.  TB> select issue that tends
  4754.  TB> to vary from card to card.  The drivers seem to deal with chipsets,
  4755.  TB> not cards, so am I right in guessing that whether or not a card is
  4756.  TB> supported is a watcom customer service issue and not a graphics driver
  4757.  TB> issue.
  4758.  
  4759. Take a look at the VGAINFO.C program in the General File area.  This should
  4760. give you what you are looking for.
  4761.  
  4762.  
  4763. Kevin Kitsemetry
  4764. WATCOM TECHNICAL SUPPORT
  4765.  
  4766. *** This is a reply to #2017.
  4767.  
  4768.  
  4769. From:    Mike Brennen
  4770. To:      Tech Support                           Msg #2021, Dec-13-93 10:15AM
  4771. Subject: 9.5 b patches
  4772.  
  4773. I'm probably one of many wondering when the B patches will be out; until they
  4774. come out wildargv won't compile...
  4775.  
  4776. *** See also #2025.
  4777.  
  4778.  
  4779. From:    Kevin Blenkinsopp
  4780. To:      Christer Palm                          Msg #2022, Dec-13-93 11:38AM
  4781. Subject: Serious bug in stream I/O
  4782.  
  4783. I think that it's a problem with fread etc, not the stream stuff - see other
  4784. recent mail for details.
  4785.  
  4786.  
  4787. *** This is a reply to #2003.
  4788.  
  4789.  
  4790. From:    Kevin Blenkinsopp
  4791. To:      Tj Bandrowsky                          Msg #2023, Dec-13-93 12:41PM
  4792. Subject: re: hires video modes
  4793.  
  4794. VESA 2.0 - It's great. Call them at 408 435 0333 for the specs.
  4795.  
  4796.  
  4797. *** This is a reply to #2018.
  4798.  
  4799.  
  4800. From:    Garry Taylor
  4801. To:      All                                    Msg #2024, Dec-13-93 02:32PM
  4802. Subject: Calling 16 bit TSR from 32 bit Dos C++
  4803.  
  4804. Hi,
  4805.    I am trying to make calls to the driver for my sound card (SBFMDRV.COM)
  4806. from a C program, but am having little luck.  The sample program I have seems
  4807. to work okay when compile with my old Turbo C compiler, and I thought I had
  4808. made appropriate conversions, as suggested by the FAQ that comes with the
  4809. compiler, for calling real mode interrupts from Watcom C++, but so far the
  4810. most I can say is that my program doesn't crash.  If anyone out there could
  4811. offer me some hints, suggestions, or even sample code of some sort, I would be
  4812. most grateful!
  4813.  
  4814.                             Thanks,
  4815.                              Garry
  4816.  
  4817. *** See also #2026.
  4818.  
  4819.  
  4820. From:    Kevin Kitsemetry
  4821. To:      Mike Brennen                           Msg #2025, Dec-13-93 03:12PM
  4822. Subject: 9.5 b patches
  4823.  
  4824.  MB> I'm probably one of many wondering when the B patches
  4825.  MB> will be out; until they come out wildargv won't
  4826.  MB> compile...
  4827.  
  4828. We are testing them now.  I will let you know when they are available by
  4829. placing a bulletin when you first loggon.
  4830.  
  4831.  
  4832. Kevin Kitsemetry
  4833. WATCOM TECHNICAL SUPPORT
  4834.  
  4835. *** This is a reply to #2021.
  4836.  
  4837.  
  4838. From:    Kevin Kitsemetry
  4839. To:      Garry Taylor                           Msg #2026, Dec-13-93 03:14PM
  4840. Subject: Calling 16 bit TSR from 32 bit Dos C++
  4841.  
  4842.  GT> Hi,
  4843.  GT>    I am trying to make calls to the driver for my sound card
  4844.  GT> (SBFMDRV.COM) from a C program, but am having little
  4845.  GT> luck.  The sample program I have seems to work okay
  4846.  GT> when compile with my old Turbo C compiler, and I
  4847.  GT> thought I had made appropriate conversions, as
  4848.  GT> suggested by the FAQ that comes with the compiler, for
  4849.  GT> calling real mode interrupts from Watcom C++, but so
  4850.  GT> far the most I can say is that my program doesn't
  4851.  GT> crash.  If anyone out there could offer me some hints,
  4852.  GT> suggestions, or even sample code of some sort, I would
  4853.  GT> be most grateful!
  4854.  
  4855. Did you at least get the example program working, using
  4856. DPMI function 300h?  What other problems are you running
  4857. into?
  4858.  
  4859.  
  4860. Kevin Kitsemetry
  4861. WATCOM TECHNICAL SUPPORT
  4862.  
  4863. *** This is a reply to #2024.
  4864.  
  4865.  
  4866. From:    Kevin Kitsemetry
  4867. To:      Tj Bandrowsky                          Msg #2027, Dec-13-93 03:47PM
  4868. Subject: re: hires video modes
  4869.  
  4870. KK> Internal Report #12628
  4871.  
  4872.  
  4873.  TB> They are in the form pageXXXX where XXXX seems to be
  4874.  TB> the name of the chipset manufacturer.  Egs pageTseng3_
  4875.  TB> pageTseng4_ etc.
  4876.  
  4877.  TB> Now, is there any chance Watcom could cobble together
  4878.  TB> some sort of docs for these things and post them for
  4879.  TB> those of us such as myself that need to do custom
  4880.  TB> blits...
  4881.  
  4882.  TB> OR, if you could stick these three functions in your
  4883.  TB> next patch set... blitPixelsThatDontMatchColor()
  4884.  TB> blit32()
  4885.  TB> Get32()
  4886.  
  4887. The _PageXXXX functions could be called directly, but this
  4888. is not their intended use. Some of the information in these functions came
  4889. from the following books:
  4890.  
  4891.     Advanced Programmer's Guide to SuperVGAs (by Sutty and Blair)
  4892.     Programmer's Guide to the EGA and VGA Cards, Second Edition (by Ferraro)
  4893.  
  4894. There currently are no plans to document these functions, or to add the
  4895. functions you mentioned, at this time.
  4896.  
  4897. Kevin Kitsemetry
  4898. WATCOM TECHNICAL SUPPORT
  4899.  
  4900. *** This is a reply to #2018.
  4901.  
  4902.  
  4903. From:    Nancy Zentner                          Rec'd
  4904. To:      Dan Cummins                            Msg #2028, Dec-13-93 07:14PM
  4905. Subject: linker bug report
  4906.  
  4907. I am uploading a file "12711.zip" with a linker bug report example.
  4908. I am going to try to upload it into area 12
  4909.  
  4910.  
  4911. From:    Joseph Schachner
  4912. To:      All                                    Msg #2029, Dec-14-93 11:23AM
  4913. Subject: Locking for VM - msg 1985
  4914.  
  4915. Since no answer to message 1985 has appeared here, I'll answer my own message!
  4916. First of all: There were several errors in the code I included in message
  4917. 1985.  I misunderstood the order of bytes in the descriptor,and I neglected to
  4918. fill in 1's when I multiplied by 4096.  When corrected,both code and data
  4919. segments have base of 0 and seglimit of 4 Gigabytes.
  4920.  
  4921. All that is really irrelevant, however.  What I wanted to do was lock all of
  4922. the code and data segment into physical memory, and I was concerned that &_end
  4923. was larger than I expected.  I sent this question to Rational Systems,and got
  4924. back a fax containing a demo program showing how to lock all of code and data,
  4925. which I have duplicated below.
  4926.  
  4927. The cover page said, "It's easier than you think..."  To make a long story
  4928. short, Rational makes sure they know the first and last labels in the code
  4929. segment, and the first label in the data segment.  They use &_end (defined in
  4930. the startup file) for the end of the data segment. WATCOM tech support
  4931. verified that CODE and DATA segments are contiguous in linear address space,so
  4932. I believe locking from &___begtext to &_end will lock all the code and data;
  4933. in that case it's not necessary to make dummy labels.  And the very large
  4934. values are fine: it's the difference that counts.  (These symbols are defined
  4935. in the startup file,and can be referenced even though they don't appear in the
  4936. .MAP file, as shown below).  Now, here's Rational System's demo program:
  4937.  
  4938. /*
  4939.     LOCK.C - The following program demonstrates how to determine where
  4940.     the code and data segments have been loaded in memory, which you
  4941.     may need to know in order to lock various pieces.
  4942. */
  4943. #include <stdio.h>
  4944. #include <dos.h>
  4945. #include <i86.h>
  4946.  
  4947. /*
  4948.     The basic problem is to figure out, at run time, where the code and
  4949.     data objects have been loaded.  Code is generally in link object 1, data
  4950.     in object 2.
  4951.  
  4952.     WATCOM provides several convenient symbols for locating different
  4953.     types of data in memory.  However, you must provide some of your
  4954.     own labels to get the complete picture.  Use your link map to make
  4955.     sure your labels correctly mark the beginning and end of code
  4956.     and data.
  4957.  
  4958.     Link address        Memory
  4959.  
  4960.                 +-------+
  4961.                 | HEAP  |
  4962.     _STACKTOP    +-------+
  4963.                 | STACK |
  4964.     _end         +-------+
  4965.                 | BSS   |
  4966.     _edata       +-------+
  4967.                 | DATA  |
  4968.     2:0         +-------+
  4969.  
  4970.     1:?         +-------+
  4971.                 | CODE  |
  4972.     1:0         +-------+
  4973. */
  4974.  
  4975. char begdata = 0;               /* Label for start of inited data */
  4976.                         /* (link this datum at 2:0) */
  4977. extern char _edata;             /* Label for end of DATA */ extern char _end;
  4978.               /* Label for end of BSS */
  4979. extern INT _STACKTOP;           /* Label for end of STACK */
  4980.  
  4981. void begcode (void)             /* Label for start of code */
  4982.     {                   /* (link this function at 1:0) */
  4983.     }
  4984. void endcode (void);            /* Forward reference */
  4985.  
  4986. int lock_region (void *address, unsigned length)
  4987.     {
  4988.     union REGS regs;
  4989.     unsigned linear;
  4990.  
  4991.     printf ("Locking %u bytes at %p: ", length, address);
  4992.     linear = (unsigned) address;
  4993.  
  4994.     regs.w.ax = 0x600;          /* DPMI Lock Linear Region */
  4995.     regs.w.bx = (linear >> 16);  /* Linear address in BX:CX */
  4996.     regs.w.cx = (linear & 0xFFFF);
  4997.     regs.w.si = (length >> 16);         /* Length in SI:DI */
  4998.     regs.w.cx = (length & 0xFFFF);
  4999.     int386 (0x31, ®s, ®s);
  5000.  
  5001.     if (regs.w.cflag)
  5002.         {
  5003.         printf ("FAILED\n");
  5004.         return(0);
  5005.         }
  5006.     else
  5007.         {
  5008.         printf ("succeeded\n");
  5009.         return(1);
  5010.         }
  5011.     }
  5012.  
  5013. void main (void)
  5014.     {
  5015.     static char somedata[100] = { 0 };
  5016.  
  5017.     printf ("Memory map:\n");
  5018.     printf ("CODE           %p\n", begcode);
  5019.     printf ("            to %p\n", endcode);
  5020.     printf ("DATA           %p\n", &begdata);
  5021.     printf ("            to %p\n", &_edata);
  5022.     printf ("BSS         to %p\n", &_end);
  5023.     printf ("STACK       to %p\n", _STACKTOP);
  5024.     printf ("HEAP begins at %p\n\n", malloc (1));
  5025.  
  5026.     lock_region ((void *) &begdata, &_end - &begdata);
  5027.     lock_region ((void *) &begcode, (char *) endcode - (char *) begcode);
  5028.     }
  5029.  
  5030. void endcode (void)             /* Label for end of code */
  5031.     {                   /* (link at end of code segment) */
  5032.     }
  5033.  
  5034. /* end */
  5035.  
  5036.  
  5037. From:    Ron Smith                              Rec'd
  5038. To:      Kevin Kitsemetry                       Msg #2030, Dec-14-93 08:17AM
  5039. Subject: C++32 B level patches
  5040.  
  5041. We were told almost a month ago that the B-Level patches would be available in
  5042. two weeks!!!  We are in desperate need of one of thoses patches.  Your
  5043. compiler is generating bogus code and the linker is broken too (as of the A-
  5044. Level patches).  Can someone give me a straight answer???
  5045.  
  5046. *** This is a reply to #1980.  *** See also #2031.
  5047.  
  5048.  
  5049. From:    Kevin Kitsemetry
  5050. To:      Ron Smith                              Msg #2031, Dec-14-93 11:23AM
  5051. Subject: C++32 B level patches
  5052.  
  5053.  RS> We were told almost a month ago that the B-Level
  5054.  RS> patches would be available in two weeks!!!  We are in
  5055.  RS> desperate need of one of thoses patches.  Your
  5056.  RS> compiler is generating bogus code and the linker is
  5057.  RS> broken too (as of the A-Level patches).  Can someone
  5058.  RS> give me a straight answer???
  5059.  
  5060. We are testing the patches right now.  When they become
  5061. available, there will be a message placed in the bulletins
  5062. when you loggon.
  5063.  
  5064. We could have released them a week ago, but QA testing found problems that we
  5065. felt were best resolved before they are
  5066. released.
  5067.  
  5068.  
  5069. Kevin Kitsemetry
  5070. WATCOM TECHNICAL SUPPORT
  5071.  
  5072. *** This is a reply to #2030.
  5073.  
  5074.  
  5075. From:    Kevin Kitsemetry
  5076. To:      Nicos Skouras                          Msg #2032, Dec-14-93 12:10PM
  5077. Subject: W9.5a function problem
  5078.  
  5079. KK> Internal Report #12307
  5080.  
  5081.  
  5082.  NS> Please reference file STRERR.ZIP uploaded in the file area
  5083.  NS> with str.c & the result of it.
  5084.  NS> In short: the strtol () function does not recognize a hex
  5085.  NS> valua as signrd but treats it as unsigned.
  5086.  
  5087. I have taken a look at the file, and I am not sure there is a problem.  What
  5088. output do you expect from this program?
  5089.  
  5090.  
  5091. Kevin Kitsemetry
  5092. WATCOM TECHNICAL SUPPORT
  5093.  
  5094. *** This is a reply to #1984.
  5095.  
  5096.  
  5097. From:    Kevin Blenkinsopp
  5098. To:      Kevin Kitsemetry                       Msg #2033, Dec-14-93 01:32PM
  5099. Subject: System(NULL)
  5100.  
  5101. Kevin,
  5102.  
  5103. I think I'm a bit confused about something - I can't get system(NULL) to work.
  5104. It's supposed to go looking for the command interpreter if you don't give it a
  5105. real arg, but it never seems to find it, even if I run it from c:\
  5106. Comspec is set right. I'm using msdos 6.0, with the b-level pre-release of
  5107. wpp386. I'll try and dig out my 9.5a backup and see if it works under that,
  5108. but could you please look into this at your end?
  5109.  
  5110. Cheers,
  5111.  
  5112. Kevin
  5113.  
  5114.  
  5115. From:    Robert Klein
  5116. To:      All                                    Msg #2034, Dec-14-93 01:47PM
  5117. Subject: Graphics
  5118.  
  5119. I'm a new Watcom C/C++32 user and I have a few problems.  First of all,
  5120. The Watcom graphics functions do not see I my adapter as SVGA.  I've got
  5121. a Compudyne 486DX266 Active Matrix notebook that uses the Cirrus Logic
  5122. VGA chip set with 512k RAM.  Also, Video modes I require are not supported
  5123. such as 320x240x256, 320x400x256, 640x400x256.  Even with the 320x200x256,
  5124. _getvideoconfig reports only one video page q
  5125.  
  5126. I don't understand `Q'.
  5127.  
  5128.  
  5129. [2034 / 2034]  Msg.area 12 ... WATCOM C/C++32 9.5 Problems and Fixes
  5130.                Type message number, or press <enter> for NEXT msg.
  5131.  
  5132. MESSAGE:
  5133. A)rea Change        N)ext Message       P)revious Message   E)nter Message
  5134. R)eply to a messag  C)hange a message   =)read_non-stop     -)read_original
  5135. +)read_reply        L)ist (brief)       M)ain Menu          J)ump to file area
  5136. G)oodbye (log off)  K)ill (Delete) Msg  U)pload a message   F)orward (copy)
  5137. B)rowse messages    *)ReadCurrent       T)ag areas          ?)help
  5138. Select: g
  5139.  
  5140. Disconnect [Y,n,?=help]? y
  5141.  
  5142. Leave a message to Kevin Kitsemetry [y,N,?=help]? n
  5143.  
  5144. Quote for the day:
  5145.  
  5146. Arcana Coelestica:
  5147.   Archbishop - A Christian ecclesiastic of a rank superior to
  5148.   that obtained by Christ.
  5149.   Puritanism - The haunting fear that someone, somewhere,
  5150.   may be happy.
  5151.  
  5152.  
  5153.  
  5154. So long, Robert.  Please call again!
  5155.  
  5156.  
  5157. NO CARRIER
  5158.  
  5159.  
  5160.  
  5161.