Exg Manager Problems

2000-10-29 Thread Addy Chan

I get a task of completing a backup and restore application work like
Handspring backup module.

Scanning through the Palm Programmer's Manual, I found the ExgDB routine fit
our needs.

By using the ExgDBWrite, I can write out the internal database and store as
file format.
However, when I try to restore those file by ExgDBRead,  the application
failed to restore it all database.

I learnt the "specail feature" of ExgDBRead from some past post of this
forum, that the last record of the database should be handle with special
care.

And I can backup and restore most of the application after that, However,
when I try to backup all the database in the Palm, and try to restore all of
them, a number of problem occur.

The main problme is, after restore all the database, I can't soft reset the
device.  ( Is it due to I have backup and restore some currently running
application?)


Other problems are:
1.  How to restore special database eg. Graffiti ShortCut?  which has a
special attribute "dmHdrAttrOKToInstallNewer"
2.  Did I go to the wrong direction of using the ExgDB for this application?
3.  How is Hotsyn application handled the restore process?  ( I have
subscribe and ask for source of PalmOS in PalmOS's web page..  But still
waiting feedback...)

Any assistance and advice would be greatly appreciate.

Best Regards,
Addy

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



RE: Does LstSetListChoices() copy or use the itemsText parameter pass ed?

2000-10-29 Thread Gavin Maxwell

Basically if the API name has "Set" in the title it merely stores a 
reference to whatever you pass in, if it has "Copy" in the name it will 
actually copy what you pass it. eg FrmCopyTitle copies the string you pass it.

Regards,
Gavin.

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



Re: Does LstSetListChoices() copy or use the itemsText parameter pass ed?

2000-10-29 Thread chongwm

Nope, the document states that, though not in the exact words "IT DOES
NOT MAKE A COPY".

->LstSetListChoices (ListType *listP, Char **itemsText, UInt16 numItems)
->Parameters : itemsText Pointer to an array of text strings.

So, u would have to do something like this:
void foo()
{  Char* *strArray;
   Char* strBuf;
   ListType *lstP;
   Int8 i;

   /*lstP = ? get the pointer to your list here */
   strArray = MemPtrNew(sizeof(Char*));
   for (i = 0; i < 10; i++)
   {
   strBuf = MemPtrNew(5);
   StrPrintF(strBuf, "str%d", i);
   strArray[i] = strBuf;
   }
   LstSetListChoices(lstP, strArray, 10);
}

of course, you would have to check the return val of MemPtrNew, I didn't
do it here. Hope this helps!


Jason Garrett wrote:
> 
> Does LstSetListChoices() make its own copy for the list to use, or does it continue 
>to use the memory that you have indicated in this call?
> Could I destroy my string list, and the list remain happy?
> 
> Jason Garrett
> wirelessdata
> Ph: +64 9 379 3710  Fax: +64 9 379 7360 Cell: +64 21 400 307  ICQ: 44334435

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



m100 modem ?

2000-10-29 Thread DEVEN BHATT

Dear friends,

I have m100 and I want to connect it to the net. Can I use my HotSync Cable 
that came with m100 ? If yes, how ? If no, what is the other alternative ? I 
gave a search "modem" on palm.com site, and for m100, it showed me HotSync 
Cable as the modem source. Can someone please tell me how to use HotSync 
Cable to access the net ?

Cheers !!

Deven.
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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



RE: bad news guys/gals

2000-10-29 Thread Craig Evans

I'm guessing you have recently upgrade to the 3.5 SDK ...


