Global variable corruption in Palm OS 3.5

2007-02-19 Thread V. Sriram
Hi all, I'm working on Treo 180 running Palm OS ver 3.5. I'm having trouble with one of the global variables(it is a char array of size 60)which gets corrupted after running the application for a while. I've declared the variable in EXTRA_SECTION_TWO and the variable gets called from a function

Re: Global variable corruption in Palm OS 3.5

2007-02-19 Thread Pinus Alba
Hi Sriram, You are almost certainly overwriting an array. Check all the arrays which are close to your char array and make sure you do proper bounds checking. Regards, On 19/02/07, V. Sriram [EMAIL PROTECTED] wrote: Hi all, I'm working on Treo 180 running Palm OS ver 3.5. I'm having trouble

Global variable in segmentation

2007-01-03 Thread Durgesh Trivedi
any global variable in the function in the second segment . So how do i assign my global variable so it not creating any problem during function call frm second segment. -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev

Re: How to create global variable more than 64K size

2006-12-04 Thread hv reddy
All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size of array but the linker is giving error.Even i tryed using memptrNew also .Here also it gives the same error. Is there a limitation for global variable size should

Re: How to create global variable more than 64K size

2006-12-04 Thread Michal Seliga
using MW 9.1 . If u can help me in this regard kindly reply me. Thanks and Regards, Harsha */Ben Combee [EMAIL PROTECTED]/* wrote: On 11/12/06, hvreddy wrote: Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create

Re: How to create global variable more than 64K size

2006-12-04 Thread hv reddy
Dear Ben, Thanks for ur help. I finally did it. Thanks once again. Regards, Harsha Ben Combee [EMAIL PROTECTED] wrote: On 11/12/06, hvreddy wrote: Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size

Re: How to create global variable more than 64K size

2006-12-04 Thread hv reddy
: Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size of array but the linker is giving error.Even i tryed using memptrNew also .Here also it gives the same error. Is there a limitation for global

How to create global variable more than 64K size

2006-11-12 Thread hvreddy
Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size of array but the linker is giving error.Even i tryed using memptrNew also .Here also it gives the same error. Is there a limitation for global variable size should

Re: How to create global variable more than 64K size

2006-11-12 Thread Robert Moynihan
hvreddy wrote: Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size of array but the linker is giving error.Even i tryed using memptrNew also .Here also it gives the same error. Is there a limitation for global variable size

Re: How to create global variable more than 64K size

2006-11-12 Thread Ben Combee
On 11/12/06, hvreddy [EMAIL PROTECTED] wrote: Hi All, Is it possible to create a global variable of size more than 64K in palm os? I tryed to create more than 64K size of array but the linker is giving error.Even i tryed using memptrNew also .Here also it gives the same error

Global variable crash, but why is it global?

2004-12-02 Thread Robert Moynihan
Hi folks, I just fixed a bug in my app, but I don't really understand why it is a bug. Perhaps someone could shed a little light on it. To demonstrate the problem to myself, I created a little test function that does nothing other than declare a character string. The function is called in

Re: Global variable crash, but why is it global?

2004-12-02 Thread Robert Moynihan
Thanks for that clarity, Aaron, much appreciated. I never realized that there was any real, practical difference between the 2 declarations. I was really just trying keep the lines of code tight. Your explanation makes a lot of sense, so it will become my new M.O. ;). Bob. void

RE: Global variable crash, but why is it global?

2004-12-02 Thread Hays, Jonathan \(GE Infrastructure\)
is that it has type array of char. The other one that isn't obvious is that string literals have a storage class of static. It is the static quality that causes it to be a global variable. Generally, though, if your optimization settings are aggressive, this won't end up being an issue. Obviously is has

Re: Global variable problem

2004-10-08 Thread Developer
PROTECTED] Just after I declare the global variable that was losing it's value, I had declared another global variable - an array. When I moved the other variable to another location I dont get this problem. These two variables were being used in the same function that was creating the problem

RE: Global variable problem

2004-10-06 Thread Caspar Heiden, vd
The only thing I can think is that somewhere in your application, you write to a piece of memory that you shouldn't write to and that happens to be (contain) the address of your global variable. So, you could check for out-of-boundary memory writes. Did you declare an array just before

Re: Global variable problem

2004-10-06 Thread Developer
Thanks for your reply. My problem is solved now. Just after I declare the global variable that was losing it's value, I had declared another global variable - an array. When I moved the other variable to another location I dont get this problem. These two variables were being used in the same

Re: Global variable problem

2004-10-06 Thread Krzysztof Kowalczyk
Any idea why this could be happening. As of now I have no clue. As Caspar suggested before, most likely you're unintentionally overwriting the memory location where your global variable that was losing the value resided. It doesn't look like you've solved the problem, just managed to hide

Re: Global variable problem

2004-10-06 Thread Greg Parker
Just after I declare the global variable that was losing it's value, I had declared another global variable - an array. When I moved the other variable to another location I dont get this problem. These two variables were being used in the same function that was creating the problem. How

Global variable problem

2004-10-05 Thread Developer
I am having trouble accessing a global variable in my palm OS application. I am using Codewarrior. The value of the global variable keeps changing in the application. I have seen this by diplaying the value of the global variable as I move from form to form. The global variable is being accessed

What is the system global variable saying the next app to launch?

2004-06-25 Thread Yunsong Wang
app will be launched because that global variable already think the initial app is the next app to launch. However, I still have no idea about this global variable if it is existed, could you please give me some ideas? Thanks you in advance -- For information on using the Palm Developer Forums

Re: What is the system global variable saying the next app to launch?

2004-06-25 Thread Ben Combee
application is returned, the initial app will be launched because that global variable already think the initial app is the next app to launch. However, I still have no idea about this global variable if it is existed, could you please give me some ideas? Thanks you in advance Internally

Re: What is the system global variable saying the next app to launch?

2004-06-25 Thread Yunsong Wang
Thank you for your answser. I wander is there is a way to get or set the global variable to control next app to launch? If there is, what is the name for the global variable? Thanks a lot. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http

Re: What is the system global variable saying the next app to launch?

2004-06-25 Thread Ben Combee
At 02:47 PM 6/25/2004, you wrote: Thank you for your answser. I wander is there is a way to get or set the global variable to control next app to launch? If there is, what is the name for the global variable? The only method to change this is to use SysUIAppSwitch. If you want, you could call

Re: Writing a global variable to feature memory.

2004-06-15 Thread Aaron Ardiri
instead of writing to a database, why not use an unused area of the display controller? there are a few devices out there that are read/write and have at least 40-50k free :) It's surely useful to have some comedy with Aaron's quips, but watch this, next question will be How do I do

Re: Writing a global variable to feature memory.

2004-06-15 Thread Aaron Ardiri
Forget about the Heap option, you wouldn't be able to retrieve the pointer to it, except if you store it in 'Guess what' (Feature Memory!). And if you ask me, for those times that globals aren't possible, feature memory was the best thing created! well, back in the old pre 3.5 days - you only

Re: Writing a global variable to feature memory.

2004-06-15 Thread Aaron Ardiri
Palm IIIc - 80kb of display memory available on the SED 1386 controller. shoot me, it was SED 1375 controller - palm 505 had SED 1376 :) --- Aaron Ardiri PalmOS Certified Developer [EMAIL PROTECTED] http://www.mobilewizardry.com/members/aaron_ardiri.php -- For information on using the Palm

Writing a global variable to feature memory.

2004-06-14 Thread Peter Hamilton-Scott
I have a DmOpenRef variable. My app then notifies a routine that performs a GPS function every second. This works well. I can't/dont trust my DmOpenRef variable to be valid, and I think the strange problems I've been having with resets is because the variable is no longer global. So I thought

Re: Writing a global variable to feature memory.

2004-06-14 Thread SLO Revo News
So I thought if my app opened the .pdb file and stored the DmOpenRef in feature memory, then my callback function can simply look at it and use it to process the .pdb file that is already opened. That way, if another app gets launched, my callback will still run and can use the .pdb file. My

Re: Writing a global variable to feature memory.

2004-06-14 Thread Peter Hamilton-Scott
SLO Revo News wrote: So I thought if my app opened the .pdb file and stored the DmOpenRef in feature memory, then my callback function can simply look at it and use it to process the .pdb file that is already opened. That way, if another app gets launched, my callback will still run and can use

Re: Writing a global variable to feature memory.

2004-06-14 Thread Dale Hurtt
I suspect there are any number of things an application could do to make that reference invalid. One real simple action to make it invalid is for another application to close the open database. If you can guarantee that no other app will mess with that particular database, you are probably

Re: Writing a global variable to feature memory.

2004-06-14 Thread Aaron Ardiri
I suspect there are any number of things an application could do to make that reference invalid. One real simple action to make it invalid is for another application to close the open database. If you can guarantee that no other app will mess with that particular database, you are

Re: Writing a global variable to feature memory.

2004-06-14 Thread SLO Revo News
Steve, by that, do you mean that they could cause havoc with my .pdb file if they know what it is I've written to the feature memory? Or that an application could just arbitrarily go in and smash my feature memory to pieces? Can applications therefore interrogate the layout of feature memory

Re: Writing a global variable to feature memory.

2004-06-14 Thread Dale Hurtt
I suspect there are any number of things an application could do to make that reference invalid. One real simple action to make it invalid is for another application to close the open database. If you can guarantee that no other app will mess with that particular database, you

Re: Writing a global variable to feature memory.

2004-06-14 Thread Aaron Ardiri
DmProtectDatabase() If you mean DmDatabaseProtect(), I do not believe it will do what you are suggesting. This routine can be used to prevent a database from being deleted... Use this function if you want to keep a particular record or resource in a database locked down but don't want

Re: Writing a global variable to feature memory.

2004-06-14 Thread LionScribe
Aaron Ardiri [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] instead of writing to a database, why not use an unused area of the display controller? there are a few devices out there that are read/write and have at least 40-50k free :) It's surely useful to have some comedy with

Re: Writing a global variable to feature memory.

2004-06-14 Thread Ben Combee
At 10:33 PM 6/14/2004, you wrote: Aaron Ardiri [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] instead of writing to a database, why not use an unused area of the display controller? there are a few devices out there that are read/write and have at least 40-50k free :) It's surely

Re: Writing a global variable to feature memory.

2004-06-14 Thread LionScribe
What I would suggest would be to temporarily store all the data in feature memory, and then every minute or so, open the database, and store it there. Or else, for even quicker writing, reserve memory on the Heap, and set it's owner to the system. LionScribe Peter Hamilton-Scott [EMAIL

Re: Writing a global variable to feature memory.

2004-06-14 Thread LionScribe
Forget about the Heap option, you wouldn't be able to retrieve the pointer to it, except if you store it in 'Guess what' (Feature Memory!). And if you ask me, for those times that globals aren't possible, feature memory was the best thing created! LionScribe LionScribe [EMAIL PROTECTED] wrote in

Re: Global variable in .text segment of shared library?

2004-05-08 Thread LionScribe
in message news:[EMAIL PROTECTED] At 12:45 PM 5/7/2004, you wrote: Hi, I'm creating a shared library (syslib-type) that in turn makes use of MathLib. Those of you who've used MathLib know that you include MathLib.c in your own project. MathLib.c defines a global variable to hold the refnum when

Global variable in .text segment of shared library?

2004-05-07 Thread David Ek
Hi, I'm creating a shared library (syslib-type) that in turn makes use of MathLib. Those of you who've used MathLib know that you include MathLib.c in your own project. MathLib.c defines a global variable to hold the refnum when the library is opened. Global variables are not allowed in shared

Re: Global variable in .text segment of shared library?

2004-05-07 Thread Ben Combee
At 12:45 PM 5/7/2004, you wrote: Hi, I'm creating a shared library (syslib-type) that in turn makes use of MathLib. Those of you who've used MathLib know that you include MathLib.c in your own project. MathLib.c defines a global variable to hold the refnum when the library is opened. Global

global variable

2004-01-19 Thread Roberto Pedrozo Mendes
Hi How i can to create a global variable in my aplication ? Thanks = Roberto Pedrozo Mendes Arquiteto Sistemas HST - CPqD - Campinas [EMAIL PROTECTED] __ Yahoo! GeoCities: a maneira mais fácil de criar seu web site

Re: global variable

2004-01-19 Thread Luc Le Blanc
Roberto Pedrozo Mendes a écrit : How i can to create a global variable in my aplication ? In what language? In C, just declaring a variable outside any function gives it global scope. To access it in other modules (other .c or .cpp files), use an extern reference to it. Standard C stuff. Boa

Re: Global Variable

2003-11-06 Thread Alan Ingleby
Khurram [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I want to know how i can declare Global variable in Starter.c and then access it from ULDatabase.sqc Assuming ULDatabase.sqc is a C source file (). Just declare an external reference to it in ULDatabase.sqc. (OR more

Global Variable

2003-11-05 Thread Khurram
Hi, I want to know how i can declare Global variable in Starter.c and then access it from ULDatabase.sqc Regards Khuram Mir -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Global Variable Question

2003-01-18 Thread Régis Daniel de Oliveira
Hy all! I need to write a string to a global variable tha will be accessed by 2 or more forms, but i don't know where to put it and how to access is from a form. Can anybody give-me a example? Thanks!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see

Re: Global Variable Question

2003-01-18 Thread Matthew Bevan
Done and done... this is a three-file example: --FILE 1: Globals.h-- extern Char *bob; --FILE 2: Form1.c-- (variable defined here) #include Globals.h Char *bob = This is a global variable.; // access bob as you would any normal variable - anywhere --FILE 3: Form2.c-- (variable used here

Re: Global Variable Question

2003-01-18 Thread Stephan Veigl
Hi I need to write a string to a global variable tha will be accessed by 2 or more forms, but i don't know where to put it and how to access is from a form. Not only, that global variables are bad style (ok, there are some, few reasons to use them), but most important: global variables won't

Re: Global Variable Question

2003-01-18 Thread Régis Daniel de Oliveira
mensagem news:109602@palm-dev-forum... Done and done... this is a three-file example: --FILE 1: Globals.h-- extern Char *bob; --FILE 2: Form1.c-- (variable defined here) #include Globals.h Char *bob = This is a global variable.; // access bob as you would any normal variable - anywhere --FILE 3

Re: Global Variable Question

2003-01-18 Thread Ronnie van 't Westeinde
Globals.h Char *bob = This is a global variable.; // access bob as you would any normal variable - anywhere --FILE 3: Form2.c-- (variable used here) #include Globals.h // access bob as you would any normal variable - anywhere --END-- Hope that helps. It's usually a good idea to keep

Re: Hi Ben, can shared library support new and delete as the global variable issues are concerned?

2003-01-07 Thread Ben Combee
Mengtao: I created a header file called NewDeleteImpl.h and included new and copied the inline forms of new/delete posted as the second solution in your article to this header file. Then I included NewDeleteImpl.h to a source file called CFieldInfo.cpp where I use new and delete. All the old

Re: Hi Ben, can shared library support new and delete as the global variable issues are concerned?

2003-01-07 Thread Ben Combee
At 14:27 2003-1-7 -0500, you wrote: When I compile, I didn't get link errors complaining new and delete are not defined. Instead I got other link errors as below which to me are still due to the usage of new and delete. Could you give me any tips how I can get rid of these link errors? Thanks

RE: accessing global variable problem

2002-07-06 Thread fawaz bokhari
from the field in secondform in secondformHnadleEvent and storing it in global variable char* connurl. Then I call FrmReturnToForm(0) to return to the parent form i.e the first form. In the firstformHandleEvent routine, I want to access that vairable containing the text entered into the field

RE: accessing global variable problem

2002-07-06 Thread Daniel Seifert
Am Sam, 2002-07-06 um 09.10 schrieb fawaz bokhari: Hi, static char * connurl; connurl = FldGetTextPtr(field); FrmReturnToForm(0); In the first Form Handle Event I want to access that global variable: FrmCustomAlert(OutputAlert , connurl , NULL , NULL); connurl points to the text

Re: accessing global variable problem

2002-07-05 Thread Joe Malone
--- fawaz bokhari [EMAIL PROTECTED] wrote: When I use this variable some where else in the application, then it says error: Unallocated memory chunk. the appliation is accessing a memory location that is not in the RAM... By some where else in the application, do you mean in another

RE: accessing global variable problem

2002-07-05 Thread Valmir Tavares de Oliveira
Try this : char name[] = fawazsaleem; -Original Message- From: fawaz bokhari [mailto:[EMAIL PROTECTED]] Sent: Friday, 05 July, 2002 12:13 To: Palm Developer Forum Subject: accessing global variable problem Hi, I am having problem with global variables. I have declared a char

Re: Another way of Declaring global variable?

2002-06-19 Thread Holger Klawitter
place and use an *external declaration* to propagate this global variable to the other modules. With kind regards / mit freundlichem Gruß Holger Klawitter -- [EMAIL PROTECTED] http://www.klawitter.de/palm -- For information on using the Palm

Re: Another way of Declaring global variable?

2002-06-19 Thread quennie
Ya. Is it what you mean using the 'extern'? I have done this kind of program previously. But what i have noticed that i declared a lot of variables as global variable and make my program 'messy'. So i have to declare it as a type in a header file and use it as global. If i have this struct

Another way of Declaring global variable?

2002-06-18 Thread quennie
Hi. I am developing a program where it must make use of a lot of variables and various forms will use those variables. Instead of creating those global variables among each form, can i create those variables in a header file (using typedef struct to define the data types), and those variables

How to create a global variable?

2002-04-18 Thread Jay Francis
Creating a global variable: I tried to create a global variable and test to see the scope of that variable in a custom alert. So I created a variable called gJay. Char * gJay = Jay; When I put this code in the main.c file (the file that has the MainFormInit function in it) below

Re: How to create a global variable?

2002-04-18 Thread brian
In the other sources (not main.c): extern Char *gJay; On Thu, 18 Apr 2002 09:00:44 -0500, Palm Developer Forum [EMAIL PROTECTED] said: Creating a global variable: I tried to create a global variable and test to see the scope of that variable in a custom alert. So I created a variable called

Re: How to create a global variable?

2002-04-18 Thread Jay Francis
Thanks Brian, Do you mean I declared it correctly and in addition I need to put the code you suggested in each of the .c files? Jay From Brian: In the other sources (not main.c): extern Char *gJay; Creating a global variable: I tried to create a global variable and test to see the scope

Re: How to create a global variable?

2002-04-18 Thread brian
you suggested in each of the .c files? Jay From Brian: In the other sources (not main.c): extern Char *gJay; Creating a global variable: I tried to create a global variable and test to see the scope of that variable in a custom alert. So I created a variable called gJay. Char * gJay

RE: How to create a global variable?

2002-04-18 Thread Paul Gibson
, 2002 8:01 AM To: Palm Developer Forum Subject: How to create a global variable? Creating a global variable: I tried to create a global variable and test to see the scope of that variable in a custom alert. So I created a variable called gJay. Char * gJay = Jay; When I put this code

How to create a global variable?

2002-04-18 Thread Jay Francis
it global or it would lose scope after the function...but I don't see any examples of this being declared globally so was lost on how to do it. How did you guys know the extern keyword would do this. You don't need it in C or C++ to create a global variable. Jay Thanks Brian, Do you mean I declared

Re: How to create a global variable?

2002-04-18 Thread brian
it. How did you guys know the extern keyword would do this. You don't need it in C or C++ to create a global variable. Jay Thanks Brian, Do you mean I declared it correctly and in addition I need to put the code you suggested in each of the .c files? Jay From Brian: In the other sources

RE: How to create a global variable?

2002-04-18 Thread Paul Gibson
all globals. Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jay Francis Sent: Thursday, April 18, 2002 12:26 PM To: Palm Developer Forum Subject: How to create a global variable? Thanks to Brian and Paul. I got it to work. However I am curious

Re: How to create a global variable?

2002-04-18 Thread Richard Bell
with an extern declaration in its .h file If you want a global variable that can be accessed by all of your C Modules then you need to have an extern declaration in your project .h file which gets included in all of your project .c files. Here is an example

Re: Global variable data getting changed

2001-12-23 Thread D De Villiers
Hello Hadrian, What I can see: Your changing the global variable in the line iPlaylistSelection = selection; This will happen everytime you select a new item in the list (general knowledge). Regards, Lennie De Villiers PocketStudio Professional Pocket-Technologies.Inc - www.pocket

Re: Global variable data getting changed

2001-12-23 Thread D De Villiers
Hello Max Bian, Correct me if I'm wrong! Isn't the line x = 0x1234; changing x to some hexidecimal/octal value ? (not y variable). I don't know C much (only Java and alittle C#). What?! How could that happen? From what I have learned from my C class, only the lower byte will be (and should

Re: Global variable data getting changed

2001-12-23 Thread Joe Programmer
--- D De Villiers wrote: Isn't the line x = 0x1234; changing x to some hexidecimal/octal value ? (not y variable). I don't know C much (only Java and alittle C#). Lennie - When you write 0x1234 in C (or C++, and probably also in Java), you are simply using hex notation to express the

Global variable data getting changed

2001-12-21 Thread Palm
? Any help would be appreciated cheers Hadrian code: //global variable static UInt iPlaylistSelection = 0; //section in MyFormHandleEvent where variable is changed case lstSelectEvent: { Word listID = event-data.lstSelect.listID; ListPtr listPtr = event-data.lstSelect.pList; Word

Re: Global variable data getting changed

2001-12-21 Thread Joe Programmer
--- Palm wrote: I have a problem with a global UInt variable. I want the variable to store the selection number of a list. It works fine once and then the second time it gets changed, different data is stored. Is that a problem? If the 2nd selection is not the same as the 1st

Re: Global variable data getting changed

2001-12-21 Thread Max Bian
What?! How could that happen? From what I have learned from my C class, only the lower byte will be (and should be) assigned to x. Max --- Joe Programmer [EMAIL PROTECTED] wrote: static UInt8 x, y, z; x = 0x1234; // probably changes y, too

Re: Global variable data getting changed

2001-12-21 Thread Joe Programmer
Sorry, I was being sloppy. I should have used MemMove or something similar in my example. This will actually overwrite something: static UInt8 x = 0; static UInt8 y = 0; static UInt16 z = 0x1234; MemMove(x, z, 2); The point I was trying to make was that you can over-write a variable if you