[comp.sys.mac.misc] Accessing globals in DA's using Think Pascal

rad@genco.bungi.com (Bob Daniel) (11/18/90)

  Think Pascal supposedly allows access to the global environment in DA's
  through 'dctlStorage'.  This is a handle that contains the address to
  the globals.  I'm attempting to pass this address to external code 
  resources but it doesn't seem to be the proper address.  I'm passing it
  to the externals by storing the address in the window refCon of the 
  DA window.  The external can then do a FrontWindow to get the DA window
  and then gets the address from the refCon.
  
  In the DA, it stores 'dctlStorage' in the reCon...
    WindowPeek(daWindow)^.refCon := longint(theDevCtlEnt^.dctlStorage);
  
  In the External, a structure (record) is defined in the same manner as
  the globals in a GlobalHandle...
    Globals := GlobalHandle(WindowPeek(FrontWindow)^.refCon);
  
  Looking at the address in TMON, it appears there is other info at that
  address then the real global data afterwards.  Apparently an offset 
  should be used from that address to get the globals. 

  Anyone know the structure of globals in ThP?