Look for a file called "PalmCompatability.h" (in the "...\Palm OS 3.5
Support\Incs" directory on my PC) ... it contains all the #defines for the
palm types. You will find what you want in there.

Initially #include the file in your code, but convert your code to the new
type and plan on eliminating the use of the file.

Regards,
CSE

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Sunday, 29 October 2000 7:37 PM
> To: Palm Developer Forum
> Subject: bad news guys/gals
>
>
> OK, I think this is bad. GCC is complaining about the fact that it doesnt
> know what UIntxx's are, and that I can't create my own structs.
> Ages ago, I
> heard someone talking about a .H file called PalmType.h or something like
> that...in my stupidity, I ignored it...I may need it. If anyone
> knows about
> it, can they send it to me via my address (not the forum)?
>
> ( }#^} Ritz
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/


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



Constructor w/ 65,000 colors?

2000-10-29 Thread Jon Baer

Anyone know if Codewarrior tools has been or will be updated for Handspring Prism 
color depth?

- Jon


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



Does LstSetListChoices() copy or use the itemsText parameter pass ed?

2000-10-29 Thread Jason Garrett

Does LstSetListChoices() make its own copy for the list to use, or does it continue to 
use the memory that you have indicated in this call?
Could I destroy my string list, and the list remain happy?

Jason Garrett
wirelessdata
Ph: +64 9 379 3710  Fax: +64 9 379 7360 Cell: +64 21 400 307  ICQ: 44334435



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



RE: bad news guys/gals

2000-10-29 Thread P. Alan Johnson

Everything you need to define such types are contained within the Palm OS
SDK header files. Perhaps you have the incorrect SDK headers or are pointing
to an older version. Recheck your paths and GCC installation.

The other file, PalmType.r, refers to resource definitions to use along with
constructor or instead of constructor. This file does not contain any data
type definitions, only resource definitions for using with PalmRez.

--Alan
Handsbreadth

> OK, I think this is bad. GCC is complaining about the fact that it doesnt
> know what UIntxx's are, and that I can't create my own structs.


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



bad news guys/gals

2000-10-29 Thread Grounderyoyo22

OK, I think this is bad. GCC is complaining about the fact that it doesnt 
know what UIntxx's are, and that I can't create my own structs. Ages ago, I 
heard someone talking about a .H file called PalmType.h or something like 
that...in my stupidity, I ignored it...I may need it. If anyone knows about 
it, can they send it to me via my address (not the forum)?

( }#^} Ritz

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



Re: Replacing the Launcher application

2000-10-29 Thread Brian Mathis

herry wrote:
> That is not good enough.  I want to completely replace the default Launcher
> so that my application will be the first thing that comes up even if you do
> a hard reset.
> 
> Herry

Well, then you only have one option.

You'll need to create your launcher application, just like normal.  Then,
patch the trap for the application button, like I said previously, using a
hack or something.  Then, after you've got everything all set, use ImagePro
from TRG (www.trgnet.com), and build a custom OS image.  Then flash the
image onto customized Palm devices, and directly sell the customized
devices to your customers.

-- 
Brian Mathis
Direct Edge
http://www.directedge.com

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



Re: Replacing the Launcher application

2000-10-29 Thread herry

That is not good enough.  I want to completely replace the default Launcher
so that my application will be the first thing that comes up even if you do
a hard reset.

Herry

> > I would like to write my own "Launcher" application.  How would I go
about
> > doing this?   How can I replace the existing launcher with my own?
> Well, just write an app that works the way you want it to.  To make it use
> the Launcher silk button you'll need to do some system patching or hack
> writing.



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



Re: Greyscale

2000-10-29 Thread Aaron Ardiri

> Sorry.
> 
> (was that consice enough?)

  dont take my words harshly :) the same issue has come up many times
  on the list - even people trying to get attachments back (vCards etc)
  i think, for the benefit of everyone, a set of posting "rules" should 
  be made available - extra bandwidth doesn't help either :(( 

// az
[EMAIL PROTECTED]
http://www.ardiri.com/<--- free games!


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



Re: Greyscale

2000-10-29 Thread Mike Montalvo

Sorry.

(was that consice enough?)



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



how to create a memopad archive for importing into Palm desktop

2000-10-29 Thread Calvin Hilton

I'm trying to find out what the specs are for creating a memo pad archive 
(mpa) file.  I would like to download a large volume of text to a Palm by 
programatically creating mpa files with a Perl program, importing them into 
the Palm desktop and then synching them to the Palm.

