home *** CD-ROM | disk | FTP | other *** search
- 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
- From: LAFARCIOLA@ICHCMNS.CMNS.MNEGRI.IT (max)
- Newsgroups: comp.sys.mac.programmer
- Subject: About QuickBasic/Think C....
- Message-ID: <FEF325223DBF201A34@ichcmns.cmns.mnegri.it>
- Date: 3 Sep 92 11:28:00 GMT
- Sender: usenet@ucbvax.BERKELEY.EDU
- Lines: 64
-
- Hello!
- I started to program with Macintosh since a few time and now I've written an
- application (with THINK C 5.0) which creates a menu and a window which has a
- grid of rows x columns cells to input numbers.I'd like to use it writing a MBPC
- in order to use it as a library for my Quick Basic program.
- But...after I make my application as a PCR (pure-code-resource) library:
- /**** MAIN PROGRAM *******/
- /*** compiled as a MBPC
- name: MyGrid id:60 ***/
-
- #include "BasicLSC.h"
- #include <SetUpA4.h>
- main()
- {
- Handle h;
-
- SAVEREGS(); // save A4 and A5 registers
- RememberA0(); // to access resource
- SetUpA4(); // globals
- // Locking code resource
- asm {
- _RecoverHandle // a0 already points
- move.l a0, h // to resource
- }
- HLock( h );
- // initialization
- ToolBoxInit();
- MenuBarInit();
- r=10;c=5;
- SetUpDragRect();
- SetUpSizeRect();
-
- CreateWindow( r, c ); // window with a grid of rows x columns cells
- MainLoop(); // management of events for window created
- HUnlock( h );
- RESTREGS(); // restore A4 and A5 registers
- UnloadA4Seg( 0L ); // to unload multi-segment resource
- }
- when I run (under MultiFinder) my QuickBasic program:
-
- REM MacAllfit 1.0
- ...
- ...
- LIBRARY "MyGrid"
- CALL MyGrid
- LIBRARY CLOSE
- ...
- processing of numbers inputted into grid
- ...
- ...
- END
-
- a) sometimes refreh drawing is not performed thus some piece of window is not
- drawn
- b) after quitting and returning to my QBasic program it bombs or turns up to
- the FINDER with an unexpected error.
- Anyone may help me?
- Thanks in advance,
- Massimo La Farciola
-
- -Excuse for my poor english-
-
- E-Mail: lafarciola@ichcmns.cmns.mnegri.it
- Organization: "Mario Negri Sud" Institute
-