Pablo

There are a number ways you can do this:-

Declare the varable in your main source file like this:-

Int16 value;

and in the other source files which use it do:-

extern Int16 value;

This will allow the variable value to be the same one across the whole
project.
It's a cheap and nasty way of doing things and generally frowned upon.

If it's a C++ class pointer you want, they you are better off doing:-

  #define ftrMyClass     1020

  // to create the variable:
  MyClass* pMyClass = new MyClass();
  FtrSet(appCreator, ftrMyClass, (UInt32)pMyClass);

  // to access the variable:
  MyClass* pMyClass;
  FtrGet(appCreator, ftrMyClass, (UInt32 *)&pMyClass);

  // to delete the vaiable at the end of the program:
  MyClass* pMyClass;
  FtrGet(appCreator, ftrMyClass, (UInt32 *)&pMyClass);
  delete pMyClass;
  FtrUnregister(appCreator, ftrMyClass);

for a function definition, just place it in a header file, and include that
header file into every source file which needs it.

Chris Brooks

-----Original Message-----
From: Pablo Martin Vera [mailto:[EMAIL PROTECTED]
Sent: 17 September 2003 13:33
To: Palm Developer Forum
Subject: newie question on c++


Where shall I place a global variable or a funtion definition in order that
variable will be accessible from every classes in my project????

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/

_____________________________________________________________________

This message has been checked for all known viruses on behalf of Vivista by
MessageLabs. 

http://www.messagelabs.com or Email: [EMAIL PROTECTED]

Vivista formerly Securicor Information Systems for further information
http://www.vivista.co.uk  



**********************************************************************
The information contained in this e-mail message is intended
only for the individuals named above.  If you are not the 
intended recipient, you should be aware that any 
dissemination, distribution, forwarding or other duplication 
of this communication is strictly prohibited.  The views 
expressed in this e-mail are those of the individual author 
and not necessarily those of Vivista Limited.  
Prior to taking any action based upon this e-mail message 
you should seek appropriate confirmation of its authenticity.
If you have received this e-mail in error, please immediately 
notify the sender by using the e-mail reply facility.
**********************************************************************


_____________________________________________________________________

This message has been checked for all known viruses on behalf of Vivista by 
MessageLabs. 

http://www.messagelabs.com or Email: [EMAIL PROTECTED]

Vivista formerly Securicor Information Systems for further information 
http://www.vivista.co.uk  


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to