I've searched the Palm doc that I've been able to download and
haven't found the answer to my question.

Any assistance is greatly appreciated.

Calvin
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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



Re: StrCopy/StrCat with printf causes bus error

2000-10-29 Thread Aaron Ardiri

> >   you maybe corrupting the stack somewhere, and, as a result.. corrupting
> >   the "program counter".. and wola.. try storing your string in a resource
> >   instead of as a "local" object in the application..
> > 
> >   you are messing with too much memory, and it just cannot handle it.
> > 
> >   if you changed yout string to "j", then i bet your
> >   error would be "0x70707070" :P - just a small hunch i have :)) try it.
> >   PilRC allows you to create a string resource, and you should be able to
> >   do the same in the Code Warrior environment.
> > 
> > [EMAIL PROTECTED]
> 
> 
> Thanks guys. Silly me, I should have known where that 0x69 was coming
> from. Actually, changing the string to "jj" gives 0x6A, not
> 0x70 -- it's hex, after all.

  thats alcohol + hangover for you :))
 
> Funny thing, that. I originally coded for Linux, using printfs for
> debugging purposes. When I ported to Palm, I just left the printfs in
> the code and the compiler didn't complain even though I wasn't including
> the UNIX stdio.h. On a Palm, the printf just dumps a string onto the
> screen without regard to your application's UI. printf has been a good
> debugging tool up until now.

  if you want to test it.. try this:

StrPrintF(str, "...", ... );
ErrFatalDisplayIf(1, str);

  i assume, you just want to see the "format" - using the "dialogs"
  is a good technique.. just "continue" when done.

// az "no more beer for me"
[EMAIL PROTECTED]
http://www.ardiri.com/<--- free games!


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



Re: StrCopy/StrCat with printf causes bus error

2000-10-29 Thread Stephen A Tang

Aaron Ardiri wrote:
> 
>   maybe the "string" you are copying is barfing the stack somewhere?
> 
>   'i' = 105 = 0x69
> 
>   you maybe corrupting the stack somewhere, and, as a result.. corrupting
>   the "program counter".. and wola.. try storing your string in a resource
>   instead of as a "local" object in the application..
> 
>   you are messing with too much memory, and it just cannot handle it.
> 
>   if you changed yout string to "j", then i bet your
>   error would be "0x70707070" :P - just a small hunch i have :)) try it.
>   PilRC allows you to create a string resource, and you should be able to
>   do the same in the Code Warrior environment.
> 
> [EMAIL PROTECTED]


Thanks guys. Silly me, I should have known where that 0x69 was coming
from. Actually, changing the string to "jj" gives 0x6A, not
0x70 -- it's hex, after all.

When I pull the string out of the function and put it in a string
resource or a global const char array, the error goes away. I suppose
string resources are preferable to global const char arrays because the
latter uses up heap space but the former does not? 

Global const char arrays are a bit more convenient because I have a
number of strings I need to concatenate together at runtime, like this:

  // at top of file
  const char *stringbase = "base ";
  const char *stringA = "alpha ";
  const char *stringB = "beta ";
  const char *stringC = "gamma";

  // inside my function
  StrCopy(sendStr, stringbase);
  if (something == true)
StrCat(sendStr, stringA);
  else
StrCat(sendStr, stringB);

  StrCat(sendStr, stringC);


But if I were to use string resources I'd have to do something like
this:

  // in rcp file
  STRINGTABLE ID myStringTable "base " "alpha " "beta " "gamma"

  // in function
  SysStringByIndex(myStringTable, 0, sendStr, sizeof(sendStr));
  if (something == true)
SysStringByIndex(myStringTable, 1, tempStr, sizeof(tempStr));
  else
SysStringByIndex(myStringTable, 2, tempStr, sizeof(tempStr));
  
  StrCat(sendStr, tempStr);
  SysStringByIndex(myStringTable, 3, tempStr, sizeof(tempStr));
  StrCat(sendStr, tempStr);


