home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / pascal / 4577 < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.4 KB  |  85 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!s1949782
  3. From: s1949782@titan.ucc.umass.edu (Matthew Crocker)
  4. Subject: HELP, TVision Questions
  5. Message-ID: <1992Jul28.125427.10388@nic.umass.edu>
  6. Sender: usenet@nic.umass.edu (USENET News System)
  7. Nntp-Posting-Host: titan.ucc.umass.edu
  8. Organization: University of Massachusetts, Amherst
  9. Date: Tue, 28 Jul 1992 12:54:27 GMT
  10. Lines: 73
  11.  
  12. Am I just totaly missing this or what?
  13.  
  14. Here's my problem
  15.  
  16.  I have a Dialog box (tDialog) stored in a Resource file.
  17.  
  18.  The dialog has 2 inputlines and 2 listboxes (with scroll bars)
  19.  
  20.  When I Get the dialog from the resource I want to SetData
  21.  for the inputlines and the listboxes.  here's what I do.
  22.  
  23.  DialogData : Record
  24.                FileName : String[127];
  25.            SearchString : String[80];
  26.             Available  : pStringCollection;
  27.            Selected      : pStringCollection;
  28.           End;
  29.  
  30. Procedure MSCDialogType.Init;
  31.  
  32. Begin
  33.  DialogData.FileName := 'Events.Dat';
  34.  DialogData.SearchString := '';
  35.  DialogData.Available := New(pStringCollection,Init(100,10));
  36.  DialogData.Selected := New(pStringCollection,Init(100,10));
  37.  
  38.  SetData(DialogData);  <--- it crashes here;
  39. End;
  40.     
  41. Procedure ShowDIalog;
  42. Var
  43.  D : pMSCDialogType;
  44.  
  45. Begin
  46.  D := pMSCDIalogType(RezFile.Get('Dialog1'));
  47.  If ValidView(D) Then
  48.   Begin
  49.    D^.Init;
  50.    Desktop^.ExecView(D); <- If  I Take out the SetData above it crashes
  51.    D^.Done;                  Here.
  52.   End;
  53. End;
  54.   
  55. When I run this Under TurboDebuuger 2.51 it just hangs,
  56. When I run it under OS/2 Dos Box it causes OS/2 to freak and close the 
  57. application.
  58.  
  59. I think I know whats happening, The SetData is giving the two ListBox's the 
  60. wrong Pointer and the ListBox.SetData is going on forever on the wrong 
  61. pointers.
  62.  
  63. What I want to know is HOW to setdata for a dialog like this
  64.  
  65. I have tried setting the DialogData.Available & Selected := Nil but that
  66. doesn't help either.  
  67.  
  68. The order that its in the DialogData Record is the same order that they
  69. were inserted into the DIalog before it was resourced.
  70.  
  71. This also doesn't work if I create the Dialog and the SetData (no Resource)
  72.  
  73. Like I said Am I missing something?  I have RTM but It doesn't help
  74. it should work they way I'm doing it right?
  75.  
  76. advTHANKSance
  77.  
  78. -Matt
  79.  
  80. -- 
  81. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  82. - Matthew Crocker
  83. s1949782@titan.ucc.umass.edu
  84. crocker@elux3.cs.ucc.umass.edu
  85.