home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14953 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.0 KB  |  74 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!hplabs!ucbvax!ICHCMNS.CMNS.MNEGRI.IT!LAFARCIOLA
  2. From: LAFARCIOLA@ICHCMNS.CMNS.MNEGRI.IT (max)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: About QuickBasic/Think C....
  5. Message-ID: <FEF325223DBF201A34@ichcmns.cmns.mnegri.it>
  6. Date: 3 Sep 92 11:28:00 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Lines: 64
  9.  
  10. Hello!
  11. I started to program with Macintosh since a few time and now I've written an 
  12. application (with THINK C 5.0) which creates a menu and a window which has a 
  13. grid of rows x columns cells to input numbers.I'd like to use it writing a MBPC 
  14. in order to use it as a library for my Quick Basic program.
  15. But...after I make my application as a PCR (pure-code-resource) library:
  16. /**** MAIN PROGRAM *******/
  17. /*** compiled as a MBPC
  18.      name: MyGrid   id:60   ***/
  19.         
  20. #include "BasicLSC.h"
  21. #include <SetUpA4.h>
  22. main()
  23. {
  24.     Handle h;
  25.     
  26.     SAVEREGS();   // save A4 and A5 registers
  27.     RememberA0(); // to access  resource 
  28.     SetUpA4();    // globals
  29.     // Locking code resource
  30.     asm {
  31.         _RecoverHandle  // a0 already points 
  32.         move.l a0, h    // to resource
  33.     }
  34.     HLock( h );
  35.         // initialization
  36.     ToolBoxInit();
  37.     MenuBarInit();    
  38.     r=10;c=5;
  39.     SetUpDragRect();
  40.     SetUpSizeRect();
  41.  
  42.     CreateWindow( r, c ); // window with a grid of rows x columns cells    
  43.     MainLoop();      // management of events for window created
  44.     HUnlock( h );
  45.     RESTREGS();   // restore A4 and A5 registers
  46.     UnloadA4Seg( 0L );    // to unload multi-segment resource
  47. }
  48. when I run (under MultiFinder) my QuickBasic program:
  49.  
  50. REM MacAllfit 1.0
  51. ...
  52. ...
  53. LIBRARY "MyGrid"
  54. CALL MyGrid
  55. LIBRARY CLOSE
  56. ...
  57. processing of numbers inputted into grid
  58. ...
  59. ...
  60. END
  61.  
  62. a) sometimes refreh drawing is not performed thus some piece of window is not     
  63.    drawn
  64. b) after quitting and returning to my QBasic program it bombs or turns up to  
  65.    the FINDER with an unexpected error. 
  66. Anyone may help me?
  67. Thanks in advance,
  68.     Massimo La Farciola
  69.     
  70.     -Excuse for my poor english-
  71.  
  72. E-Mail: lafarciola@ichcmns.cmns.mnegri.it
  73. Organization: "Mario Negri Sud" Institute
  74.