which involves a bit more runtime overhead. So, is it better in
principle to sacrifice speed for memory?


"Scott Johnson (Bellevue)" wrote:
> 
> Yes, it looks like a long string of i's is overwriting the stack.  But your
> code seems to be safely copying all those i's into a heap chunk where it
> can't hurt the stack.  But what about that printf call?
>  
> Now where did this printf function come from anyway?  Did you write it
> yourself, or is this the StdIOPalm.c module from Palm?  If the latter, where
> did you get it?  (I can't find the StdIO source files anywhere!)  Either
> way, look in the code for any unsafe buffer size assumptions that could lead
> to this kind of bug.
> 
> -slj-


Funny thing, that. I originally coded for Linux, using printfs for
debugging purposes. When I ported to Palm, I just left the printfs in
the code and the compiler didn't complain even though I wasn't including
the UNIX stdio.h. On a Palm, the printf just dumps a string onto the
screen without regard to your application's UI. printf has been a good
debugging tool up until now.

I tried to find the declaration for printf in the Palm SDK header files,
but it's not there. However, it is in the PRC-Tools m68k-palmos
directory:

satang@aurum:/usr/local/m68k-palmos> find . |xargs grep printf
Binary file ./bin/nm matches
Binary file ./bin/strip matches
Binary file ./bin/ar matches
Binary file ./bin/ranlib matches
Binary file ./bin/as matches
Binary file ./bin/ld matches
Binary file ./bin/gcc matches
Binary file ./lib/libc.a matches
Binary file ./lib/libg.a matches
Binary file ./lib/libmf.a matches
Binary file ./lib/libm.a matches
./include/stdio.h:extern int vsprintf(char *buf, const char *fmt,
va_list args);./include/stdio.h:extern int sprintf(char * buf, const
char *fmt, ...);
./include/stdio.h:extern int printf(const char *fmt, ...);

I never explicitly #include m68k-palmos/include/stdio.h, so it looks
like the compiler is doing it for me. Since the function is in a lib
file, I can't really peek at the source code for it. Oh well.

Thanks again,

Stephen Tang
[EMAIL PROTECTED]

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



Re: Replacing the Launcher application

2000-10-29 Thread Brian Mathis

herry wrote:
> I would like to write my own "Launcher" application.  How would I go about
> doing this?   How can I replace the existing launcher with my own?
> 
> Thanks,
> 
> Herry

Well, just write an app that works the way you want it to.  To make it use
the Launcher silk button you'll need to do some system patching or hack
writing.

-- 
Brian Mathis
Direct Edge
http://www.directedge.com

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



Re: hold a block of 100kb data

2000-10-29 Thread Steve Mann

>If I break into 2 records (60 and 40 KB). I get 2 record pointers (A, B), does
>the memory location of the end of A equal to the previous byte location of the
>start of

No.

Regards,
Steve Mann
-- 
---
Creative Digital Publishing Inc.
1315 Palm Street, San Luis Obispo, CA 93401-3117
---
805.784.9461  805.784.9462 (fax)
[EMAIL PROTECTED]   http://www.cdpubs.com

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



Re: gray in different devices

2000-10-29 Thread Shay

thanks,
i'll try to look in it deeply.

Shay

"Adam Wozniak" <[EMAIL PROTECTED]> wrote in message
news:28206@palm-dev-forum...
>
> Shay wrote:
>
> > Can i do anything so that the grays in IIIx,IIIe,V,Vx will look as much
as
> > IIIc ???
>
> = PRE OS 3.5:
>
> Hypothetically speaking, you could register dive...
>
> See
>
http://ebus.motorola.com/brdata/PDFDB/MICROPROCESSORS/32_BIT/68K-COLDFIRE/M6
83XX/MC68EZ328UM.pdf
>
> Particularly:
>
> section 12.1.2, Controlling the Display
> section 12.1.2.4, Generating Gray-Scale Tones
> Table 12-1. Gray-Scale Palette Options
>
> Anything having to do with the LGPMR register
>
> /* WARNING, completely untested code ahead ! */
>
> UInt8 dark, light; /* should both be in the range 0 to 15 */
> UInt8 *LGPMR = (UInt8 *) 0xFA33;
>
> /* assign values to dark and light */
>
> *LGPMR = ((dark & 0x0F) << 4) | (light & 0x0F);
>
> = OS 3.5 and after:
>
> There are some palette type operations which may or may not do the same
thing.
> I've only used them in the 8 bit modes, but I assume they also work in the
2 and
> 4 bit modes to affect the greyscale palette.
>
> --
> Adam Wozniak Chief Architect
>  Surveyor Corporation
> [EMAIL PROTECTED]4548 Broad Street
> [EMAIL PROTECTED]San Luis Obispo, CA 93401
>
>
>
>



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



Re: CE POSE version

2000-10-29 Thread Aaron Ardiri

> Teach a man to fish...

  ... and the women will go to the shop and purchase the frozen
  fish to make sure he has something to eat.

  (no sexist remark intended - sorry if thats what people think)

  i dont mind people asking questions (heck, sometimes it just sucks
  to waste your own time searching docs/headers) but i wouldn't want
  to see the same question over and over again.

  the knowledge base resource works, however, not all developers
  know about it. what i suggest is that when someone signs up, a
  detailed "reference" is sent to them, so that know where to get
  everything..  maybe, when people "subscribe" to this forum, they
  are forced to say "yes, i know about the knowledge base" etc. etc.

  it may reduce the number of questions that come up (that are repeated)

  cheers

// az
[EMAIL PROTECTED]
http://www.ardiri.com/<--- free games!


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



Re: CE POSE version

2000-10-29 Thread Brian Mathis

[EMAIL PROTECTED] wrote:
> In a message dated 10/28/00 4:09:54 PM Mountain Standard Time,
> [EMAIL PROTECTED] writes:
> 
> > Right, especially because of all the lazy people who ask for something here
> >  instead of doing a simple search for it in the archives or on altavista or
> >  something.  Asking a basic and lazy question will get you a basic response.
> 
> I know this may sound hard to believe, but there are beginners out there on
> this forum that ask basic questions because they don't understand PalmOS
> programming or just programming in general at the level you do.
> 
> ( }#^} Ritz

No, you missed the point.

First, this thread seems to have deviated from the original poster's
question.  That's fine, I just hope Jason doesn't take the rest of these
messages as a personal attack on him.  I think we might have scratched a
wound here, so people feel like venting. :)

