"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

> Official information states that 'real' globals canot be used in a shared
> library. What I want to know is: Can I use globals in serial and virtual
> drivers?
> How?
>
> I'm also interested in using globals in shared libs, despite official
info.

  you dont need to use globals at ALL really.

  create a structure containing your "globals" and then.. when you init
  the application:

     a) allocate memory
     b) register the pointer as a feature

  when you need to access globals:

     c) get the pointer from the feature

  when you finished:

     d) get the pointer from the feature
     e) free the memory

  check out the sources to Cube3D (new) that you can get from here:

    http://www.ardiri.com/index.cfm?redir=palm&cat=cube3D

  you should be able to use this technique to get around problems with
  shared libs, multiple code segments etc.. its a much better design
  than using plain old globals :)

  my sources are available to help you guys.. use em :)

  cheers.

az.
--
Aaron Ardiri
Java Certified Programmer      http://www.hig.se/~ardiri/
University-College i Gävle     mailto:[EMAIL PROTECTED]
SE 801 76 Gävle SWEDEN
Tel: +46 26 64 87 38           Fax: +46 26 64 87 88
Mob: +46 70 656 1143           A/H: +46 8 668 78 72

if you enjoy it, then it aint work :) - rule #106 of life








-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to