home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / CONTAINR.ZIP / CONTAIN.THD
Text File  |  1992-07-25  |  101KB  |  2,371 lines

  1.  
  2. #: 52775 S14/Early Code
  3.     28-Dec-91  07:01:32
  4. Sb: Containers
  5. Fm: Paul Montgomery 71500,3525
  6. To: All
  7.  
  8. One of the things that would be very usefull to me and I hope to many others
  9. is, example code on how to interact with all of the new controls available in
  10. 2.0.  The examples that are present with the toolkit are ok but they are not
  11. complete by any means.  The Styles example gives a quick overview, but doesnt
  12. really delve into any details.  The examples could be in both SOM code and in
  13. regular C code.
  14.  
  15. The one that I think is the most difficult of the new controls and needs the
  16. most good examples is the one that is used everywhere in 2.0, the container.
  17.  
  18. For instance, how does one walk the list of RECORDCORE structures that is
  19. present when one has a filled out container. Must one do a CM_QUERYRECORD
  20. every time?  The list seems to be a mixture of 16:16 pointers and 0:32
  21. pointers depending upon when one does the ALLOCRECORD for it.  Must one use
  22. the ALLOCRECORD message to allocate the struct or can one malloc it outside of
  23. the container and pass it in?  Are these the actual structs used by the
  24. container or are copies made when an insert is done?
  25.  
  26. How does one use the supposed PRECORDCORE that is returned in the
  27. NOTIFYRECORDENTER structure in the CN_ENTER notify id of a WM_CONTROL message.
  28. It aint a valid pointer no matter where I had double clicked.
  29.  
  30. If we had decent examples up here on IBMOS2, it would help lots of people. I
  31. am willing to do some for notebooks, sliders, and valuesets.  What I need is
  32. examples for the container.  Thanks.
  33.  
  34. #: 52887 S14/Early Code
  35.     28-Dec-91  18:59:57
  36. Sb: #52775-Containers
  37. Fm: Robert Cannon 73577,127
  38. To: Paul Montgomery 71500,3525
  39.  
  40.    Well I haven't gotten my EADP kit yet, but containers is about the top of
  41. my list for new things to work with.  Hopefully I'll have it by the end of
  42. next week and maybe we can help each other out.
  43.  
  44. #: 52900 S14/Early Code
  45.     28-Dec-91  19:58:42
  46. Sb: #52887-Containers
  47. Fm: Mike Kiser 72510,710
  48. To: Robert Cannon 73577,127
  49.  
  50. Robert, Let me know how your container coding goes and I'll share what I come
  51. up with.....
  52.  
  53. MIke
  54.  
  55. #: 52958 S14/Early Code
  56.     29-Dec-91  06:49:02
  57. Sb: #52887-Containers
  58. Fm: Paul Montgomery 71500,3525
  59. To: Robert Cannon 73577,127
  60.  
  61. The interesting thing about containers that I see so far is the difference in
  62. the way that one works with them from the start.  No other control that I am
  63. aware of makes you allocate the struct you are going to use through a message
  64. to the control.  And then you get to fill out the returned value. It also
  65. supposedly passes a lot more info back to the owner when an action occurs.
  66. There doesnt seem to be a need for the Queryselected type of interaction one
  67. has to use with a list box.
  68.  
  69. Keep us informed as to your progress.
  70.  
  71. #: 52899 S14/Early Code
  72.     28-Dec-91  19:57:22
  73. Sb: #52775-Containers
  74. Fm: Mike Kiser 72510,710
  75. To: Paul Montgomery 71500,3525
  76.  
  77. Paul, I feel the same way; the samples in the new Toolkit are VERY poor in the
  78. areas of creating Notebooks, Folders, Containers.  I am currently attempting
  79. to code a container, slider, a "flashing" (background) Folder, etc. however,
  80. there is very very little to go on as a "guide".  I guess the trial and error
  81. method is the best way for learning, but not for meeting a strict time
  82. schedule.  The "animal" and "car" SOM samples are very disappointing
  83. also......I was expecting a little more than just simple text mode characters
  84. stating "Woof Woof"!!
  85.  
  86. MIke PS.  Most of the samples are just recompiled samples of the original MS
  87. SDK.....nothing new there!!
  88.  
  89. #: 52916 S14/Early Code
  90.     28-Dec-91  20:50:05
  91. Sb: #52899-Containers
  92. Fm: Guy Scharf [Sysop] 76702,557
  93. To: Mike Kiser 72510,710
  94.  
  95. Mike,
  96.  
  97. Sliders are pretty easy.  If you want, I can send you a sample.  It will
  98. probably take a day for me to get it working under the latest drop.  I'll be
  99. tackling containers soon myself.
  100.  
  101. Guy
  102.  
  103. #: 52959 S14/Early Code
  104.     29-Dec-91  06:49:08
  105. Sb: #52899-Containers
  106. Fm: Paul Montgomery 71500,3525
  107. To: Mike Kiser 72510,710
  108.  
  109. It is a beta of the toolkit also. <grin>.
  110.  
  111. The example called "styles" gives a limited example of all of the new
  112. controls, but it is by no means complete.
  113.  
  114. BTW one technique that works real well with a notebook is to create each page
  115. with the dialog box editor and then do a WinLoadDialog to create the window
  116. before you associate it with the page.  You still have to write
  117. sizing/positioning logic, but it is much easier to get initial positions
  118. right.  Look at Petzolds HexCalc code for an example of using the
  119. WinLoadDialog function.
  120.  
  121. #: 53084 S14/Early Code
  122.     29-Dec-91  20:55:42
  123. Sb: #52959-Containers
  124. Fm: Mike Kiser 72510,710
  125. To: Paul Montgomery 71500,3525
  126.  
  127. Paul, Thanks for the tip.  I'll check it out...
  128.  
  129. MIke
  130.  
  131. #: 53036 S14/Early Code
  132.     29-Dec-91  15:46:18
  133. Sb: #52994-Containers
  134. Fm: Paul Montgomery 71500,3525
  135. To: Guy Scharf [Sysop] 76702,557
  136.  
  137. > Haven't tried
  138.  
  139. > Dont know,
  140.  
  141. We seem to be working with the same stuff <grin>...  At least its nice to be
  142. back into a steep learning curve again.  1.3 was getting old hat. <grin>
  143. (yeah, right)  Betas to the left of me Betas to the right.  At least the
  144. hardware I am working on is almost stable.
  145.  
  146. I should have answers to the presparam stuff next week.  I probably wont get
  147. to the owner draw stuff by then.  Too much container stuff to play with.
  148.  
  149. #: 53083 S14/Early Code
  150.     29-Dec-91  20:54:10
  151. Sb: #53036-Containers
  152. Fm: Mike Kiser 72510,710
  153. To: Paul Montgomery 71500,3525
  154.  
  155. Have either one of you guys gotten the WPCAR sample to compile yet? I've
  156. worked on it ALL weekend and haven't been sucessful....
  157.  
  158. Thanx! MIke
  159.  
  160. PS. Does anyone know what the "new" 32-bit macro for MOUSEMSG(&msg)->x is?? I
  161. can't get an app that I've just ported from 16 to 32-bit to compile due to the
  162. C Set/2 compiler kicking this one out......
  163.  
  164. #: 53163 S14/Early Code
  165.     30-Dec-91  05:26:44
  166. Sb: #53083-Containers
  167. Fm: Paul Montgomery 71500,3525
  168. To: Mike Kiser 72510,710
  169.  
  170. I havent played with the SOM examples yet.  I have a tight deadline that
  171. doesnt have SOM learning curve in it.  That will have to wait for release 2.
  172. Then I expect you guys with the arrows in your back will be able to help. What
  173. I am concentrating on now is how to interact with the controls from a non SOM
  174. application.
  175.  
  176. #: 53340 S14/Early Code
  177.     30-Dec-91  21:20:34
  178. Sb: #53163-Containers
  179. Fm: Mike Kiser 72510,710
  180. To: Paul Montgomery 71500,3525
  181.  
  182. This SOM learning curve looks tremendous! Much more complex than "just"
  183. PM......
  184.  
  185. MIke
  186.  
  187. #: 53399 S14/Early Code
  188.     31-Dec-91  05:26:44
  189. Sb: #53340-Containers
  190. Fm: Paul Montgomery 71500,3525
  191. To: Mike Kiser 72510,710
  192.  
  193. I did a quick look at it.  It looks like it is a healthy learning curve to
  194. understand the syntax.  The learning curve I am really worried about is the
  195. "how do I design a non-trivial app with this thing" one.  I can get the syntax
  196. from the manuals, the design aspects come from trial and error over time.
  197. Very few manuals talk about design concepts and application of those concepts
  198. in non-trivial excercises.
  199.  
  200. #: 62284 S4/Version 2.x
  201.     30-Jan-92  04:19:15
  202. Sb: 177 containers
  203. Fm: Paul Montgomery 71500,3525
  204. To: Brian Proffit[Sysop] 75300,1466
  205.  
  206. Brian
  207.   We just got the 177 toolkit from our SE and its real neat except for one
  208. leeeetle thing.  The mechanism we used under 167 to add records to a container
  209. as shown in the "Styles" example doesnt work any more.  And we havent a clue
  210. yet as to why.  The example provided with 177 doesnt work either.  Its obvious
  211. that containers DO work, but the question is how?
  212.  
  213. Is there a list of changes between the 167 and 177 programatic interfaces
  214. anywhere in the toolkit that I have missed?  If not, is there anyway that
  215. someone can provide such a list so that we dont waste a lot of time trying to
  216. track down these things?  Irv? Mel?
  217.  
  218. #: 66226 S4/Version 2.x
  219.     12-Feb-92  13:57:44
  220. Sb: #65888-Anybody using SOM
  221. Fm: Frank Mena 73507,3610
  222. To: Mike Kiser 72510,710
  223.  
  224. None so far.  I trying to figure out how to use the WPS calls without using
  225. SOM.  By the look of the WPS api, all we have to do is figure out how to make
  226. and pass the "SOMSelf" structure.  This way I can replace the SOM class
  227. hierarchy with a set of C++ classes that provide at least the same amount of
  228. functionality.  I guess this would be the same thing as C++ SOM bindings.
  229.  
  230. BTW, after in installed the CAR sample and re-booted,  the icon changes to a
  231. big read circle with the yellow letters "FS" in them. When I activate the app,
  232. I get a window, but no car.  THe settings pages and menu items (beep horn) are
  233. no longer there.  I tried removing the class, re-booting, then re-installing
  234. but no dice.  Did you notice that you can beep the horn without starting the
  235. app?
  236.  
  237. It appears to me that a WPS app effectively becomes an extension of the WPS.
  238. I also heard the WPS apps are in the same address space as the WPS, so that
  239. there is no protection from each other.  If that is true, I don't know if I
  240. want to write my app as a WPS app, just make it look like it.
  241.  
  242. Did you actually use any of the wpXX calls from the "Workplace Objects and
  243. Functions" manual?  I've been trying to create a container on top of the
  244. client area, but I can't get it to work.  The sample program has one working
  245. within a dialog box, but I need to place one in the client area on my main
  246. window.  Have you had any luck with this control?
  247.  
  248. I would like to share more with you our experiences with SOM and WPS.
  249.  
  250. Thanks, Frank.
  251.  
  252. #: 67341 S4/Version 2.x
  253.     15-Feb-92  10:04:10
  254. Sb: #Anybody using SOM
  255. Fm: Steve Woodward 76525,1266
  256. To: Mike Kiser 72510,710 (X)
  257.  
  258. The CUA controls - Slider, container, Valueset etc... are all accesible as PM
  259. window classes, you do not have to use SOM or the WPS METHODS to utilize these
  260. controls.
  261.  
  262. Steve woodward - OS/2 PM Development
  263.  
  264. #: 67564 S4/Version 2.x
  265.     15-Feb-92  19:42:22
  266. Sb: #67341-Anybody using SOM
  267. Fm: Bernard Tiffany 75046,2667
  268. To: Steve Woodward 76525,1266 (X)
  269.  
  270. The new OS/2 2.0 controls such as sliders, containers, notebooks, value sets,
  271. plus file and font dialogs are all described in IBM Personal Systems,
  272. Developer, No. 1, 1992. SOM is described in "Object-Oriented Programming," in
  273. the same issue, too.
  274.  
  275. LBT.
  276.  
  277. #: 67519 S4/Version 2.x
  278.     15-Feb-92  17:56:54
  279. Sb: #67379-Anybody using SOM
  280. Fm: Frank Mena 73507,3610
  281. To: James F. Lederer 74030,20 (X)
  282.  
  283. James, thats what I was thinking, but then Steve Woodward pointed out
  284. something that puts a wrench into that.  If I try to create a desktop folder
  285. inside of one of my containers, I can only do that if my app resides within
  286. the WPS process.  Of course, you might ask why I don;t just create a container
  287. with a folder icon.  An example would be trying to add an outbasket object
  288. (ala the CUA 91 demo) inside of my app container or folder.  The outbasket is
  289. within the WPS process....  You know what?  I think i'm even confusing
  290. myself...  I think I better sit down and give this some thought.  Its a new
  291. premise that I haven't given enough thought to yet.  I wish we had a WPS
  292. programmers guide.
  293.  
  294. #: 67521 S4/Version 2.x
  295.     15-Feb-92  17:57:01
  296. Sb: #67311-Anybody using SOM
  297. Fm: Frank Mena 73507,3610
  298. To: Gary Murphy 73457,365 (X)
  299.  
  300. Do you know if they added any of the other container views beside icon, tree
  301. and details?
  302.  
  303. #: 68057 S4/Version 2.x
  304.     17-Feb-92  08:19:02
  305. Sb: Anybody using SOM
  306. Fm: David Moskowitz 76701,100
  307. To: Frank Mena 73507,3610
  308.  
  309. Frank, I haven't been able to get WPS containers in the client area, either.
  310.  
  311. If you want to use C++ classes, I suspect the best thing to do is encapsulate
  312. SOM objects with the C++ classes
  313.  
  314. I'm told John Pompeii of Objective Solutions is on the way to making this
  315. work.  His product, Object/PM is an EXCELLENT class library for OS/2!
  316.  
  317. David
  318.  
  319. #: 68131 S4/Version 2.x
  320.     17-Feb-92  11:37:25
  321. Sb: #68057-Anybody using SOM
  322. Fm: Frank Mena 73507,3610
  323. To: David Moskowitz 76701,100
  324.  
  325. It turns out that with the changes to 177, you have to memset to zero the
  326. container structures abd make sure to set the cb field.
  327.  
  328. I know about John.  I talk to him on a weekly basis exchanging experiences
  329. with the WPS.  I also have Object:PM.
  330.  
  331. #: 69197 S4/Version 2.x
  332.     19-Feb-92  19:42:32
  333. Sb: #68291-Anybody using SOM
  334. Fm: Steve Woodward 76525,1266
  335. To: Frank Mena 73507,3610
  336.  
  337. Just open up the drive the desktop is contained on and drag it (or use the
  338. pop-up Move menu item) to the drive you want it on.
  339.  
  340. also, there's a statement in ini.rc that you could modify BEFORE install takes
  341. place (or delete \DESKTOP and below - erase your old OS2.INI and run MAKEINI
  342. after changing the statement to point to a specific drive.
  343.  
  344. the statement below allows install on the boot drive:
  345.  
  346.   "PM_InstallObject" "Desktop;WPDesktop;?:\" "OBJECTID=<WP_DESKTOP>"
  347.  
  348. change ?:\ to d:\ to get it to install on your D; drive.
  349.  
  350.  
  351. Steve Woodward - IBM OS/2 PM Dev.
  352.  
  353. #: 70629 S4/Version 2.x
  354.     23-Feb-92  13:24:17
  355. Sb: Anybody using SOM
  356. Fm: Steve Woodward 76525,1266
  357. To: Frank Mena 73507,3610
  358.  
  359. Just open up the drive the desktop is contained on and drag it (or use the
  360. pop-up Move menu item) to the drive you want it on.
  361.  
  362. also, there's a statement in ini.rc that you could modify BEFORE install takes
  363. place (or delete \DESKTOP and below - erase your old OS2.INI and run MAKEINI
  364. after changing the statement to point to a specific drive.
  365.  
  366. the statement below allows install on the boot drive:
  367.  
  368.   "PM_InstallObject" "Desktop;WPDesktop;?:\" "OBJECTID=<WP_DESKTOP>"
  369.  
  370. change ?:\ to d:\ to get it to install on your D; drive.
  371.  
  372.  
  373. Steve Woodward - IBM OS/2 PM Dev.
  374.  
  375. #: 67351 S4/Version 2.x
  376.     15-Feb-92  10:25:32
  377. Sb: #6.177 and WC_CONTAINER
  378. Fm: Rick Fishman 72251,750
  379. To: All
  380.  
  381. It seems that 6.177 has changed the interface to the container control a bit.
  382. Now my CM_INSERTRECORD message gets an access violation. The only difference
  383. between my 6.167 code and this is that now I initialize the recordInsert.cb
  384. variable to sizeof( RECORDINSERT ). In 6.167 it was not necessary to init the
  385. cb field. Under 6.177 sending the CM_INSERTRECORD message gets a 1208 return
  386. code (PMERR_INVALID_PARAMETERS) without doing this.
  387.  
  388. I also noticed that the STYLE sample program in the toolkit has the same
  389. problem in that when you bring up the container the icon that used to show up
  390. under 6.167 no longer shows up - I imagine its CM_INSERTRECORD message is
  391. failing. Maybe the reason it doesn't get an access violation is that I am
  392. bringing mine up in detail mode while it is using icon mode.
  393.  
  394. Has anyone else had this problem? If so, any workarounds been found? Obviously
  395. the container is still working. I think WPS would have a few problems if not
  396. :- )
  397.  
  398. Rick
  399.  
  400. #: 67434 S4/Version 2.x
  401.     15-Feb-92  13:09:37
  402. Sb: #67351-#6.177 and WC_CONTAINER
  403. Fm: Robert Cannon 73577,127
  404. To: Rick Fishman 72251,750 (X)
  405.  
  406.    I noticed that some of the container structures have changed since 6.167.
  407. For one thing, RECORDINSERT structures now have the .cb field where they
  408. didn't before.  I haven't had a chance to get my old code working yet (or to
  409. even look at it for more than 30 minutes).  The best thing to do is to print
  410. the PMSTDDLG.H file to see what the structures look like now.  Be sure and
  411. initialize everything in the strucutre to something.
  412.  
  413. #: 67602 S4/Version 2.x
  414.     15-Feb-92  22:21:17
  415. Sb: #67434-6.177 and WC_CONTAINER
  416. Fm: Rick Fishman 72251,750
  417. To: Robert Cannon 73577,127
  418.  
  419. Robert,
  420.  
  421.  >Be sure and initialize everything in the strucutre to something.
  422.  
  423. You called it. I bypassed my usual habit of memset'ing my structures to zeroes
  424. (I've GOT to defend my silly mistakes <g>). Got to do that besides filling in
  425. the .cb field as a pRecordParent struct pointer was added.
  426.  
  427. Thanks.
  428.  
  429. Rick
  430.  
  431. #: 67606 S4/Version 2.x
  432.     15-Feb-92  22:28:18
  433. Sb: #67434-6.177 and WC_CONTAINER
  434. Fm: Mike Kiser 72510,710
  435. To: Robert Cannon 73577,127
  436.  
  437. Robert, My Slider control isn't working properly under 6.177 ( in fact, it's
  438. not showing up on the window at all).  I compiled it with the 6.167 tools and
  439. have not had the time to recompile it with the 6.177 C Set/2 compiler.  I am
  440. just hoping (fingers crossed) that the Slider control will reappear.
  441.  
  442. MIke
  443.  
  444. #: 69086 S4/Version 2.x
  445.     19-Feb-92  16:41:35
  446. Sb: #67606-6.177 and WC_CONTAINER
  447. Fm: Robert Cannon 73577,127
  448. To: Mike Kiser 72510,710
  449.  
  450. >>showing up on the window at all).  I compiled it with the 6.167 tools and
  451. have not had the time to recompile it with the 6.177 C Set/2 compiler.  I am
  452. just hoping (fingers crossed) that the Slider control will reappear.
  453.  
  454.    One of the changes between 6.167 and 6.177 is that the actual number of
  455. many of the new PM messages have been changed.  This probably has a great deal
  456. to do with your problem.  Recompiling with the new toolkit should solve the
  457. problem.  Be on the lookout for changes in the structures that are passed to
  458. the control, also.
  459.  
  460. #: 72387 S14/Early Code
  461.     27-Feb-92  23:16:18
  462. Sb: #Container Problems
  463. Fm: Wayne Kovsky 76164,3504
  464. To: All
  465.  
  466. I am having a problem using Containers with the 6.177 toolkit.  I can create
  467. the container, describe record fields, load records, and display those records
  468. in Icon, Name and Text formats.  However, if I try to display them in Detail
  469. format, I get an addressing exception.  My app defines column headings
  470. (including column widths) for the fields, as well as the location of the last
  471. field to left of the split bar, and the location of the split bar itself.
  472. Here is where it gets interesting ...
  473.  
  474. If I never load any records into the container, but switch to Detail format, I
  475. get a display with all column headings and column separators, and with the
  476. split bar just where I wanted it.  Once in this mode, if I try to load records
  477. (or if records are already loaded), addressing exception!  Now, if I omit the
  478. "last field to left of split bar" but include the location of the split bar, I
  479. get a screen that has a container title, the split bar, and scroll bars, but
  480. no records and no column headings or separators (but no crash, either).  I can
  481. go back to any other view, and see all records just fine.
  482.  
  483. Next, if I include the "last field to left of split bar" address, but omit the
  484. location of the split bar, I get no column headings, no column separators, no
  485. split bar, and no records (and no crash).  Again, going back to other views
  486. still works just fine.
  487.  
  488. This is all on 6.177; I am getting 6.304 system and toolkit tomorrow, so
  489. perhaps this is a container DLL bug and all will be well ... but in case it
  490. isn't, any ideas on what to look at?  (BTW, the example STYLE program omits
  491. some structure size settings that cause it to fail if you recompile it; easy
  492. to fix once you know what to look for.)
  493.  
  494. #: 72673 S14/Early Code
  495.     28-Feb-92  15:53:05
  496. Sb: #72387-Container Problems
  497. Fm: Robert Cannon 73577,127
  498. To: Wayne Kovsky 76164,3504 (X)
  499.  
  500.    I am still working with Containers myself, but it sounds like the problem
  501. is in the allcoation or the setting of fields in the FIELDINFO structure. Make
  502. sure the offset parameter isn't pointing past the end of your RECORCORE
  503. structure and also make sure when you allocate RECORDCORE structures that you
  504. allocate enough extra memory to hold you detail data.
  505.  
  506. #: 73066 S14/Early Code
  507.     29-Feb-92  16:03:24
  508. Sb: #72673-Container Problems
  509. Fm: Wayne Kovsky 76164,3504
  510. To: Robert Cannon 73577,127
  511.  
  512. Thanks for your reply, Robert.  I am allocating the RECORDCORE structure in
  513. the manner used in the 'style' sample program:  that is, the RECORDCORE
  514. structure is the first element in my own USER_RECORD structure, and I tell the
  515. container to allocate extra memory that is the size of my USER_RECORD
  516. structure minus the size of the RECORDCORE structure, as in the sample code.
  517.  
  518. I have used IPMD to look at every address in all of the relevant structures,
  519. and they all look good to me.  The abort is coming in the container DLL
  520. itself, not in my code; I can format these records just fine, and I can (and
  521. do) access data in them in other parts of my application, so I am fairly sure
  522. that pointers and data lengths and offsets are OK.
  523.  
  524. Meanwhile, back to IPMD ...
  525.  
  526. #: 73464 S14/Early Code
  527.     01-Mar-92  16:15:51
  528. Sb: #73066-Container Problems
  529. Fm: Paul Montgomery 71500,3525
  530. To: Wayne Kovsky 76164,3504
  531.  
  532. Wayne,
  533.   Check PMSTDDLG for the typedef of the structs you use when creating the
  534. columns.  You will notice a few new fields that the styles example doesnt fill
  535. out.  Make sure you do!  If you notice, the styles example doesnt work as
  536. coded under 177 either. <grin>
  537.  
  538. Paul Montgomery
  539.  
  540. #: 73706 S14/Early Code
  541.     02-Mar-92  10:23:33
  542. Sb: #73464-Container Problems
  543. Fm: Wayne Kovsky 76164,3504
  544. To: Paul Montgomery 71500,3525
  545.  
  546. Yes, Paul, I had noticed that the styles example didn't work for containers; I
  547. posted a message to Ian Ameline separately detailing how to fix that.  I have
  548. looked at the pmstddlg.h file exhaustively, and am filling in (or have
  549. verified that the system properly filled in) every field defined in all of the
  550. structures I am using.  (I have looked at these fields both from the point of
  551. view of my source code, and also during execution via IPMD.)
  552.  
  553. I am pretty certain that one of these fields, in one of these structures, is
  554. precisely my problem:  I have it wrong somewhere.  Troubl is, I don't know
  555. where to look, that I haven't already looked with as much care as I can
  556. muster.  I am also certain that this is going to be a real head-slapper when I
  557. find it ...
  558.  
  559. One other thing that I do, that the styles example does not, is check EVERY
  560. return code from EVERY function call; I get no errors on anything related to
  561. containers (or anything else, for that matter) that do not get reported.  I
  562. have also chained through the record structure and printed every field, and
  563. the contents of every container-related structure at various steps in
  564. creating/filling/displaying the container.  Everything I do with containers
  565. (which by now, is a lot) works except displaying detail views, and sorting (a
  566. separate message on this subject).  Whatever I am doing wrong seems to affect
  567. only the detail view of the records, since the other views can obviously chain
  568. through the records correctly.
  569.  
  570. C'mon, somebody help me slap my forehead!
  571.  
  572. #: 73991 S14/Early Code
  573.     02-Mar-92  20:51:48
  574. Sb: #73706-Container Problems
  575. Fm: Rick Fishman 72251,750
  576. To: Wayne Kovsky 76164,3504
  577.  
  578. Wayne, just a thought. I had a similar experience with the details view of a
  579. container. This may have *nothing* in common with yours, though.
  580.  
  581. On the CM_INSERTDETAILFIELDINFO message, each FIELDINFO structure in the array
  582. contains an offStruct member. For strings (CFA_STRING) this is set up as
  583. FIELDOFFSET( STRUCT, psz ). My mistake was in thinking that I could set up a
  584. USERRECORD like this:
  585.  
  586.    typedef struct _USERRECORD
  587.    {
  588.         RECORDCORE rc;
  589.         CHAR szString[ 100 ];
  590.     } USERRECORD;
  591.  
  592. and set fieldinfo.offStruct = FIELDOFFSET( USERRECORD, szString ).
  593.  
  594. What I had to do was this:
  595.  
  596.    typedef struct _USERRECORD
  597.    {
  598.         RECORDCORE rc;
  599.         PSZ szString;
  600.         CHAR achString[ 100 ];
  601.     } USERRECORD;
  602.  
  603.  Then:
  604.  
  605.    userrec.szString = userrec.achString;
  606.    fieldinfo.offStruct = userrec.szString;
  607.  
  608.    or malloc the memory and use that address in the offStruct field.
  609.  
  610. It was obvious once I looked closely but trying to follow the Style sample
  611. made me stupid. I imagine you didn't make this same mistake. FWIW.
  612.  
  613. Rick
  614.  
  615. #: 74436 S14/Early Code
  616.     03-Mar-92  19:20:29
  617. Sb: #73991-#Container Problems
  618. Fm: Wayne Kovsky 76164,3504
  619. To: Rick Fishman 72251,750 (X)
  620.  
  621. Rick, you may have hit it ... as soon as I finish this reply, I am going to
  622. try your method.
  623.  
  624. If I understood your posting correctly, it could be boiled down into the
  625. following statement:  "In the FIELDINFO structure, the 'offStruct' field must
  626. contain an offset to a <POINTER TO> the string, not an offset to the string
  627. itself."  In all my poring over the documentation and examples, I never came
  628. across anything that would have led me to believe that.  You say it was
  629. obvious once you looked closely, so I imagine that will be true for me as well
  630. -- and I will, as promised, slap my forehead, and perhaps even acknowledge
  631. that my ex-mother-in-law's beliefs about the limitations of my intelligence
  632. and my questionable parentage were not entirely inaccurate ...
  633.  
  634. If this thing really needs an offset to a pointer, then I sure understand why
  635. it was blowing up.  I should have this working in less than an hour!!! Thank
  636. you, thank you, thank you!!!  (In advance, and awaiting only confirmation.)
  637. Wayne
  638.  
  639. #: 74463 S14/Early Code
  640.     03-Mar-92  19:51:09
  641. Sb: #74436-Container Problems
  642. Fm: Rick Fishman 72251,750
  643. To: Wayne Kovsky 76164,3504 (X)
  644.  
  645. Wayne, that IS what I meant. I hope it works out for you. What was happening
  646. as you pointed out is it was taking the first 4 bytes of the string as the
  647. address of the string and trapping. It seems that a "USERRECORD" structure
  648. really requires some thought. I decided to use the CM_ALLOCRECORD message to
  649. allocate just enough memory for all my strings as well as pointers to them.
  650.  
  651. So with 3 strings it looks like this:
  652.  
  653.   typedef struct _USERRECORD
  654.   {
  655.       RECORDCORE rc;
  656.       PSZ pszString1;
  657.       PSZ pszString2;
  658.       PSZ pszString3;
  659.   } USERRECORD;
  660.  
  661. My actual strings are lined up after pszString3 one after another. The 'psz'
  662. prefix really applies in this case (as opposed to 'sz').
  663.  
  664. Hope your head is alright<g>. I can hear the slapping from here. If I remember
  665. correctly, that's where my big whelts (sp?) came from 2 weeks ago<g>.
  666.  
  667. Rick
  668.  
  669. #: 74488 S14/Early Code
  670.     03-Mar-92  20:41:50
  671. Sb: #73991-Container Problems
  672. Fm: Wayne Kovsky 76164,3504
  673. To: Rick Fishman 72251,750
  674.  
  675. Rick, I just made the changes required and tried it, and boy, am I a happy
  676. camper!!!  I now have about 14 fields, neatly lined up in columns, to go with
  677. my records.
  678.  
  679. I went back and looked at the sample program.  It has a single CMA_STRING
  680. field, but it is indeed a poiner to the actual string somewhere else; don't
  681. know how I missed that (he said, slapping his forehead).  I also looked
  682. briefly at the documentation, and didn't (yet) see anything that would have
  683. put me onto this.
  684.  
  685. I also tried showing some other field types (CMA_DATE and CMA_TIME, plus a
  686. ULONG), but they still blow.  I'll bet I will find out why within a few more
  687. minutes.  I just had to get back here to let you know that you solved the
  688. problem.
  689.  
  690. If you are ever in Colorado, let me know; I owe you a beer!
  691.  
  692. #: 74893 S14/Early Code
  693.     04-Mar-92  19:44:03
  694. Sb: #73991-#Container Problems
  695. Fm: Wayne Kovsky 76164,3504
  696. To: Rick Fishman 72251,750 (X)
  697.  
  698. Rick, I have been working with detailed container data all day now; life is
  699. good again!
  700.  
  701. Well, almost ... I have no problem with CFA_STRING, CFA_DATE, CFA_TIME, and I
  702. don't use CFA_BITMAPORICON.  But I still get an abort with CFA_ULONG (you
  703. would think this would be one of the really 'easy' data types, among that
  704. list).
  705.  
  706. I tried making a pointer to the ULONG (as I did for the strings), and I tried
  707. using just the offset to the ULONG itself directly (as is required for the
  708. date and time fields -- don't you love consistency in an API?).  Are you using
  709. this type, and if so, what is the magic incantation?
  710.  
  711. #: 74933 S14/Early Code
  712.     04-Mar-92  20:43:07
  713. Sb: #74893-Container Problems
  714. Fm: Rick Fishman 72251,750
  715. To: Wayne Kovsky 76164,3504
  716.  
  717. Wayne, I hadn't tried using a CFA_ULONG column yet. I just tried it and got an
  718. access violation. I can't imagine that you'd need a POINTER to the ULONG. I
  719. agree with you that since it is simply a 4-byte value that it must be the same
  720. as a CDATE and CTIME column in that respect.
  721.  
  722. I'm going to send off a question via MCI Mail and see what happens. I'll let
  723. you know what I find out. It may be a couple of days...
  724.  
  725. Glad to see everything else is working for you though. Hope to take you up on
  726. that beer sometime...
  727.  
  728. Rick
  729.  
  730. #: 75323 S14/Early Code
  731.     05-Mar-92  21:13:19
  732. Sb: #74933-Container Problems
  733. Fm: Wayne Kovsky 76164,3504
  734. To: Rick Fishman 72251,750 (X)
  735.  
  736. Well, I never thought I would be happy to hear about someone else getting an
  737. access violation; no offense, but this is good news!  I was beginning to think
  738. my toolkit had some code like 'if KOVSKY then (PVOID) 0 = 12345'. (What, me
  739. paranoid?  I don't have time to be paranoid, with all these guys out to get
  740. me.)
  741.  
  742. I just got 6.304 up today; you didn't mention what you are running, but I will
  743. try again with this tonight.  (I am also getting the same thing with the PVOID
  744. address that I pass to CM_SORTRECORD, but which comes back to me as nothing I
  745. recognize.  I hope this is a toolkit problem too.)  If this works on 6.304, I
  746. will let you know.
  747.  
  748. #: 75338 S14/Early Code
  749.     05-Mar-92  21:58:00
  750. Sb: #74933-#Container Problems
  751. Fm: Wayne Kovsky 76164,3504
  752. To: Rick Fishman 72251,750 (X)
  753.  
  754. Rick, I now know that you are using 6.177, not 6.304, since I just tested
  755. CFA_ULONG under 6.304:  it works!  My favorite kind of bug fix ("Just install
  756. these new tools, recompile, and go out into the world and be fruitful and
  757. multiply").
  758.  
  759. CM_SORTRECORD remains broken, however.  I had thought that only the third
  760. parameter (a PVOID that you can pass to the CM_SORTRECORD, which in turn is
  761. passed to your 'compare ()' function) was trashed, because it happened to
  762. cause me to blow up before I looked at the other two (pointers to records to
  763. be compared).  Turns out all three are garbage, when I looked closer.
  764.  
  765. Ah, well, I guess I'll move back to notebook controls for awhile; I had some
  766. bugs there that I believe were bugs in 6.167, and haven't looked at them
  767. since.  Except for sorting, containers looks pretty solid now.
  768.  
  769. #: 75360 S14/Early Code
  770.     05-Mar-92  23:20:36
  771. Sb: #75338-Container Problems
  772. Fm: Rick Fishman 72251,750
  773. To: Wayne Kovsky 76164,3504
  774.  
  775. Wayne, great news about CFA_ULONG. I haven't heard back from MCI Mail but I
  776. guess they'll tell me to install the new toolkit (just got it today but won't
  777. have a chance to install until Sunday).
  778.  
  779. I haven't used CM_SORTRECORD yet as I sort all records before inserting them
  780. into my container. I'll try it too if I get a chance.
  781.  
  782. Good luck on the notebooks. That was my next project. Isn't it great to be
  783. pioneering this stuff <head turning a full 360 degrees<g>>. I'll tell you
  784. though - even with the bugs we've found - these new controls are pretty
  785. impressive.
  786.  
  787. Off to back up before Michaelangelo strikes....
  788.  
  789. Rick
  790.  
  791. #: 75595 S14/Early Code
  792.     06-Mar-92  19:52:42
  793. Sb: #75360-Container Problems
  794. Fm: Wayne Kovsky 76164,3504
  795. To: Rick Fishman 72251,750
  796.  
  797. I insert my records in sorted order as well, Rick, but I also allow the user
  798. to sort however they like (the records have about 17 fields or so, and all but
  799. a couple of them are sensible candidates for sorting).
  800.  
  801. I have already gotten pretty far with notebooks:  multiple pages, major and
  802. minor tabs, a sensible way to load the numerous dialogs involved (to improve
  803. response time), etc.; I am using just about every message and notification.  I
  804. have one really BIG problem, though:  each of my pages is a dialog (the dialog
  805. already works in my old usage, which I have kept in the program).  Hitting a
  806. control on a dialog on any given page works; changing to a different page and
  807. hitting a control there works.  But if you return to a page where a control
  808. has been hit already, and try to hit a second control, GP fault time
  809. (definitely NOT to be confused with Miller time).
  810.  
  811. I haven't tried this yet under 6.304, and I am hoping (against hope) that this
  812. is a now-fixed toolkit problem.   My old forehead can't stand another might
  813. slap ...
  814.  
  815. #: 75655 S14/Early Code
  816.     07-Mar-92  01:12:17
  817. Sb: #75595-Container Problems
  818. Fm: Rick Fishman 72251,750
  819. To: Wayne Kovsky 76164,3504
  820.  
  821. It sounds like I will be using the notebook control in the same way, i.e.
  822. multiple dialog boxes rather than using WinCreateWindows for the controls. I
  823. am porting a 1.3 PM program that needs gobs of info from the user to set up an
  824. entry. I'm hoping the notebook control will do the trick. In the 1.3 version
  825. the user has to bring up 3 separate dialog boxes and hit ok on all - not
  826. great.
  827.  
  828. I hope your problem is fixed under 6.304. Your sacrifice pre-6.304 is greatly
  829. appreciated <g>. I haven't heard of a lot of problems with notebooks though -
  830. THAT's encouraging. Think I'll put on a helmet though - my forehead can't
  831. handle that many more slaps...
  832.  
  833. #: 76203 S14/Early Code
  834.     08-Mar-92  14:45:44
  835. Sb: #75655-Container Problems
  836. Fm: Wayne Kovsky 76164,3504
  837. To: Rick Fishman 72251,750
  838.  
  839. Rick, I have some great news on my Notebook problems.  First, 6.304 did NOT
  840. automagically solve them; but blood, sweat and tears did.
  841.  
  842. The "magic pill" is to take great care on setting the owner window when you do
  843. your 'WinLoadDlg ()' for the dialog(s) that will be the notebook page(s). I
  844. was using a client window that started a notebook window that was a dialog,
  845. and the notebook dialog was loading the page dialogs.  I was using
  846. 'HWND_DESKTOP' for the parent of the page dialogs, and the notebook's hwnd as
  847. the owner.  Again, the symptom was that I could only touch one control on any
  848. given notebook page; when I touched a second control (or touched the first one
  849. again) on any page, the whole thing crashed (dropping me back to an OS/2
  850. prompt).
  851.  
  852. I tried setting hwndOwner to NULLHANDLE, and this worked!  However, it caused
  853. me other problems, since I was doing things in other areas that required
  854. getting the owner handle.  With this clue, I then tried setting hwndOwner not
  855. to the Notebook dialog hwnd, but to the client window's hwnd; this works!
  856.  
  857. Hey, with ll the time I just saved you, now we owe each OTHER a beer!
  858.  
  859. #: 76678 S14/Early Code
  860.     09-Mar-92  19:08:58
  861. Sb: #76203-Container Problems
  862. Fm: Rick Fishman 72251,750
  863. To: Wayne Kovsky 76164,3504
  864.  
  865.  >Hey, with all the time I just saved you, now we owe each OTHER a beer!
  866.  
  867. A beer?! I think it's time to start resorting to tequila! Great catch! The
  868. problem with the container and notebook controls is that when you have a bug
  869. with them it takes forever to describe the problem to someone else so you can
  870. get help.
  871.  
  872. I printed your message out lest I forget it.
  873.  
  874.  >I was using a client window that started a notebook window that was a
  875. dialog.
  876.  
  877. Pardon my notebook ignorance, but what do you mean by 'a notebook window that
  878. was a dialog'? Do you mean a notebook control that fills a dialog box, a
  879. notebook control that fills the client window, or is it actually possible to
  880. define a 'notebook dialog'? I've been thinking about how to present the
  881. notebook so this is intriguing.
  882.  
  883. Thanks for keeping me informed.
  884.  
  885. Rick
  886.  
  887. #: 76740 S14/Early Code
  888.     09-Mar-92  21:49:29
  889. Sb: #76678-Container Problems
  890. Fm: Frank Castellucci 72261,2700
  891. To: Rick Fishman 72251,750
  892.  
  893. Rick, I've been goofing around with notebook controls:
  894.  
  895. Notebooks can contain pages. Pages are child windows of the notebook. Pages
  896. can contain any control a normal window or dialog box can contain, sliders,
  897. buttons, static, etc... I am using multiple pages of a notebook to remove
  898. nested dialog windows, much cleaner!
  899.  
  900. Don't know if any of that helps, my opinion based on use.
  901.  
  902. Frank
  903.  
  904. #: 77052 S14/Early Code
  905.     10-Mar-92  19:33:57
  906. Sb: #76740-Container Problems
  907. Fm: Rick Fishman 72251,750
  908. To: Frank Castellucci 72261,2700
  909.  
  910. Frank, thanks for your comments on notebook controls. My next project is to do
  911. much the same as you are describing - replacing nested dialogs. I'd like to
  912. see the STYLE sample use dialogs for pages so as to dictate a clean way to do
  913. it. I'm imagining that doing WinLoadDlgs for the pages at program
  914. initialization is the best way. Is that what you did? Did you put the notebook
  915. control itself in a Client window or in a dialog box (anything nonCUA about a
  916. notebook in a modal dialog box)?
  917.  
  918. Rick <guess you can tell my mind is thinking but I haven't yet started the
  919. coding<g>>
  920.  
  921. #: 77058 S14/Early Code
  922.     10-Mar-92  20:06:35
  923. Sb: #77052-Container Problems
  924. Fm: Frank Castellucci 72261,2700
  925. To: Rick Fishman 72251,750
  926.  
  927.  
  928. Rick, > that doing WinLoadDlgs for the pages... Is that what you did?
  929.  
  930. I forget, I have to check back to the code. Will upload sample for you if you
  931. want.
  932.  
  933. > Did you put the notebook control itself in a Client window or in a dialog
  934.  
  935. Both.
  936.  
  937. Guess you can tell my mind was coding but I haven't yet started thinking<g>.
  938.  
  939. I have at this point totally fragged the development machine between mixing
  940. and re-mixing various version of the OS, CSET2, drivers, production code,
  941. sample code, experimental code, blah blah blah... Just received the latest
  942. driver for the OS and am waiting for the tools to straighten things out.
  943.  
  944. Frank
  945.  
  946. #: 77428 S14/Early Code
  947.     11-Mar-92  19:09:40
  948. Sb: #77058-Container Problems
  949. Fm: Rick Fishman 72251,750
  950. To: Frank Castellucci 72261,2700
  951.  
  952. Frank, I appreciate the add'l info on the notebook. When I start coding I'll
  953. probably have some more to ask/share.
  954.  
  955.  >I have at this point totally fragged the development machine between mixing
  956. and
  957.  >re-mixing various version of the OS, CSET2, drivers, production code, sample
  958. code,
  959.  >experimental code, blah blah blah...
  960.  
  961. Boy, don't I know...I'll be glad come GA (well maybe a month later<g>) when I
  962. can start making more room on my hard disk. 210 megs ain't as much as it used
  963. to be - especially with all 2.0's flavors, 1.3 and toolkit, MSC, C Set/2,
  964. Zortech, etc, etc, etc.
  965.  
  966. Rick
  967.  
  968. #: 77115 S14/Early Code
  969.     10-Mar-92  23:02:29
  970. Sb: #77052-Container Problems
  971. Fm: Wayne Kovsky 76164,3504
  972. To: Rick Fishman 72251,750
  973.  
  974. Rick, you probably DON'T want to do 'WinLoadDlg ()' for each of the pages
  975. during notebook initialization, unless you have a VERY small number of pages.
  976. Creating (inserting) the pages is relatively time-consuming as it is (that is,
  977. if you do nothing but create empty pages -- try it for, say, 20 or so pages,
  978. and you'll see).  If you additionally do 'WinLoadDlg ()' for each page, you
  979. will get a variety of messages sent to each dialog, specifically including
  980. 'WM_INITDLG', so a lot of processing could go on before your user sees the
  981. first notebook page dislayed.
  982.  
  983. I defer loading the page's dialog until the first time that page is accessed.
  984. You get a message from the notebook control (BKN_PAGESELECTED), telling you
  985. when a page is being made the current page (the message contains the old and
  986. new page ID's).  I check to see if the dialog has been loaded yet, and if not,
  987. I load it then.
  988.  
  989. In my use of notebooks (for settings), it is likely that at any given time, a
  990. user might touch only a couple of the pages, but I have somewhere between 15
  991. and 20 of them, so I can save the user a fair amount of time by only loading
  992. the ones he wants to see.  I keep a structure per page, with some status
  993. information that helps in stuff like this; it also helps in cleanup (in case
  994. of abnormal exit at that point, from the entire program).
  995.  
  996. Tequila sounds good -- Jose Cuervas Gold?  Alternately, you could give me some
  997. tips on the Container sorting problem that has me blocked right now... And,
  998. isn't it time a new section, "OS/2 2.x Programming", got started???
  999.  
  1000. #: 77427 S14/Early Code
  1001.     11-Mar-92  19:09:33
  1002. Sb: #77115-Container Problems
  1003. Fm: Rick Fishman 72251,750
  1004. To: Wayne Kovsky 76164,3504
  1005.  
  1006. Wayne, good advice on not loading the dialogs (that will be used as pages) all
  1007. at once. Even though the notebook I am going to do is only 3 pages so far, it
  1008. could grow and then I'd have to change my algorithm.
  1009.  
  1010.  >Alternately, you could give me some tips on the Container sorting problem
  1011. that has
  1012.  >me blocked right now...
  1013.  
  1014. I'm going to try and use CM_SORTRECORD in the next couple of days...I'll let
  1015. you know how it goes.
  1016.  
  1017. I agree about the "OS/2 2.x Programming" section. It seems like that would be
  1018. really popular! You'd at least have a 'Container' thread and a 'Notebook'
  1019. thread - even if 2 of the participants reeked of tequila and shlurred their
  1020. words<g>!
  1021.  
  1022. #: 77114 S14/Early Code
  1023.     10-Mar-92  23:02:18
  1024. Sb: #76740-Container Problems
  1025. Fm: Wayne Kovsky 76164,3504
  1026. To: Frank Castellucci 72261,2700
  1027.  
  1028. Frank, I agree; I am using all the controls you mentioned, and then some, in
  1029. notebooks.  Only things I am NOT using are containers (I am using them, but
  1030. not in a notebook) and selection sets.  I am even using the new fonts dialog
  1031. as a page in a notebook (the trick here is having a notebook page that is
  1032. large enough for it ...)
  1033.  
  1034. I had a LOT of trouble with notebooks when they first became available
  1035. (6.149???), but 6.177 fixed most of my problems, and 6.304 (and my recent
  1036. discovery about the importance of the owner window) solved the rest.  There
  1037. are a few things you have to do (via trial and error) to get "sensible"
  1038. behavior out of notebooks in some cases, and a few more things you have to do
  1039. to get decent performance (in particular, bringing up the notebook in the
  1040. first place), but all in all, this is (now, at least) a stable and eminently
  1041. usable control.
  1042.  
  1043. Containers are still a little behind this state of being, unfortunately ...
  1044.  
  1045. #: 77146 S14/Early Code
  1046.     11-Mar-92  04:39:52
  1047. Sb: #77114-Container Problems
  1048. Fm: Frank Castellucci 72261,2700
  1049. To: Wayne Kovsky 76164,3504
  1050.  
  1051.  
  1052. Not to mention we have de-railed the topic of this thread.
  1053.  
  1054. Containers, the most immediate use I can see would be to present application
  1055. specific objects ( files, etc.. ) to the user, with a value set tool kit
  1056. nearby somewhere so the object in the container can be dragged over a tool in
  1057. the value set. I don't have CUA'91 yet so I don't know if this is valid as far
  1058. as that goes.
  1059.  
  1060. BTW: The latest IBM Personal Develop mag has example of all the new controls
  1061. with example code for each, EXCEPT CONTAINERS!
  1062.  
  1063. It also includes the DAP letter to upgrade to .177, I got a kick out of this
  1064. one, someones a tad behind the times sending this stuff out so late.
  1065.  
  1066. Frank V. Castellucci C.O.L. Systems Inc.
  1067.  
  1068. #: 77113 S14/Early Code
  1069.     10-Mar-92  23:02:11
  1070. Sb: #76678-Container Problems
  1071. Fm: Wayne Kovsky 76164,3504
  1072. To: Rick Fishman 72251,750
  1073.  
  1074. Sorry I wasn't too clear, but it is a little hard to explain.  I have a client
  1075. window that is "vanilla" (like any client window you ever saw).  If you ask
  1076. that window (via a menu selection) to bring up "Settings", it loads a dialog
  1077. -- the dialog happens to be a notebook control, which you can define via
  1078. 'dlgedit'.  The notebook control/dialog needs a fair amount of additional work
  1079. to be useful -- you have to load the pages, establish the size of the tabs,
  1080. insert page text, etc.  You could load the notebook as another window, rather
  1081. than as a dialog (that is, you could use 'WinCreateWindow ()' instead of
  1082. 'WinLoadDlg ()'), and in fact there are some advantages to doing this, at
  1083. least in my app, so I am likely to switch.
  1084.  
  1085. All of this knowledge is "bleeding edge of technology" stuff; if there is any
  1086. documentation or examples (or even mentions) of using dialogs as pages in a
  1087. notebook (instead of canned text and/or icons, as in the toolkit example), I
  1088. haven't run across it.  I ran into all kinds of weirdness as I worked my way
  1089. through this; some of it was simply bugs in the early drivers (that is, I did
  1090. nothing to change weird behavior, but it went away with later compiles).  Some
  1091. of it is poor design (in particular, the way you manage pages with both major
  1092. and minor tabs); and some of it is incomplete documentation (the "owner
  1093. window" stuff, for example).  I have discovered a ton of "tricks", but
  1094. honestly I don't recall them any more.  If you run into any stumbling blocks,
  1095. send me a message; I have some pretty complex dialogs working now in my
  1096. settings notebook, and I am using just about every feature of notebooks,
  1097. successfully at last.
  1098.  
  1099. #: 75374 S14/Early Code
  1100.     06-Mar-92  00:18:41
  1101. Sb: #75338-Container Problems
  1102. Fm: Adam Goodman 100021,3161
  1103. To: Wayne Kovsky 76164,3504
  1104.  
  1105. Wayne,
  1106. As you say you are moving back to notebooks controls, I'd draw your attention
  1107. to the minor piece of confusion I posted 03/04/92 as "BKA_MAJOR (NBOOK
  1108. REGION)".  You'd probably already spotted it, and it is in an early version
  1109. (6.167):
  1110. Online help says to use BKA_MAJOR/BKA_MINOR to set dimensions of tabs, but the
  1111. header file has BKA_MAJORTAB / BKA_MINORTAB.
  1112. If you get a moment can you tell me whether this has been sorted out in later
  1113. releases,
  1114. Exciting, isn't it?!...
  1115.  
  1116. #: 75593 S14/Early Code
  1117.     06-Mar-92  19:52:23
  1118. Sb: #75374-#Container Problems
  1119. Fm: Wayne Kovsky 76164,3504
  1120. To: Adam Goodman 100021,3161
  1121.  
  1122. Adam, I had spotted that on-line documentation problem when I first got 6.167.
  1123. I reported it at the time, but I just checked and ... it is still wrong.
  1124.  
  1125. I have been using notebook controls since I first got 6.167, but  I have a
  1126. number of strange problems with them.  Some of those problems (like the
  1127. CFA_ULONG problem I had with containers) simply went away with later drops.
  1128. Others seem to still be here ... I wouldn't be at all surprised to find that
  1129. they are my problems, but the documentation is pretty skimpy, and the examples
  1130. too trivial (the one notebook example inserts one page of text and one page of
  1131. an icon, both of which are completely contained within the program).
  1132.  
  1133. I am using notebooks for setup, where I had been using dialogs whose
  1134. positioning and Z-ordering I managed within a setup window.  Last time I tried
  1135. them, they came up (looked real purty, too!), and I could move back and forth
  1136. among the pages at will.  Since I have a lot of pages (about 17 dialogs, as I
  1137. recall), it took too long to load; I found a way around that.  I also wanted
  1138. major tabs on all pages, but minor tabs on some; had to find a way around the
  1139. blank page that this requires (and I posted a request here a few weeks back,
  1140. that IBM alter the API so this workaround isn't necessary).
  1141.  
  1142.  
  1143. [More]
  1144.  
  1145. #: 75594 S14/Early Code
  1146.     06-Mar-92  19:52:32
  1147. Sb: #75593-Container Problems
  1148. Fm: Wayne Kovsky 76164,3504
  1149. To: Wayne Kovsky 76164,3504
  1150.  
  1151. [Continued]
  1152.  
  1153.  
  1154. All in all, notebooks look really good, not too difficult to use, etc.   BUT,
  1155. I have one major problem:  as soon as you hit a control in one of the dialogs
  1156. on one of these notebook pages, all behaves as it should (appropriate action
  1157. takes place according to what the control should do).  You can go to other
  1158. pages, and hit other controls, no problem.  As soon as you hit a second
  1159. control on a page that has already been hit, though, GP fault!  I am just
  1160. about to go back now to see if this remains a problem in this drop.  If it
  1161. still fails this way, I think I'm gonna need some help ... (the GP fault is in
  1162. the notebook's DLL, not in my code; I love these!).
  1163.  
  1164. By the way, these are the original dialogs, and they still work just fine in
  1165. the old method I used, so I am pretty sure the dialogs are not the problem; I
  1166. use the old stuffevery day to configure my program.  My guess is that this is
  1167. gonna be another head-slapper!
  1168.  
  1169. #: 75760 S14/Early Code
  1170.     07-Mar-92  09:44:44
  1171. Sb: #75374-Container Problems
  1172. Fm: Noel J. Bergman/DEVTECH 76704,34
  1173. To: Adam Goodman 100021,3161
  1174.  
  1175. Adam,
  1176.  
  1177. The product considerations says that the online docs describe GA, while the
  1178. headers describe current reality.
  1179.  
  1180.        --- Noel
  1181.  
  1182. #: 73431 S14/Early Code
  1183.     01-Mar-92  14:47:08
  1184. Sb: Sample Programs Bug Fix
  1185. Fm: Wayne Kovsky 76164,3504
  1186. To: Ian R. Ameline 70400,2356
  1187.  
  1188. Ian, there are some bugs in the 'style' demo program shipped with the 6.177
  1189. toolkit.  As shipped, the container demo shows nothing except a blank screen.
  1190. The reason is that a 'cb' field was added to some of the structures, and
  1191. 'sty_dlg.c' does not initialize those new fields.
  1192.  
  1193. The first fix is applied just before original line number 1786 (or anywhere in
  1194. this vicinity):
  1195.  
  1196.   recordInsert.cb = sizeof(RECORDINSERT) ;           // Added line.
  1197.   recordInsert.pRecordOrder = (PRECORDCORE)CMA_END;  // Original line.
  1198.  
  1199. This fixes the container so that records show in the icon, name and text
  1200. views, but still not in the detail view.  To fix that, add this line at
  1201. original line 1819:
  1202.  
  1203.   fieldInfoInsert.cb = sizeof(FIELDINFOINSERT) ;     // Added line.
  1204.   fieldInfoInsert.pFieldInfoOrder = (PFIELDINFO)CMA_FIRST;  // Original.
  1205.  
  1206. Now, I hope you will read my message in this forum about problems with the
  1207. detail view of containers ...
  1208.  
  1209. #: 73432 S14/Early Code
  1210.     01-Mar-92  14:47:15
  1211. Sb: FIELDOFFSET Bug
  1212. Fm: Wayne Kovsky 76164,3504
  1213. To: Ian R. Ameline 70400,2356
  1214.  
  1215. Ian, in the 6.177 toolkit, the FIELDOFFSET macro is defined in three different
  1216. header files:  BASEMAC.H, OS2DEF.H, and OS2DEF16.H.  I think that the
  1217. definition in OS2DEF.H is incorrect:  it has the result cast to a SHORT (just
  1218. as OS2DEF16.h does, although that is probably correct for 16-bit headers,
  1219. unless it should be a USHORT); I believe the OS2DEF.H definition should be a
  1220. ULONG, as it is in BASEMAC.H.
  1221.  
  1222. I was looking closely at this macro, trying to figure out what is causing my
  1223. container details view to abort.  Unfortunately, this had nothing to do with
  1224. it ... I don't have any structures where offsets would exceed the capacity of
  1225. either a SHORT or a USHORT.  Just thought IBM should know.
  1226.  
  1227. #: 73434 S14/Early Code
  1228.     01-Mar-92  14:47:32
  1229. Sb: Container Sorting
  1230. Fm: Wayne Kovsky 76164,3504
  1231. To: Ian R. Ameline 70400,2356
  1232.  
  1233. Ian, in addition to my problems displaying a container in details mode, I am
  1234. having a problem with sorting.  The CM_SORTRECORD message takes as one
  1235. parameter a PVOID that points to user storage.  I am trying to use that to
  1236. pass an allocated structure to the 'Compare ()' function (whose address is
  1237. passed as the other parameter of this message).  However, when I enter the
  1238. compare function, the PVOID that is the third parameter to that function is
  1239. not the address I expect (nor does it point to an address that I expect).
  1240.  
  1241. I have tried passing my address in different ways:  for example, as the actual
  1242. pointer to the structure, or as the address of a pointer to the structure.  Do
  1243. you have any idea how to use this field (or can you pass this message to
  1244. someone who works in this area)?
  1245.  
  1246. #: 79022 S14/Early Code
  1247.     15-Mar-92  18:03:07
  1248. Sb: Container Sorting
  1249. Fm: Wayne Kovsky 76164,3504
  1250. To: Rick Fishman 72251,750
  1251.  
  1252. Rick, sorting is now working great here; thanks for the tip on the _System
  1253. designation of the comparison function.  Once I had that, sorting of dates,
  1254. times and ULONGs fell into place immediately; I had to do one more "rev" to
  1255. get strings right (I was missing one level of indirection).
  1256.  
  1257. Now if I could just find some magic wand to make container loading go a little
  1258. faster; even with only a (relative) handful of records (fewer than a hundred),
  1259. the time from "Go!" to first display is almost 25 seconds.  I think the
  1260. majority of this time is spent in loading an icon for each record (I'll
  1261. confirm with a test sometime soon), but that is something that my app calls
  1262. for, so I gotta do it.  I know about the 'delta' option of containers, but the
  1263. docs say this is for "thousands" of records, and that it isn't necessary for
  1264. smaller quantities of records.  I think I am going to have to use this option
  1265. anyway, and after getting a page, let a thread continue to fill the container,
  1266. then readjust the delta back to zero.
  1267.  
  1268. Just thinking out loud here ... let me know if you are NOT seeing long delays
  1269. on container fills.  I can read these same files and display them in my own
  1270. window in just a second or two, versus 25 seconds for containers; that kind of
  1271. delay just isn't gonna fly unless I can hide it in a background thread.
  1272.  
  1273. Thanks again!
  1274.  
  1275. #: 79083 S14/Early Code
  1276.     15-Mar-92  23:51:31
  1277. Sb: #79022-Container Sorting
  1278. Fm: Rick Fishman 72251,750
  1279. To: Wayne Kovsky 76164,3504 (X)
  1280.  
  1281. Wayne, good to see sorting is now working. Yeah, I am seeing long load times
  1282. also. It is especially noticeable to me because I am using a container as a
  1283. split-listbox so the performance hit versus just a regular listbox is pretty
  1284. bad. I think you'll also notice that scrolling in a details view both
  1285. vertically and horizontally is slow. Notice how slow the hilite bar is if you
  1286. hold the mouse down and drag it.
  1287.  
  1288. The good thing is that the performance has gotten better (details view) on
  1289. each release. I'm hoping they do some optimization come GA.
  1290.  
  1291. Rick
  1292.  
  1293. #: 79190 S14/Early Code
  1294.     16-Mar-92  08:22:27
  1295. Sb: #79083-Container Sorting
  1296. Fm: Wayne Kovsky 76164,3504
  1297. To: Rick Fishman 72251,750
  1298.  
  1299. Rick, as promised, I did a test to see how loading the icons affects the "fill
  1300. the container" times.  My test had three measurement points.  First, I
  1301. measured (a coarse measure:  I used a stopwatch on a system that was running
  1302. only my program) the time to load the container, with each record having a
  1303. unique icon that had to be loaded for it.  This is the way my app normally
  1304. works -- except that I "stacked the deck" in favor of performance just for
  1305. this test, by having every record load the SAME icon; this filters out the
  1306. file system from the equation.  I use 'WinLoadFileIcon ()'.
  1307.  
  1308. Next, I altered the program to use the program's icon for every record -that
  1309. is, I only had to set a pointer to the icon, rather than load a new icon, for
  1310. every record.  Finally, I measured the time it took to read and format the
  1311. same file, but to put each record into a standard window, one record per line.
  1312. The file contains 20,776 bytes (with a small header, probably less than 100
  1313. bytes), and something like 75 records.  Here are the results:
  1314.  
  1315.     Container load, 'WinLoadFileIcon ()' per record:  25.8 seconds
  1316.     Container load, program's icon per record:        12.2 seconds
  1317.     Window load, program's icon per record:            1.4 seconds
  1318.  
  1319. This is worse than I had expected, and needs some aggressive attention from
  1320. IBM.  The 32-bit PM stuff will help some, but I don't expect an order of
  1321. magnitude improvement from just that!  I imagine containers have a lot of
  1322. potential for tuning, given their newness to 2.0, so I'm not particularly
  1323. worried about it -- however, it does mean I am going to have to write a lot of
  1324. extra code so that I can "hide" this performance deficit from the user, until
  1325. it is fixed.  (And yes, I have noticed the slowness in scrolling as well -- it
  1326. looks like the work of a PM rookie.)  Since containers are at the heart of
  1327. WPS, I imagine this will get the attention it deserves, and quickly.
  1328.  
  1329. #: 79477 S14/Early Code
  1330.     16-Mar-92  21:06:14
  1331. Sb: #79190-Container Sorting
  1332. Fm: Rick Fishman 72251,750
  1333. To: Wayne Kovsky 76164,3504
  1334.  
  1335. Wayne, interesting numbers. It's starting to make me realize that I've got to
  1336. measure the performance of my details-view container after GA to determine if
  1337. it would be better to develop my own split-listbox rather than rely on the
  1338. container to deliver that functionality. It looks like your performance
  1339. measurement on using just one icon is equivalent to loading a details-view
  1340. container. 12.2 seconds for 75 records is pretty horrible - can't expect a
  1341. user to like that. It means that  multi-threading the loading of the container
  1342. would become a necessity - even for small amounts or records.
  1343.  
  1344. Here's hoping we get some serious performance dudes in on optimizing the
  1345. container code!
  1346.  
  1347. "WinLoadFileIcon" - good catch. Where'd you find it? It's not listed in the
  1348. online doc 'contents' window, but I can find the 'syntax' window on a search.
  1349. U been scanning the header files (I've got to do that when I've got the time)
  1350. or do you have the hardcopy docs?
  1351.  
  1352. BTW, just got the hardcopy programming guides ( not the hardcopy references ).
  1353. I'm VERY disappointed - they don't give much more info than we already know
  1354. and don't even address the tidbits we found out ourselves - they don't even go
  1355. into CM_SORTRECORD. I DID notice that deltas are not supported in the icon
  1356. view.
  1357.  
  1358. Rick
  1359.  
  1360. #: 79655 S14/Early Code
  1361.     17-Mar-92  08:31:48
  1362. Sb: #79477-Container Sorting
  1363. Fm: Wayne Kovsky 76164,3504
  1364. To: Rick Fishman 72251,750
  1365.  
  1366. On 'WinLoadFileIcon ()' -- I found it in the on-line docs, but not under
  1367. "Window Functions"; it is under "Workplace Functions".  You will find a few
  1368. other "interesting" functions in that section.
  1369.  
  1370. On my posted numbers, you should not look at them as absolutes (as in,
  1371. "sheesh, it takes 12.2 seconds to load 75 records"), but rather as
  1372. relationships ("sheesh, it takes 10 times longer to fill and display a
  1373. container than to fill and display a buffer").  I deliberately picked a test
  1374. that took an inordinately long time (because of a lot of extra processing that
  1375. is going on per record), in order to give me larger numbers whose ratios were
  1376. more obvious.  In other words, if I had a simple "read - move - post
  1377. CM_INSERTRECORD" loop with only 75 records, the times might have been quicker
  1378. than my stopwatch finger.  What is significant is that both the container
  1379. version and the non-container version go through identical code right up to
  1380. the CM_INSERTRECORD statement; then, the non-container version puts the
  1381. prepared record into a memory buffer from which the window proc will later
  1382. paint it onto the screen.
  1383.  
  1384. What is also significant is that the container version takes almost exactly
  1385. twice as long when you add exactly one statement:  'WinLoadFileIcon ()' (per
  1386. record), even when that statement goes after exactly the SAME icon each time
  1387. (which should largely negate file system impact, after the first icon is found
  1388. and loaded).  I differ with you slightly on your conclusion:  I conclude that
  1389. multi-threading absolutely IS a necessity for loading a container, even for as
  1390. few as 25 or so records.
  1391.  
  1392. How did you get the hardcopy programming guides?  I am a member of DAP, 32-bit
  1393. Expedite, and EADP -- is there somebody I have to BRIBE as well?
  1394.  
  1395. #: 80415 S14/Early Code
  1396.     18-Mar-92  21:26:44
  1397. Sb: #79655-Container Sorting
  1398. Fm: Rick Fishman 72251,750
  1399. To: Wayne Kovsky 76164,3504
  1400.  
  1401. Wayne, thanks for the tip on the progref Workplace functions. Maybe the reason
  1402. for the performance problem of the WinLoadFileIcon API is the number of steps
  1403. it takes to find the icon. The docs say that first it looks for an .ICON
  1404. extended attribute, then searches the exe's directory for a file with the same
  1405. prefix and a .ICO extension, then it looks in the EXE header. If your icon is
  1406. in the EXE header and your EXE were located in a directory with many files in
  1407. it (BIG assumption, I know <g>), the API would first search the EA's then do a
  1408. DosFindFirst, DosFindNext loop, then go to the EXE header. Also, if you don't
  1409. pass the fully qualified path of the EXE file, it would need to do a
  1410. DosSearchPath. Plenty of opportunity for time lag.
  1411.  
  1412.  >How did you get the hardcopy programming guides?  I am a member of DAP,
  1413. 32-bit
  1414.  >Expedite, and EADP -- is there somebody I have to BRIBE as well?
  1415.  
  1416. These were announced along with all the beta drops. I ordered them during the
  1417. 6.177 drop and paid I think $199 for the package that gives you the CUA
  1418. guides, Rexx users guide and PM, GPI, Control Program programming guides,
  1419. although I heard they've gotten considerably cheaper since then :(
  1420.  
  1421. You should be able to order them through the 800-426-3040 line. They are part
  1422. of the technical library and are 'pre-release' versions with no upgrade at GA.
  1423. You can probably get the production copies pretty soon. The hardcopy
  1424. programming references are also available - don't know how much they are tho.
  1425.  
  1426. #: 80544 S14/Early Code
  1427.     19-Mar-92  09:33:51
  1428. Sb: #80415-Container Sorting
  1429. Fm: Wayne Kovsky 76164,3504
  1430. To: Rick Fishman 72251,750
  1431.  
  1432. As it happens, Rick, the *.ico file I am loading is in the directory where I
  1433. keep my sources, makefiles, etc.  The number of files stored in that directory
  1434. varies hugely, depending on what I am working on at the time, but right this
  1435. minute has 161 files.  Next time I have some spare time (Ha!), I'll put the
  1436. *.ico file into its own directory and try my test again.  I don't really think
  1437. it will matter that much (the *.ico file has an EA, so it should be found
  1438. immediately), but you never know ...
  1439.  
  1440. Also, I hope they are not really doing a 'DosFindFirst ()/DosFindNext ()'
  1441. LOOP.  With OS/2 memory management, it would be better to NOT find a file at a
  1442. time, but rather to provide a buffer large enough to find them ALL in one
  1443. swell foop (I have run tests to confirm this hypothesis).
  1444.  
  1445. I didn't realize the hardcopy guides you were talking about were the $199 doc
  1446. set; I have that already.
  1447.  
  1448. #: 80894 S14/Early Code
  1449.     19-Mar-92  23:29:12
  1450. Sb: #80544-Container Sorting
  1451. Fm: Rick Fishman 72251,750
  1452. To: Wayne Kovsky 76164,3504
  1453.  
  1454.  >Also, I hope they are not really doing a 'DosFindFirst ()/DosFindNext ()'
  1455. LOOP.  With
  1456.  >OS/2 memory management, it would be better to NOT find a file at a time, but
  1457. rather
  1458.  >to provide a buffer large enough to find them ALL in one swell foop (I have
  1459. run tests
  1460.  >to confirm this hypothesis).
  1461.  
  1462. Good point, Wayne. That should minimize the disk I/O.
  1463.  
  1464.  >I didn't realize the hardcopy guides you were talking about were the $199
  1465. doc set; I
  1466.  >have that already.
  1467.  
  1468. I heard that the price came down. I hope you didn't do the "I've got to have
  1469. them" like I did and pay the full $199. Although judging from one of your
  1470. messages that I read you're probably as bad as I am about wanting as much doc
  1471. as you can get <g>.
  1472.  
  1473. #: 79185 S14/Early Code
  1474.     16-Mar-92  08:21:20
  1475. Sb: #79022-Container Sorting
  1476. Fm: Lynn Teska 72361,1113
  1477. To: Wayne Kovsky 76164,3504
  1478.  
  1479. Are you at 6.177? 304 is MUCH faster here. Lynn
  1480.  
  1481. #: 79240 S14/Early Code
  1482.     16-Mar-92  10:40:28
  1483. Sb: #79185-Container Sorting
  1484. Fm: Wayne Kovsky 76164,3504
  1485. To: Lynn Teska 72361,1113
  1486.  
  1487. Yes, Lynn, I am on 6.304.  When you say 304 is "MUCH faster here", do you mean
  1488. that you have done similar tests, and the relative differences between them
  1489. are not as great as I reported?  If so, please post your results.  If you
  1490. haven't done such tests, then perhaps what you really mean is that your system
  1491. (which is different from mine) runs your apps (which are different from mine)
  1492. much faster than I report; I wouldn't be surprised.
  1493.  
  1494. The test results that I reported were not done in a sufficiently rigorous
  1495. manner that they should be taken as absolutes.  I did the timing with a
  1496. stopwatch (notoriously subject to error), and I was not careful with things
  1497. such as disk fragmentation between runs.  Nor did I post the contents of the
  1498. records that are being put into the container, nor did I describe the
  1499. processing that must be accomplished to convert disk-stored records into
  1500. displayable records suitable for a container.  All in all, if this were an
  1501. attempt at a repeatable, good-for-any-configuration benchmark, I would be
  1502. pretty ashamed of such sloppy work.
  1503.  
  1504. However ... for a moderately controlled, reasonable approximation of the
  1505. "cost" of filling a container with displayable records versus filling a window
  1506. with the same displayable records, and the additional "cost" of loading an
  1507. icon per record, I think my numbers will be repeatable in their ratios, and it
  1508. is those ratios (relative performance) that I was trying to show, and that are
  1509. the problem.  My results show about an order of magnitude cost to use a
  1510. container (versus fill a buffer and display it, and ignoring the cost of
  1511. loading icons).  If you have results that are, say, 50 percent better, I
  1512. wouldn't be surprised, since you are not running my tests on my hardware --
  1513. but that is still a pretty high performance cost.  If you have tests that seem
  1514. to show a negligible cost, please post them, and your methods for obtaining
  1515. them; your experience differs from ours.
  1516.  
  1517. #: 79639 S14/Early Code
  1518.     17-Mar-92  07:47:57
  1519. Sb: #79240-#Container Sorting
  1520. Fm: Lynn Teska 72361,1113
  1521. To: Wayne Kovsky 76164,3504 (X)
  1522.  
  1523. I mean to say that 304 is much faster than 177, thats all. Lynn
  1524.  
  1525. #: 79664 S14/Early Code
  1526.     17-Mar-92  08:59:39
  1527. Sb: #79639-Container Sorting
  1528. Fm: Wayne Kovsky 76164,3504
  1529. To: Lynn Teska 72361,1113
  1530.  
  1531. Lynn, there aren't that many folks around who seem to be using containers yet,
  1532. so please, give us more information about your experiences.
  1533.  
  1534. For example, in my testing, I am inserting all the container records in one
  1535. swell foop, rather than one at a time.  Are you doing it differently?  In
  1536. addition, I am using CMA_END to add records at the end of the record chain,
  1537. and I am using NULL as the parent record address.  Might it be faster to
  1538. specify a record address AND insert records one at a time?  (Depending on how
  1539. the container code is written, either of these methods could logically be
  1540. faster than the other.)
  1541.  
  1542. I did try some of these experiments, but not since 6.177, and not as carefully
  1543. as I could do now (I was still learning how to use containers at that point).
  1544. So far, it is only Rick and I discussing these issues; since you are using
  1545. containers, please joinin and give us the benefit of YOUR experience.
  1546.  
  1547. #: 80229 S14/Early Code
  1548.     18-Mar-92  15:57:39
  1549. Sb: #79664-Container Sorting
  1550. Fm: Lynn Teska 72361,1113
  1551. To: Wayne Kovsky 76164,3504 (X)
  1552.  
  1553. Wayne: Sorry you missed my point. I am not programming containers, since I
  1554. don't have the C/Set2. Still using M$ C6.  I, however am using 304 and the
  1555. containers that the system uses in 304 appear much faster than 177.  But,
  1556. obviously not fast enough, for you (or me) yet.  I will have to wait till
  1557. after GA to check out the containers, from the programing standpoint. Since
  1558. the EADP closed 3-1-92, and they didn't call me back. FWIW Lynn
  1559.  
  1560. #: 80273 S14/Early Code
  1561.     18-Mar-92  18:02:20
  1562. Sb: #80229-Container Sorting
  1563. Fm: Wayne Kovsky 76164,3504
  1564. To: Lynn Teska 72361,1113
  1565.  
  1566. Lynn, I would call again on the EADP.  I have reason to believe that it may
  1567. not really be "closed", although you are correct that the official closing
  1568. date has passed.  This is a really good deal, for $750 you get a paid-up
  1569. license to OS/2 2.0, C Set/2, WorkFrame/2, the programming toolkit (headers
  1570. and libraries and tools), Mirrors, Oasis, etc.  For the price of an 800-number
  1571. call <g>, it would be worth one more try.
  1572.  
  1573. I agree with you that containers are faster at 6.304 than at 6.177, but they
  1574. are still very slow (as you note).  I think that a speedup here will do more
  1575. for the enthusiasm people have for WPS than anything else (including making it
  1576. multi-threaded, although that is also a crucial need).
  1577.  
  1578. If you get the toolkit and do start getting into this stuff, jump right in;
  1579. there are a lot of pitfalls and some of us "scarred veterans" can steer you
  1580. around most of them now.
  1581.  
  1582. #: 73435 S14/Early Code
  1583.     01-Mar-92  14:47:43
  1584. Sb: Container Details View
  1585. Fm: Wayne Kovsky 76164,3504
  1586. To: Ian R. Ameline 70400,2356
  1587.  
  1588. Ian, after this message, I will leave you alone for awhile ...
  1589.  
  1590. I am having tremendous difficulty tracking down a bug in trying to display a
  1591. details view of my container.  I can show records in Icon, Name or Text views
  1592. with no problem.  However, as soon as I try to display in Details view, I get
  1593. the following error:
  1594.  
  1595.  General Protection Fault exception occurred at EIP = 197D5DC0 on thread 0001.
  1596.  Register Dump at point of exception:
  1597.  EAX = 00312020    EBX = 000000BA  ECX = 00000000    EDX = 00000006
  1598.  EBP = 00060001    EDI = 00060000  ESI = 00063C04    ESP = 00063BB4 CS =
  1599. 005B  CSLIM = 1BFFFFFF   DS =     0053  DSLIM = 1BFFFFFF ES =     0053  ESLIM
  1600. = 1BFFFFFF   FS =     150B  FSLIM = 00000030 GS =     DFFC  GSLIM = 00000000
  1601. SS =     006B  SSLIM = 1BFFFFFF
  1602.  Process terminating.
  1603.  
  1604. This is in the container DLL, not in my code.  I have reached the limit of my
  1605. ability to debug this.  I have examined every related structure, both at the
  1606. source code level and with IPMD during execution, paying particular attention
  1607. to pointers, offsets, lengths and such.  My code looks very much like the
  1608. 'style' sample code for containers, with one large exception:  I define the
  1609. fields one time, BEFORE I load the records; 'style' loads records, then
  1610. defines fields.  (My code will load different files at different times, and I
  1611. did not want to redefine fields each time.)
  1612.  
  1613. Can you (or someone) tell me what I should be looking at, based on this
  1614. termination message?  Help, please!
  1615.  
  1616. #: 73682 S14/Early Code
  1617.     02-Mar-92  09:38:41
  1618. Sb: #73435-Container Details View
  1619. Fm: Ian R. Ameline (IBM C) 70400,2356
  1620. To: Wayne Kovsky 76164,3504 (X)
  1621.  
  1622. Wayne,
  1623.  
  1624.    I'll forward your toolkit comments to the guy responsible for the
  1625. toolkit. FOr your PM/WPS problems, Steve (from PM development) can probably
  1626. help you much better than I can. I haven't yet had a chance to play with the
  1627. new control goodies on 2.0.
  1628.  
  1629. Regards,
  1630. Ian.
  1631.  
  1632. #: 73728 S14/Early Code
  1633.     02-Mar-92  10:53:54
  1634. Sb: #73682-Container Details View
  1635. Fm: Wayne Kovsky 76164,3504
  1636. To: Ian R. Ameline (IBM C) 70400,2356 (X)
  1637.  
  1638. OK, thanks, Ian.  Can you give me Steve's full name and CServe ID?  I recall
  1639. seeing him on here, but don't have that information.  What's in it for you?
  1640. You won't get eight messages from me tomorrow!
  1641.  
  1642. #: 74072 S14/Early Code
  1643.     03-Mar-92  01:53:57
  1644. Sb: #73728-#Container Details View
  1645. Fm: Alan DuBoff(Bunker Hill) 76662,660
  1646. To: Wayne Kovsky 76164,3504
  1647.  
  1648. Wayne,
  1649.  
  1650. In case it's a couple days before Ian gets back to you, her was refering to:
  1651. Steve Woodward 76525,1266.
  1652.  
  1653. ajd
  1654.  
  1655. #: 74163 S14/Early Code
  1656.     03-Mar-92  10:18:05
  1657. Sb: #74072-Container Details View
  1658. Fm: Alan DuBoff(Bunker Hill) 76662,660
  1659. To: Alan DuBoff(Bunker Hill) 76662,660
  1660.  
  1661. >In case it's a couple days before Ian gets back to you, her was refering
  1662. >to: Steve Woodward 76525,1266.
  1663.  
  1664. You idiot! You referred to Ian as *HER*, Ian is going to be mad at you
  1665. now...
  1666.  
  1667. ajd
  1668.  
  1669. #: 74276 S14/Early Code
  1670.     03-Mar-92  14:20:52
  1671. Sb: #74163-Container Details View
  1672. Fm: Ian R. Ameline (IBM C) 70400,2356
  1673. To: Alan DuBoff(Bunker Hill) 76662,660
  1674.  
  1675. >"Ian is going to be mad...."
  1676.  
  1677.    Ian has very thick skin. (But don't push me too far <g>)
  1678.  
  1679. #: 73447 S3/Ver. 1.x Developers
  1680.     01-Mar-92  15:01:45
  1681. Sb: #73412-Vanishing Controls
  1682. Fm: Wayne Kovsky 76164,3504
  1683. To: Dirk van Wie 100014,246
  1684.  
  1685. Dirk, it is probably way too late to suggest this, given the timeframes you
  1686. mentioned, but I will suggest it anyway:  your application sounds like it was
  1687. just made for containers.  You could show all the columns from which a user
  1688. might choose, and then as they selected columns that they do not want, you
  1689. could hide those columns (a simple message to the container control, after
  1690. setting the right structure).  All of the mucking about with showing or hiding
  1691. windows is handled by the container.  In addition, the container controlhas a
  1692. 'delta' built into it, which anticipates and allows for use in a database.
  1693. Basically, you set the delta, and you get a message when the displayed records
  1694. are getting near the end of your data; at that point you load more.
  1695.  
  1696. Even if it is too late for tis project, I urge you to read the documentation
  1697. on containers very carefully for your next project.  This is probably the
  1698. slickest control in PM, and I think it hasn't attracted very much attention
  1699. yet.
  1700.  
  1701. Sorry I couldn't help on your current problem.
  1702.  
  1703. #: 73754 S3/Ver. 1.x Developers
  1704.     02-Mar-92  12:18:17
  1705. Sb: #73447-Vanishing Controls
  1706. Fm: Dirk van Wie 100014,246
  1707. To: Wayne Kovsky 76164,3504
  1708.  
  1709.  
  1710. Wayne,
  1711.  
  1712. thanks for the inspiration on containers.  Since I am one of the CLONE PEOPLE
  1713. left behind since 6.149 I haven't had a chance to experiment with containers
  1714. except at several demos. I would love to try this out.  Perhaps 304 will
  1715. finally install on my EISA 486; if not I will have to wait until Adaptec
  1716. releases workable drivers.  Where are containers documented ? Is that part of
  1717. SOM ?
  1718.  
  1719. #: 73901 S3/Ver. 1.x Developers
  1720.     02-Mar-92  18:11:33
  1721. Sb: #73754-Vanishing Controls
  1722. Fm: Wayne Kovsky 76164,3504
  1723. To: Dirk van Wie 100014,246
  1724.  
  1725. I think containers didn't come in until 6.167, but I don't recall for sure.
  1726. They are part of the standard Presentation Manager API, but they also figure
  1727. prominently in SOM.  They are documented on-line (somewhat incompletely and
  1728. somewhat inaccurately; you need to read the structure definitions in
  1729. 'pmstddlg.h' to get the complete picture), and they are documented in "IBM
  1730. OS/2 2.0 Programming Guide Volume II, Presentation Manager Programming
  1731. Interface".  That manual may or may not be part of the standard 2.0 toolkit
  1732. documentation set -- I bought some extra manuals that were not part of that
  1733. set, and I don't know which are which.
  1734.  
  1735. In addition, in 'toolkit\c\samples\style' is a suite of C sources that
  1736. implement a (very elementary) container -- and that, with a couple of bugs
  1737. that make the container not show up at all.  I posted a note to Ian Ameline on
  1738. that subject, including the fix; it should still be here if you scan for it.
  1739.  
  1740. When you get 6.304, you will find that the WPS is itself a container, as are
  1741. all the folders.  The container allows different "views" of its contents, such
  1742. as Icon, Name (icon + text), Text, Tree and Detail.  In all of these views,
  1743. text that is part of the container display can be directly edited (providing
  1744. the progammer has allowed for handling the messages); the container can be
  1745. sorted or searched; records can be inserted/deleted; fields can be made
  1746. invisible or protected from editing; drag and drop can be supported (by
  1747. handling the messages); records can be selected by any of several methods
  1748. (marquee selection, swipe selection, etc.); multiple or single selection is
  1749. supported; I could go on and on.  Take a look when you get your kit installed
  1750. (and good luck!).
  1751.  
  1752. #: 74286 S3/Ver. 1.x Developers
  1753.     03-Mar-92  15:08:17
  1754. Sb: #73901-Vanishing Controls
  1755. Fm: Dirk van Wie 100014,246
  1756. To: Wayne Kovsky 76164,3504
  1757.  
  1758.  
  1759. Wayne,
  1760.  
  1761. I was notified that I will be sent all tools and OS/2 beta on a CD-ROM
  1762. diskette.  Which CD-ROM drive are you using ?
  1763.  
  1764. Thanks for the info on Containers.
  1765.  
  1766. Dirk
  1767.  
  1768. #: 80290 S14/Early Code
  1769.     18-Mar-92  18:32:33
  1770. Sb: Container Editing
  1771. Fm: Wayne Kovsky 76164,3504
  1772. To: Rick Fishman 72251,750
  1773.  
  1774. He's baaaaaaack!
  1775.  
  1776. Now that sorting containers is all sorted out, I have moved on to direct
  1777. editing, where there are yet more surprises.  In the hope that you have
  1778. already earned your scars in this area, I turn to you yet again for advice!
  1779.  
  1780. I get the CN_BEGINEDIT message, which is nearly useless; I simply set a flag
  1781. to remind me NOT to send the container any messages until we are done.  The
  1782. CN_REALLOCPSZ looks like it has the "meat" of this message sequence -- but, it
  1783. turns out that the 'ppszText' field of the CNREDITDATA structure points to the
  1784. ORIGINAL contents of the container record.  This message allows you to say
  1785. "yes" or "no" (via return code) to allowing the editing, but you don't yet
  1786. know whether the changed data meets all requirements for allowing it to
  1787. replace the existing data, because you haven't seen the new data yet.
  1788.  
  1789. OK, thinks I, I'll verify it on the CN_ENDEDIT message, and disallow the
  1790. change at that point if necessary.  This is not a wonderful idea, though,
  1791. since there is no way to return a "FOR GOD'S SAKE, DON'T DO IT!!!" return code
  1792. to this message; the fat lady has already sung.  You DO get to see the changed
  1793. data with this message, for all the good it does you.  I can think of ways to
  1794. "cheat" here, but I think I must be missing something that would allow me to
  1795. do it "The Cowboy Way" (I hope you are a Writers in the Sky fan, or that might
  1796. be pretty obscure).
  1797.  
  1798. So, the old forehead could use another good slap, Rick.  Tell me that you've
  1799. already crawled through this, and show me the error of my ways.  (By the way,
  1800. once you know what to look for, the on-line documentation says very clearly
  1801. what 'ppszText' points to at what point in time.  Look under 'CN_ENDEDIT',
  1802. then 'parameters', then 'CNREDITDATA', the 'ppszText', and there it is, bigger
  1803. than Dallas and twice as ugly.)
  1804.  
  1805. #: 80416 S14/Early Code
  1806.     18-Mar-92  21:26:58
  1807. Sb: #80290-Container Editing
  1808. Fm: Rick Fishman 72251,750
  1809. To: Wayne Kovsky 76164,3504
  1810.  
  1811. Wayne, sorry but I haven't yet coded for direct editing but I have thought
  1812. about it a lot. I thought it sounded great at first but then I thought of a
  1813. couple of issues and decided at first to make my text read-only until I came
  1814. up with solutions. As you pointed out, there is no built-in way to edit the
  1815. new text string before deciding whether or not to allow it (I don't think you
  1816. are missing anything - I THINK it's just not possible). I figured that during
  1817. the REALLOCPSZ notify message I'd get the window handle of the MLE by
  1818. enumerating the child windows of the container and finding one with the MLE
  1819. window class. Then I'd query the text and know what to return from the
  1820. REALLOCPSZ message. I know - kludgy.
  1821.  
  1822. But the main problem is that there doesn't seem to be a way to set the text
  1823. limit of the MLE unless it is already created by the time the BEGINEDIT notify
  1824. message is sent and I enumerate during that message.
  1825.  
  1826. You'd think that the window handle of the MLE would be in the CNREDITDATA
  1827. structure, wouldn't you?
  1828.  
  1829. Big issue: I am allocating the memory for my strings by using the
  1830. CM_ALLOCRECORD message with extra bytes for the strings. This allows me to use
  1831. the CM_REMOVERECORD with the CMA_FREE flag with a 0 for number of records and
  1832. in one shot all records are removed and all memory freed so I don't need any
  1833. application heap maintenance for the container items. Only problem with this
  1834. is there is no CM_REALLOCRECORD message, so with direct editing I'd have to
  1835. come up with a way around this (something like REMOVERECORD, FREERECORD,
  1836. ALLOCRECORD, INSERTRECORD when the size of the string changed).
  1837.  
  1838. Boy, we REALLY need a 2.0 programming section, don't we?
  1839.  
  1840. #: 80547 S14/Early Code
  1841.     19-Mar-92  09:34:00
  1842. Sb: #80416-Container Editing
  1843. Fm: Wayne Kovsky 76164,3504
  1844. To: Rick Fishman 72251,750
  1845.  
  1846. Sheesh, Rick, I wish you were just down the hall or something; I think you and
  1847. I could have some great conversations.
  1848.  
  1849. Here's another tip for when you DO get around to direct editing:  the
  1850. CN_REALLOCPSZ message passes the size of the field needed to contain the NEW
  1851. data (while returning a pointer to the OLD data ... go figure); this is the
  1852. 'cbText' field of the CNREDITDATA structure).
  1853.  
  1854. However, that size is NOT the size you would get from 'strlen ()' as you would
  1855. expect (or at least, as I did expect).  It seems to include the string
  1856. terminator.  Thus, if someone is changing an 'A' to an 'AB', the length passed
  1857. to you by CN_REALLOCPSZ is 3; I expected 2.
  1858.  
  1859. Getting the handle to the MLE:  that should work.  Another way to "cheat" is
  1860. to change the data in the container's copy of the record, during or after the
  1861. CN_ENDEDIT message (I haven't tried it yet; if it doesn't work DURING the
  1862. message, I will just post a WM_USER message to myself and do it later). The
  1863. problem is that none of this should be necessary ... we need a little more
  1864. functionality in the API.
  1865.  
  1866. #: 80895 S14/Early Code
  1867.     19-Mar-92  23:29:18
  1868. Sb: #80547-Container Editing
  1869. Fm: Rick Fishman 72251,750
  1870. To: Wayne Kovsky 76164,3504
  1871.  
  1872. Wayne, agreed about needing more functionality in the API. There are
  1873. definitely some rough edges. Boy, I wish I had more time to work on my 2.0
  1874. stuff. I have a contract doing a 1.3 app and that is taking most of my time.
  1875. I'd really like to start digging into my 2.0 code so I could complete the
  1876. container functionality, add the notebook, etc. You sound like you're REALLY
  1877. making progress. A little battle-weary maybe, but I bet you're loving it<g>!
  1878.  
  1879. #: 81026 S14/Early Code
  1880.     20-Mar-92  11:09:40
  1881. Sb: #80895-Container Editing
  1882. Fm: Wayne Kovsky 76164,3504
  1883. To: Rick Fishman 72251,750
  1884.  
  1885. "... but I bet you're loving it<g>!"
  1886.  
  1887. Yeah ... 'cause it feels so good when I stop!
  1888.  
  1889. #: 81227 S14/Early Code
  1890.     20-Mar-92  20:48:24
  1891. Sb: #81026-#Container Editing
  1892. Fm: Rick Fishman 72251,750
  1893. To: Wayne Kovsky 76164,3504 (X)
  1894.  
  1895. Wayne, FYI, in case you haven't found it - I just noticed CID_MLE in
  1896. pmstddlg.h that can be used during any of the Direct Editing messages. At
  1897. least it makes it easy to get the hwnd of the MLE using WinWindowFromID. That
  1898. should make it possible to set the text limit of the MLE and query its text.
  1899. Will try this later.
  1900.  
  1901. The zombie message you mentioned - probably some real pearl of wisdom. If only
  1902. I could remember what it was...<g>.
  1903.  
  1904. #: 81255 S14/Early Code
  1905.     20-Mar-92  22:11:09
  1906. Sb: #81227-Container Editing
  1907. Fm: Wayne Kovsky 76164,3504
  1908. To: Rick Fishman 72251,750
  1909.  
  1910. I almost responded to your earlier message about needing the handle of the
  1911. MLE, to tell you how to get it.  I had seen it somewhere, but when I went to
  1912. look for it, I couldn't find it -- but I only looked in the online docs, not
  1913. the header files.
  1914.  
  1915. When I get a new version of OS/2, I always print the headers, and spend a day
  1916. or so just reading them carefully (concentrating on any new ones).  I nearly
  1917. always find some real gems this way (this has been true all the way back to
  1918. 1.1).  Anyway, that process is probably where I ran across this, but then I
  1919. couldn't remember it later -- brain cell entropy seems to be moving along in
  1920. double-time these days.  Thanks for the pointer.
  1921.  
  1922. #: 81623 S14/Early Code
  1923.     21-Mar-92  22:20:19
  1924. Sb: #80895-Container Editing
  1925. Fm: Wayne Kovsky 76164,3504
  1926. To: Rick Fishman 72251,750
  1927.  
  1928. Rick, I have just re-run the tests I did, from which I concluded that
  1929. container record insertion is slow; it isn't!
  1930.  
  1931. These tests are not comparable, because since the last time I ran them, almost
  1932. everything on my system has changed.  I had to install 1.3 EE, which required
  1933. me to make room for a new partition, etc.  The net of it is that I have
  1934. re-installed 6.304, plus installing 1.3 EE; I have moved my swap partition
  1935. from an HPFS partition with about 25 MB free, to a FAT partition with about 8
  1936. MB free; and I have done a lot of work (mostly adding new code) in the
  1937. containers area of my code.  All these caveats aside, here come the results:
  1938.  
  1939. Same number of records (fewer than 100), and records themselves have not
  1940. changed (in content, nor in requirements for formatting for display).  Where
  1941. before I could only load these in about 12.5 seconds when I did not load a
  1942. unique icon per record, I can now do it in 1.2 seconds; and where before
  1943. loading a unique icon per record required about 25 seconds, it now takes just
  1944. over 6 seconds.
  1945.  
  1946. Why the huge discrepancy?  You've got me.  If anything, I expected all my
  1947. system changes to make things worse, not better.  This is really snappy
  1948. performance now -- the container almost pops up, where before it seemed to
  1949. take forever.  The earlier results were repeatable; I did them several times,
  1950. over a period of days, often after a fresh reboot, because they were so bad I
  1951. didn't quite believe them.  These new results are equally repeatable.
  1952.  
  1953. I'm going to leave cookies and a Jolt cola for the Intel god tonight.
  1954.  
  1955. #: 82137 S14/Early Code
  1956.     22-Mar-92  21:11:30
  1957. Sb: #81623-Container Editing
  1958. Fm: Rick Fishman 72251,750
  1959. To: Wayne Kovsky 76164,3504
  1960.  
  1961. Wow! Those times are MUCH better than I'm getting. Is a sort going on during
  1962. those measurements?
  1963.  
  1964. #: 82277 S14/Early Code
  1965.     23-Mar-92  08:12:39
  1966. Sb: #82137-Container Editing
  1967. Fm: Wayne Kovsky 76164,3504
  1968. To: Rick Fishman 72251,750 (X)
  1969.  
  1970. No, no sorting, Rick.  I store the file in the order last specified by the
  1971. user (who can request a sort while viewing the file, and can then save). When
  1972. loading, it is simply read/format/insert.  The 'format' step can be more
  1973. complex than it sounds, which is data-dependant; however, that did not change
  1974. between the old and new tests.
  1975.  
  1976. This is getting stranger, though.  That under-two-seconds time was highly
  1977. repeatable, both immediately after booting and after having run the system
  1978. hard all day long -- emphasis on the "was".  Now it is up to the 5-6 second
  1979. range -- still much better than my original times, but why should it be
  1980. deteriorating?  The new times are also highly repeatable, within a couple of
  1981. tenths of a second (remember, I am timing with just a stopwatch; it would be
  1982. more accurate to use the ANSI 'clock ()' function or something like that).
  1983.  
  1984. My code is changing quite a lot on an hour-by-hour basis, as I add new
  1985. features or fix bugs; however, I am not working in the container loading area
  1986. (and only occasionally in the container area at all).  It is possible that my
  1987. re-linking is moving something around, and the result is the slowdown -- but
  1988. remember that this is a 32-bit app (single data segment, single code segment),
  1989. so that seems unlikely.  Weird!
  1990.  
  1991. #: 82197 S14/Early Code
  1992.     23-Mar-92  00:02:02
  1993. Sb: #81623-Container Editing
  1994. Fm: Frank Mena 73507,3610
  1995. To: Wayne Kovsky 76164,3504
  1996.  
  1997. Wayne, sorry to butt-in,
  1998.  
  1999. Before you re-loaded 6.304, did you have alot of objects on the desktop and in
  2000. folders?  Did you run the new test without creating all these objects?  I
  2001. noticed that since I created and deleted alot of objects, opening folders (and
  2002. loading their icons) is alot slower.  If so, I think it might have something
  2003. to do with having a fresh os2.ini file, although I dont know if the OS2.ini
  2004. file has anything to do with this.
  2005.  
  2006. #: 82278 S14/Early Code
  2007.     23-Mar-92  08:12:46
  2008. Sb: #82197-Container Editing
  2009. Fm: Wayne Kovsky 76164,3504
  2010. To: Frank Mena 73507,3610
  2011.  
  2012. You're not butting in at all, Frank; glad to have you.
  2013.  
  2014. I never did have what I would call "a lot" of objects on the desktop, or in
  2015. folders.  I am doing 99% development with this machine, so I have few apps
  2016. loaded on it (I have another machine for stuff like word processing,
  2017. spreadsheets, mail lists, etc.).  I had/have on the desktop just the standard
  2018. OS/2 stuff and the stuff that is put there by the toolkit installation (all
  2019. the docs, mostly).  When I re-installed 6.304, I had moved everything around
  2020. to make space for 1.3 EE, so before I did anything else, I also re-installed
  2021. the toolkit.
  2022.  
  2023. So, to answer your question:  the first time I did the timing tests after this
  2024. re-installation, the desktop looked pretty much like it had before the
  2025. re-installation.  One thing IS different:  the icons before were arranged
  2026. around the top, left and bottom, leaving the middle and right open.  This time
  2027. around they are arranged across the top only.  I'm not sure why, but I think
  2028. that when I did my first "arrange" on the old installation, I may have had the
  2029. center filled with a large window or two, and this time around I may have done
  2030. the arrange when only the icons were showing.  Otherwise, I think the desktop
  2031. is comparable to the earlier one, in quantity at least.
  2032.  
  2033. #: 82357 S14/Early Code
  2034.     23-Mar-92  12:51:34
  2035. Sb: #82278-#Container Editing
  2036. Fm: Frank Mena 73507,3610
  2037. To: Wayne Kovsky 76164,3504 (X)
  2038.  
  2039. Wayne, I have been following your thread about containers and notebooks for a
  2040. while.  I had started to work with them about 6 weeks back but had to pull
  2041. myself off to work on something else for a while.  Now i'm back.  You 2 guys
  2042. are worth more than the so-call  programmers guides.  Have you thought about
  2043. writing up what you have learned and upload it?  It would be invaluable
  2044. information to me and others, instead of me having to go back and try to piece
  2045. together your messages.
  2046.  
  2047. Thanks,
  2048.  
  2049.                 Frank Mena
  2050.  
  2051. #: 82424 S14/Early Code
  2052.     23-Mar-92  16:16:55
  2053. Sb: #82357-Container Editing
  2054. Fm: Wayne Kovsky 76164,3504
  2055. To: Frank Mena 73507,3610
  2056.  
  2057. Thanks for the compliment, Frank; maybe it will help to stop the bleeding! I
  2058. wouldn't mind writing up what I have learned (it is considerably more than we
  2059. have discussed here, which has concentrated on what I HAVEN'T learned!), but I
  2060. would need (A) time and -- most important -- (B) economic incentive. It isn't
  2061. that I'm mercenary -- just average in that respect, I would say -but I am busy
  2062. building a product while living on savings, so I have to be VERY careful how I
  2063. spend my time.
  2064.  
  2065. I guess I'll have to wait for one of the deep-pockets magazines to notice this
  2066. thread, and offer me Wealth Beyond My Wildest Dreams if I will only do an
  2067. article for them <g>.  And why not?  Ed McMann offers me that annually, and he
  2068. doesn't even expect me to write an article for him.
  2069.  
  2070. I had an article tentatively accepted by Byte, way back in early 1990 I think
  2071. it was, on techniques for debugging multi-threaded PM apps, but about that
  2072. time they decided to shift their focus away from OS/2, so the time I spent
  2073. writing that article was wasted.  Sure wish I had that time back! (Or a copy
  2074. of Byte with my article in it, to show my grandkids someday.)
  2075.  
  2076. Anyway, if you have any questions, jump right in.  I don't think there are
  2077. that many people in the entire metropolitan Universe who are using notebooks
  2078. and/or containers yet, so this may be The Place To Get Help for now.  I just
  2079. hope you aren't a competitor!
  2080.  
  2081. #: 82513 S14/Early Code
  2082.     23-Mar-92  18:47:07
  2083. Sb: #82424-Container Editing
  2084. Fm: Frank Mena 73507,3610
  2085. To: Wayne Kovsky 76164,3504
  2086.  
  2087. >I just hope you aren't a competitor!
  2088.  
  2089. I don't know.  You haven't told me what you're working on! <g>
  2090.  
  2091. #: 82587 S14/Early Code
  2092.     23-Mar-92  20:10:08
  2093. Sb: #82513-Container Editing
  2094. Fm: Wayne Kovsky 76164,3504
  2095. To: Frank Mena 73507,3610 (X)
  2096.  
  2097. Nope, I haven't!
  2098.  
  2099. #: 81624 S14/Early Code
  2100.     21-Mar-92  22:20:27
  2101. Sb: #80895-Container Editing
  2102. Fm: Wayne Kovsky 76164,3504
  2103. To: Rick Fishman 72251,750
  2104.  
  2105. Rick, a new problem:  container resizing.  My container is a window that
  2106. occupies the entire client window space when it is created.  When my client
  2107. gets a WM_SIZE message, I do a 'WinSetWindowPos ()', using the conhis code is similar to sample code for an MLE control; I
  2108. think that code is in the 'style' sample.
  2109.  
  2110. t is not. I
  2111. have noticed that I always have a horizontal scrollbar in the container for
  2112. all views, but I never have a verticthings got worse (things that were working as above, no longer
  2113. worked).  I didn't try sending it, in the belief that the client window was
  2114. not yet resized and it might fail for that reason (or be clipped to the old
  2115. client size).  I also tried posting a WM_USER message to the clienks for nice quick explaining. So subsystem / DLL is only a
  2116. difference how we can handle our C Set/2 DLL implementations. If we build only
  2117. DLL's for use / call with C Set/2 programs then i don't have to look at
  2118. subsystems. Ciao, Bernd
  2119.  
  2120. #: 82138 S14/Early Code
  2121.     22-Mar-92  21:11:43
  2122. Sb: #81624-Container Editing
  2123. Fm: Rick Fishman 72251,750
  2124. To: Wayne Kovsky 76164,3504
  2125.  
  2126. Wayne, try using SWP_MOVE on the WinSetWindowPos call. It sounds like you need
  2127. to reset the origin of the container to 0,0.
  2128.  
  2129. One thing I've done in the past with listboxes when I wanted it to be the
  2130. whole client area is to not create a client window, make the frame window the
  2131. parent of the listbox and specify FID_CLIENT as the ID of the listbox on the
  2132. WinCreateWindow call for the listbox. Also on the WinCreateWindow call specify
  2133. 0,0 for the origin of the listbox and 0,0 for cx,cy. The sizing is
  2134. automatically done for you - no reason to intercept WM_SIZE. You have to make
  2135. the frame window the owner too and subclass the frame to get the WM_CONTROL
  2136. messages tho. I haven't tried that for a container yet but see no reason why
  2137. it won't work.
  2138.  
  2139. BTW, I bowed down to you yesterday. I started my notebook control coding and
  2140. spent 4 hours trying to figure out why the BKM_SETDIMENSIONS message did not
  2141. work for sizing the major tabs. After tearing my hair out (a couple of times),
  2142. I STARED at the WinSendMsg call. Then I said to myself, "What would Wayne, god
  2143. of the NOTEBOOK control, do in a situation like this?". And I remembered your
  2144. message (I **THINK** it was your message) about the docs saying to use
  2145. BKA_MAJOR but really having to use BKA_MAJORTAB. That was it! I couldn't
  2146. believe how a simple documentation error caused me so much grief. I also saved
  2147. myself a lot of trouble by looking over your message about not making the
  2148. notebook control the owner of the pages. Thanks. You can bet a lot of other
  2149. people are going to hit these nasties.
  2150.  
  2151. #: 82279 S14/Early Code
  2152.     23-Mar-92  08:12:53
  2153. Sb: #82138-#Container Editing
  2154. Fm: Wayne Kovsky 76164,3504
  2155. To: Rick Fishman 72251,750 (X)
  2156.  
  2157. Thanks for the thoughts on my sizing bug.  I had used 'SWP_MOVE' at one time,
  2158. because I copied some code that I had used on 1.3, but I dropped it off
  2159. somewhere along the way when it didn't work.  I just read some messages from
  2160. someone at IBM (Sam Emrick, maybe?), acknowledging that some of the 'SWP_xxx'
  2161. parameters don't work, so I think this may be it.  Another thing I do is to
  2162. save my window(s)' positions on request, and next time restart them in the
  2163. same location/size.  That doesn't work on 6.304, but worked earlier (and I
  2164. haven't touched this code), so I suspect this may be the problem.
  2165.  
  2166. I have done almost exactly the same as you on listboxes, and have some of that
  2167. code around; I may try it.
  2168.  
  2169. Aren't notebooks fun?  Yes, that BKA_MAJOR instead of BKA_MAJORTAB cost me a
  2170. few hours, too!  I finally found it by poring over the header files, and
  2171. wondering why too such similar names were there.  This one goes back to at
  2172. least 6.177, and I think it was in 6.149; I don't know what is taking them so
  2173. long to fix it, but I presume most people will never hit it -- only us
  2174. pioneers!
  2175.  
  2176. If you have any pages that have both major and minor tabs, you will find an
  2177. API deficiency that results in a blank page when you select the major tab. If
  2178. you can't figure out a way around it, drop me a line; I solved that one a long
  2179. time ago.  Also, defer loading your dialogs -- saves a LOT of time in showing
  2180. the first notebook page -- do the load on BKN_PAGESELECTED messages. Come to
  2181. think of it, there are really quite a few "tricks" to using these things well
  2182. -- wanna see all the arrows in my back?
  2183.  
  2184. #: 82288 S14/Early Code
  2185.     23-Mar-92  08:34:51
  2186. Sb: #82279-Container Editing
  2187. Fm: Rick Fishman 72251,750
  2188. To: Wayne Kovsky 76164,3504
  2189.  
  2190. Wayne, I just tried the circumstances that you gave for the Container sizing
  2191. problem and got the same results as you. When I used SWP_MOVE with an x,y of
  2192. 0,0, the problem went away and everything worked fine. You may want to try it
  2193. again.
  2194.  
  2195. Good luck,
  2196.  
  2197. Rick
  2198.  
  2199. #: 82415 S14/Early Code
  2200.     23-Mar-92  15:48:28
  2201. Sb: #82138-Container Editing
  2202. Fm: Wayne Kovsky 76164,3504
  2203. To: Rick Fishman 72251,750
  2204.  
  2205. Rick, I have now tried resizing my container window with SWP_SIZE, and it
  2206. works as expected.  I must have had something else wrong when I removed
  2207. SWP_SIZE, and I just never put it back.
  2208.  
  2209. I just tried my "save window position for next session" code again, though,
  2210. and it still doesn't work.  Same code still works on 1.3 (same logic, anyway;
  2211. the code itself is now 32-bit), and it worked on versions of 2.0 prior to
  2212. 6.304.  I'm going to just leave it alone until I get the GA copy of the tools,
  2213. since someone from IBM said here that some of these positioning flags don't
  2214. work on 6.304.
  2215.  
  2216. Thanks for the help!
  2217.  
  2218. #: 82614 S14/Early Code
  2219.     23-Mar-92  21:05:36
  2220. Sb: #82415-Container Editing
  2221. Fm: Rick Fishman 72251,750
  2222. To: Wayne Kovsky 76164,3504
  2223.  
  2224. Wayne, glad to see you got it working. Another hash mark.
  2225.  
  2226. #: 80548 S14/Early Code
  2227.     19-Mar-92  09:34:06
  2228. Sb: #80416-Container Editing
  2229. Fm: Wayne Kovsky 76164,3504
  2230. To: Rick Fishman 72251,750
  2231.  
  2232. Also, I am handling the string allocation pretty much the same way you are.
  2233. However, I am being lazy (remember, I have fewer than 100 records, and that
  2234. will be typical for this particular app), by simply allocating each string
  2235. type to the maximum size for all strings of that type (like, name type,
  2236. address type, etc.).  That way, if a displayed string size changes, I don't
  2237. need to reallocate.
  2238.  
  2239. I wouldn't do this for a large database with thousands of records ... well,
  2240. come to think of it, I might.  By setting the delta to only a hundred or so,
  2241. there still is negligible memory waste, and diminished opportunity to fragment
  2242. memory.  It simplifies coding as well, but that isn't a criterion I like to
  2243. use in making tradeoffs of this sort.
  2244.  
  2245. Anyway, the REMOVE/FREE/ALLOC/INSERT is code that I already have, for things
  2246. like cut and paste, copy, delete, and add, so doing these operations because a
  2247. string size changed would be trivial.
  2248.  
  2249. #: 80896 S14/Early Code
  2250.     19-Mar-92  23:29:21
  2251. Sb: #80548-Container Editing
  2252. Fm: Rick Fishman 72251,750
  2253. To: Wayne Kovsky 76164,3504
  2254.  
  2255. Yeah, the delta is something I'm going to have to start doing. That seems like
  2256. the way to go. Always wanted that built into the listbox control in 1.x.
  2257.  
  2258. #: 80310 S4/Version 2.x
  2259.     18-Mar-92  18:55:19
  2260. Sb: #79658-Multicolumn list box
  2261. Fm: Peter G. Magid, IBM 70441,1634
  2262. To: Dave Proffer 70337,2544
  2263.  
  2264. Just want to confirm that we do use the standard
  2265. container control.
  2266.  
  2267. There are both PM Win calls and work place methods
  2268. for displaying information in that view.
  2269.  
  2270. - Peter
  2271.  
  2272. #: 80410 S4/Version 2.x
  2273.     18-Mar-92  21:08:10
  2274. Sb: #80310-Multicolumn list box
  2275. Fm: Wayne Kovsky 76164,3504
  2276. To: Peter G. Magid, IBM 70441,1634
  2277.  
  2278. Peter, I just noticed a peculiar behavior in the details view of a container
  2279. in my own program -- it could be my bug, but I don't see what I might be doing
  2280. wrong; I think it is in the container code.
  2281.  
  2282. In details view, and with a vertical separator, I put the mouse cursor over a
  2283. field in the right side of the split container, and hit Alt and LMB at the
  2284. same time.  The FIRST time I do this, the record that that field belongs to
  2285. has its NAME field briefly selected for editing (that is, the box is drawn
  2286. around it), then un-selected.  I do NOT get a CN_BEGINEDIT or CN_ENDEDIT
  2287. message for this field.  After this field is unselected, I must select again
  2288. the field I wanted; this time (and all subsequent times) it works.
  2289.  
  2290. This narrative is hard even for me to follow; here's a diagram:
  2291.  
  2292.    ID     NAME     |   ADDRESS      CITY      STATE
  2293.    1      Jones    |   Oak St.      New York  NY
  2294.  
  2295. "Jones" is the pszIcon string, the pszName string, and the pszText string, and
  2296. the container is "split" after the NAME field.  If I try to direct-edit "Oak
  2297. St.", it tries to edit "Jones" (but I get no messages from the container, and
  2298. the selection simply goes away after a few seconds).
  2299.  
  2300. I would try this on a details view of a system-supplied container, but I can't
  2301. find one that is split.  My bug, or the container's?
  2302.  
  2303. #: 80412 S4/Version 2.x
  2304.     18-Mar-92  21:08:19
  2305. Sb: #80310-Multicolumn list box
  2306. Fm: Wayne Kovsky 76164,3504
  2307. To: Peter G. Magid, IBM 70441,1634
  2308.  
  2309. Peter, I would appreciate it if you could have a look at message number 80290
  2310. in section 14 (Early Code), where I have a question about direct editing in a
  2311. container.
  2312.  
  2313. #: 81134 S4/Version 2.x
  2314.     20-Mar-92  17:06:32
  2315. Sb: %80544- Container Sortin
  2316. Fm: Wayne Kovsky 76164,3504
  2317. To: Rick Fishman 72251,750 (X)
  2318.  
  2319. Rick, I have a message from you, number 80894, when I scan for messages, but I
  2320. don't actually get the message; a zombie message!  It is shown as part of the
  2321. 80544 Container Sorting thread in this section.
  2322.  
  2323. Anyway, if you (unlike me) actually said something noteworthy, you'll need to
  2324. re-send it; CompuServe is playing "keepaway" with me.
  2325.  
  2326. #: 81430 S4/Version 2.x
  2327.     21-Mar-92  11:32:49
  2328. Sb: #81134-%80544- Container Sortin
  2329. Fm: Larry Finkelstein[Sysop] 76702,1354
  2330. To: Wayne Kovsky 76164,3504
  2331.  
  2332. Wayne,
  2333.  
  2334. You should be able to retrieve that message, however it may be lower than your
  2335. high-message number, which is why you want find it you're reading new
  2336. messages.  However, a REA WAI or a REA NUM: 80544 command should get it for
  2337. you.
  2338.  
  2339. LBF
  2340.  
  2341. #: 81482 S4/Version 2.x
  2342.     21-Mar-92  14:09:39
  2343. Sb: #81430-%80544- Container Sortin
  2344. Fm: Wayne Kovsky 76164,3504
  2345. To: Larry Finkelstein[Sysop] 76702,1354 (X)
  2346.  
  2347. Yes, Larry, I have retrieved it now, by using 'Esc' to have TAPCIS leave me
  2348. connected.  I don't understand why (in several different sessions) TAPCIS
  2349. showed me that this message was waiting for me, but never retrieved it.  I
  2350. wonder if I am missing other messages that were NOT addressed to me (I would
  2351. never have known about this message had it not been addressed to me).
  2352.  
  2353. Anyway, I have retrieved it now; thanks.
  2354.  
  2355. #: 82032 S4/Version 2.x
  2356.     22-Mar-92  17:40:12
  2357. Sb: #81928-Notebook Control
  2358. Fm: David B. Lection [IBM] 74017,337
  2359. To: Matthew Woolf 100021,3546
  2360.  
  2361. Matt,
  2362.  
  2363. There is a set of manuals that are called the OS/2 technical compendium that
  2364. contains some documentation on the new controls. I will be out of town till
  2365. this Friday, but I can look into what it might take to get you a copy. Is
  2366. Friday OK?
  2367.  
  2368. Regards, David
  2369.  
  2370.  
  2371.