Anyway, the point I was trying to make is that it seems some people would
rather just fire off a message to the forum than look in the docs, search
the archives, or even perform a basic search on the Net somewhere.  It's
one thing if you've searched around and couldn't find anything, but often
the question asked will reflect that somehow.

Teach a man to fish...

-- 
Brian Mathis
Direct Edge
http://www.directedge.com

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



RE: CE POSE version

2000-10-29 Thread P. Alan Johnson

> I know this may sound hard to believe, but there are beginners
> out there on
> this forum that ask basic questions because they don't understand PalmOS
> programming or just programming in general at the level you do.
>
> ( }#^} Ritz

(Doing that world famous Handsbreadth double take) Wht? You mean we
weren't really born with this information but had to develop it through a
combination of learning from others, teaching ourselves, research and hard
work?

Personally, I'd rather see the Palm OS basic questions and help where I can
rather than see Microsoft helping with the basic questions and helping where
they can.

--Alan
Handsbreadth


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



Re: hold a block of 100kb data

2000-10-29 Thread Eric

> You haven't described what you are searching for.  Normally you would
> pack one search entry per database record, or N entries.

yes!!! I use this method before. But the search function is part of my engine
that is corss platform. There is no this 64K limit in other platforms. I want
to
use the same search code in all platforms.

>
> I don't understand about your search program.  Why can't you modify
> it?  If your search program (or whatever) requires monolithic data,
> there is no way to do something over 64k (except os 3.5).
>
> FileStreams can handle arbitrary sized data, but they don't create
> monolithic blocks - they function like the stdio fopen/fread type
> calls.

If I break into 2 records (60 and 40 KB). I get 2 record pointers (A, B), does

the memory location of the end of A equal to the previous byte location of the
start of
B?

Eric


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



Re: CE POSE version

2000-10-29 Thread Grounderyoyo22

In a message dated 10/28/00 4:09:54 PM Mountain Standard Time, 
[EMAIL PROTECTED] writes:

> Right, especially because of all the lazy people who ask for something here
>  instead of doing a simple search for it in the archives or on altavista or
>  something.  Asking a basic and lazy question will get you a basic response.

I know this may sound hard to believe, but there are beginners out there on 
this forum that ask basic questions because they don't understand PalmOS 
programming or just programming in general at the level you do. 

( }#^} Ritz

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



RE: SysAppLaunch and iMessenger

2000-10-29 Thread Scott Johnson (Bellevue)

> From: Mike Eynon [mailto:[EMAIL PROTECTED]]
> err=SysAppLaunch(cardNo,dbID,0,sysAppLaunchCmdAddRecord,...);
> When I run this, I am getting an err return of 528 (?)

First, learn to interpret OS error codes.  They always consist of a round
(in hex) base code that indicates the subsystem, plus small sequential
numbers for the specific error.  In this case, 528 should jump out as
looking like 512 + 16, or 0x200 + 16.  And sure enough, the SDK header files
reveal these definitions:

// file ErrorBase.h
#define dmErrorClass 0x0200 // Data Manager

// file DataMgr.h
#define dmErrResourceNotFound (dmErrorClass | 16)

So something in SysAppLaunch is failing to find some resource.  Without the
OS source that's not very specific, but good to know.  So let's look for
problems in your first piece of code:

> In order to get the cardNo and dbID for iMessenger, I do:
> err = DmGetNextDatabaseByTypeCreator( true, &searchState,
>   0, sysFileCMessaging, ... );

You pass zero for the database type to find.  This tells it to return the
first matching database with iMessenger's creator ID.  This might just work
and find the iMessenger application, but it might find some other database
that has the same creator ID instead.  In fact that's what is happening
here.  It finds iMessenger's 'DATA' database instead.  (Or on 3.5 it may
also find the resource overlay DB.)  Then when you try to SysAppLaunch it,
the OS can't find a code resource in it, so SysAppLaunch fails and returns
dmErrResourceNotFound.

The fix: pass sysFileTApplication ('appl') instead of 0 to DmGNDBTC.

-slj-


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



Re: Greyscale

2000-10-29 Thread Aaron Ardiri

hi!

  palm-dev-forum people: :P

  surely, it would be good to accept these guidelines when posting?
  can the list administrator look into this? a message in this thread
  was a whopping 40K! so much for thinking of our palm.net subscribers
  who read these messages.

a) no attachments of any form
   - MIME
   - uuencoded files 
b) limit size of a message to 8Kb
   - you shouldn't "include" the whole last message, just
 remove the bits you dont need and make it clear and
 consice.. straight to the point.

  cheers

// az
[EMAIL PROTECTED]
http://www.ardiri.com/<--- free games!



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



Re: StrCopy/StrCat with printf causes bus error

2000-10-29 Thread Aaron Ardiri

> It seems that when I create a large string with StrCopy and StrCat, I
> cannot print that string without causing a bus error or a program
> counter error. The program counter error looks like:
> 
>   "QTest" (unknown version) is attempting to change the emulated
>   program counter to 0x69696969.  This address is invalid because
>   it's not even.

  0x69696969? i dont want to know where that number came from :)
 
> Here's the relevant fragment of my code:
*
>char *sendStr;
>Handle H;
>H = (Handle)MemHandleNew(2000);
>sendStr = (char *)MemHandleLock((VoidHand)H);
> 
>StrCopy(sendStr,
> 
>"ii");
> 
>printf("sendstr = \n%s",sendStr);
> 
> 
> If I use
> 
>StrCopy(sendStr, "iii");
>StrCat(sendStr,
> 
>"iii");
> 
> or some other variation involving multiple StrCats, I still get the
> error. However, this only seems to happen if the final length of sendStr
> exceeds a certain value (around 115 characters). If sendStr is small
> enough, there's no problem. I don't understand this since I'm allocating
> far more memory than is required.

  maybe the "string" you are copying is barfing the stack somewhere?

  'i' = 105 = 0x69

  you maybe corrupting the stack somewhere, and, as a result.. corrupting
  the "program counter".. and wola.. try storing your string in a resource
  instead of as a "local" object in the application..

  you are messing with too much memory, and it just cannot handle it.

  if you changed yout string to "j", then i bet your
  error would be "0x70707070" :P - just a small hunch i have :)) try it.
  PilRC allows you to create a string resource, and you should be able to
  do the same in the Code Warrior environment.

  hope this helps.

// az
[EMAIL PROTECTED]
http://www.ardiri.com/<--- free games!


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



RE: StrCopy/StrCat with printf causes bus error

2000-10-29 Thread Scott Johnson (Bellevue)

> From: Stephen A Tang [mailto:[EMAIL PROTECTED]]
>  "QTest" (unknown version) is attempting to change the emulated
>  program counter to 0x69696969.

That error almost always means the stack got trashed, such as by a buffer
overrun bug.  In this case, note that 0x69696969 equals ''.  A clue?

> Here's the relevant fragment of my code:
>   H = (Handle)MemHandleNew(2000);
>   sendStr = (char *)MemHandleLock((VoidHand)H);
>   StrCopy(sendStr, "i.i");
>   printf("sendstr = \n%s",sendStr);

Yes, it looks like a long string of i's is overwriting the stack.  But your
code seems to be safely copying all those i's into a heap chunk where it
can't hurt the stack.  But what about that printf call?

> this only seems to happen if the final length of sendStr
> exceeds a certain value (around 115 characters).
> Also, if I get rid of the printf, the error does not occur.

Aha!  So if you pass printf a string above a certain size, that string ends
up stomping all over the stack.  That's certainly suspicious.

Now where did this printf function come from anyway?  Did you write it
yourself, or is this the StdIOPalm.c module from Palm?  If the latter, where
did you get it?  (I can't find the StdIO source files anywhere!)  Either
way, look in the code for any unsafe buffer size assumptions that could lead
to this kind of bug.

-slj-


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



Re: Mem leak found, but how to squelch?

2000-10-29 Thread chongwm

True, having an array of handles would be easier on the OS's memory.
Like you wrote, I could even make it a dynamic array and resize it when
I need more or less memory.

However, there's another problem. This one relates to form refreshing (I
think). I kill all the handles in my form's close event (right after
FrmReturnToForm(Main)), everything is fine. 
But, if I were to quit my dialog form (which has all the fields) using
the "Application (Home)" silkscreened button, somehow, FrmReturnToForm
does not delete my dialog form, I kill the handles, and the OS gives me
a NULL handle error. I am fairly sure that the NULL handle is from my
field (the one I killed).
Any ideas?

Chris Tutty wrote:
> 
> <[EMAIL PROTECTED]> wrote
> > Right now I'm maintaining a linked-list to remember all the handles that
> > were created, each piece of the list taking an additional 96 bits (of
> > locked memory), I'm not being very memory efficient here.
> >
> Can you allocate an array of handles?  This needs a bit of code
> to manage it, but avoids the allocation overhead and heap fragmentation
> of a linked list.  Even if you don't know how many handles you'll need
> it's not hard to allocate a fixed block of, say, twenty handles and then
> resize the chunk by a fixed amount when you've used those handles.
> 
> This means that you can unlock and release the handles and then the
> array itself in response to the form close event.
> 
> Although I've got a sneaking suspicion that I'm forgetting something.
> 
> Chris Tutty

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