Re: Strange issue

2003-08-14 Thread Engi
In news [EMAIL PROTECTED],
José dos Santos Machado <[EMAIL PROTECTED]> wrote:

> Engi escreveu:
>> Hi,
>> If you go to http://aquapalm.free.fr , you could see my problem.
>> When my records don't have any note, all is fine.
>> But if I add a note, all the characters which are drawed after the
>> note indicator are weird.
>
>
> Hello Engi,
>
> Ahm, let's see: Could you provide more information on this issue ?
> Like: This program you're developing ? Are you using a Table, a List,
> a Gadget ?

My program uses a table which is divided in 3 columns : date, operator and
value.
All the columns have customTableItem style.

> Have you tried to debug you APP and found something strange ?

Yes, I have and nothing strange.

> And... Aren't you forgeting any pointer lost on your program ?

Perhaps, but I don't see anything ...


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


Re: Freeing Variables

2003-08-14 Thread James
Régis Daniel de Oliveira wrote:
>
> Is there anyway to free a static variable, like Char Teste[50], and, with
> this, avoid memory leaks?

Such memory is not allocated from the heap and won't cause memory leaks. 
Static variables equivalent to globals with a restricted scope; it doesn't make
sense to free them yourself.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


How to use Radio Button

2003-08-14 Thread Marianne
Hello,

Is there a way to use Radio Button? I found that Push Button is used instead
of Radio Buttons, but I want the actual look and feel of Radio Button..

Regards,

Marianne Jose


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


Recording problem

2003-08-14 Thread rguevara
Hello!
here a new problem:

Err GrabaNuevoItem(void) //Record a new item in the actual record
{
 UInt16 NuevoIndice;
 MemHandle registroH;
 Err error=0;
 OrderReg item;  //It's similar to 'Sales' example struct
 NuevoIndice=gNumOrden-1;
 registroH = DmGetRecord(PedidosDB, NuevoIndice);
 if(!registroH)
error = DmGetLastErr();
 else
{
 Int16 len = 0;
 UInt16 Indice = gNumOrden-1;
 len = (MemHandleSize(registroH));
 IngresaItem(item.items);
 item.cantitems=gcantitems;
{
 Char *s;
 Int16 length=len; //lose 'len' why?
 length += StrLen(item.items[gcantitems-1].codigo)+1;
 length += sizeof(item.items[gcantitems-1].cantidad);
 length += sizeof(item.items[gcanti
 DmResizeRecord(PedidosDB, gNumOrden-1, length);

 registroH = DmGetRecord(PedidosDB, gNumOrden-1);
 if(!registroH)
 FrmCustomAlert(Mensaje,"Handle null", NULL,NULL);
 s=MemHandleLock(registroH); 
DmWite(s,offsetof(OrderReg,cantitems),&item.cantitems,sizeof(item.cantitems));
DmWrite(s,offsetof(OrderReg,items[gcantitems-1].cantidad),&item.items->cantidad,sizeof(item.items->cantidad));
DmWrite(s,offsetof(OrderReg,items[gcantitems-1].precio),&item.items->precio,sizeof(item.items->precio));
DmStrCopy(s,offsetof(OrderReg,items[gcantitems-1].codigo),item.items[gcantitems-1].codigo);
}
 DmReleaseRecord(PedidosDB, Indice, true);
}
 return error;
}

Allways say Handle null, the index it's all right.
if delete the second DmGetRecord the handle point to nobody location
Please helpme!



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


RE: Recomnd 16-Bit editor/converter?

2003-08-14 Thread Randall Pulsifer
  > 
  > you want 5-6-5 for palmos :)

lol, I know, I saw that as soon as my own msg popped up in my email
client and I just KNEW someone would have to point it out.  =P
  > 
  > why not just work in 24 bit, and, then let pilrc/other convert it
  > to the 5-6-5 format :)
  > 
It can't be that easy, besides, I have tried a couple things, i.e.
Constructor converts it such that it functions, but the colors are all
wrong. Adding the 4th BITMAP line in the RCP file:
BITMAPFAMILYEX ID ULHome
BEGIN
BITMAP "ULHome1bppD1.bmp" BPP 1 DENSITY 1
BITMAP "ULHome8bppD1.bmp" BPP 8 DENSITY 1
BITMAP "ULHome8bppD2.bmp" BPP 8 DENSITY 2 TRANSPARENTINDEX 211
BITMAP "ULHome24bppD2.bmp" BPP 16 DENSITY 2 //<<--- Doesn't like
this!
END

Causes CW9 to have a fatal crash when it tries to compile and either
disappears completely or throws me into MS's C++ debugger! (I hate it
when that happens...)
I must be doing something out of sequence, so what procedure would you
recommend?
Thanks!
Randyp
  > ---
  > Aaron Ardiri[EMAIL PROTECTED]
  > CEO - CTO   +46 70 656 1143
  > Mobile Wizardry  http://www.mobilewizardry.com/
  > 
  > 
  > --
  > For information on using the Palm Developer Forums, or to
unsubscribe,
  > please see http://www.palmos.com/dev/support/forums/


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


Re: a dbID question

2003-08-14 Thread nevaip
--- In [EMAIL PROTECTED], Chris Olson <[EMAIL PROTECTED]> wrote:
>  From experience:  Any time the OS wants it to!  After a DB delete,
DB 
> install, DB create, etc.  Basically, any time the OS thinks it
needs to 
> shuffle memory around to make room for stuff...
> >If I have a DB on the Palm which I do not change at all, then can
the dbID of
> >it change? Under what circumstances? Assume that
DmSetDatabaseInfo() has NOT
> >been used on the DB. 

OK, Chris, if you are right, then what happens with

SysNotifyRegister (cardNo, dbID,...)
...
blahblah
...
SysNotifyUnregister (cardNo, dbID,...)

Could this fail if the dbID of your application changed during
"blahblah"? Does the system do anything about this?
There could be days between SysNotifyRegister and SysNotifyUnregister
/PaulN


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


Re: Okay to use DmWrite() on ordinary memory?

2003-08-14 Thread Alan Ingleby
"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hey, i responsed cause you mentioned me :) not to nit-pick you :) *g*

That's OK.  I was just having a bad morning.  I'm all better now I've got my
caffeine fix.

You do have to admit though, that many of the posts that go into this forum
consist of minor corrections to previous people's posts.  Not that there's
anything wrong with that.. I'm just insecure. :-)

Alan



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


ALLOW_ACCESS_TO_INTERNALS_OF_CONTROLS?

2003-08-14 Thread Dragomir Goranov
Hi,
I want to access the internals fields of ControlType structures. Here is my
code:
//Before including any of the PalmOS system headers I define insert this
line:
#define ALLOW_ACCESS_TO_INTERNALS_OF_CONTROLS

.
//And i want this code to compile
//But the compiler says:
//Error: illegal use of incomplete struct 'ControlType'
Boolean Ctl_Visible(UInt16 CtlID) {
 FormType *form = FrmGetActiveForm();
 ControlType *ctl = (ControlType *) FrmGetObjectPtr (form,FrmGetObjectIndex
(form,CtlID));
 return (ctl->attr.visible);
}


What am I doing wrong?


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


Re: Emulator

2003-08-14 Thread Alan Ingleby
1) Make sure you've checked the box in the emulator marked "Redirect Netlib
calls to host"
2) In the Hotsync program on the emulator: Menu->Modem Sync
Preferences->Network
3) In the Hotsync program on the emulator: Menu->Primary PC Setup enter your
computer name, and enter 127.0.0.1 in the primary pc address.
4) In the Hotsync program on the emulator: Select service->Enter phone
number - Enter 00 as the number
5) In your desktop hotsync manager, make sure you've selected "Network"

Done.

"Oliver" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> > Could any one tell me how to hotsyc in my
> > emulator? what config have to set?
>
> Did you read the manual that came with it?
>
> Oliver
>
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
>



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


Multi segment shared library with PRCTools

2003-08-14 Thread Magnus Berg
In my project, the GUI application was converted into a multi segment 
app a few months ago. Now, the shared library part needs the same 
operation but when I try to do the same thing with the library, the 
linker complains about not finding:

GccLoadCodeAndRelocateData

and one other that does the opposite.

I'm guessing these functions are included in the startup files which I 
don't include since I link with the -nostartfiles switch. So the 
question is, how do I find these functions without including the startup 
files?

stubgen and multigen are reasonably well documented by themselves but 
I'm unable to find any docs on how to combine the two.

I found some info about making a glib shared library instead of a system 
shared library, is that the way to go?

Anybody?

	Magnus

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


Re: Similar Utility to palmdump

2003-08-14 Thread Aaron Ardiri
> Anyone have any fancy-smancy UNIX utilities that dump out ONLY the
> records from a pdb? As in, without header info and all that fun stuff...

pdb2files, par

---
Aaron Ardiri[EMAIL PROTECTED]
CEO - CTO   +46 70 656 1143
Mobile Wizardry  http://www.mobilewizardry.com/


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


Re: clipping and WinDrawChars()

2003-08-14 Thread Brian Smith
On Mon, 11 Aug 2003, Todd Niec wrote:

> Does WinDrawChars() limit the output to the current clipping rectangle?
> It seems like it should, but unless I am making a mistake in setting the
> clipping rectangle, the text is going outside of the rectangle.

It does (or, at least it has for me many times before).  Can you paste the
offending code here?

-- 
---
Brian Smith // avalon73 at arthurian dot nu // http://www.arthurian.nu/
Software Developer  //  Gamer  //   Webmaster  //  System Administrator
After 16 years, MTV has finally completed its deevolution into the
 shiny things network.

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


BlueTooth error codes

2003-08-14 Thread Jan Slodicka
Hello

Anybody knows where to find BlueTooth error codes? All I know there is
blthErrorClass defined but I can't find corresponding codes. CW dialog
"Search for Palm OS Error COdes" does not help either.

What I want is to inteligently handle selected error codes from ExgPut().
For example pressing cancel returns 0x3127 - this might denote user abort
and the user should not be bordered with a nasty error message "Error
0x3127".

Jan Slodicka



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


Dynamic Icon Changing

2003-08-14 Thread Dhanashri K
Hello ,
Can I change my application's icon dynamically , in the application launcher 
,  depending on certain system conditions , like sleep mode , etc ?
Regards ,
Dhanashri .

_
Over 6,70,000 brides and grooms. 
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Click here to join 
for free.

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


Re: Does anyone notice this bug on Tungsten C?

2003-08-14 Thread Xing Jin
I also reported it yesterday, thanks a lot, and I will check it on other
TCs.

cheers
Xing

"Flex" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> Yep - in the developer area. I've already reported 3 :)
> by the way my TC have no such bug - hardware issue.
>
> "Chris Apers" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > Is there a bug tracker for palmos related bugs ?
> >
> > > Hi,
> > >
> > > I found an interesting bug whilst I am porting our application from
Sony
> > > Clie to Tungsten C:
> > > There is no pen down event at screen Y >= 310 while the Tungsten C
> screen
> > > size is 320 * 320. The bug also is found on all other applications
> > installed
> > > in the device, I assume it should be a problem on the hardware(Touch
> > Screen)
> > > rather than a OS bug.
> > >
> > > Any suggestion or comment is welcome.
> > >
> > > Cheers,
> > > Xing
> > >
> > >
> > >
> > > --
> > > For information on using the Palm Developer Forums, or to unsubscribe,
> > please see http://www.palmos.com/dev/support/forums/
> > >
> >
> >
>
>
>
>



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


nilEvent problem

2003-08-14 Thread Season Wong
I have design an timing critical application that having a time bar dropping
every 250ms, so I used

EvtGetEvent(&event, SysTicksPerSecond() / 4)

at my EventLoop routine and handled the dropping of time bar at nilEvent, it
works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the time
bar drops very fast. Please help!


Thanks!

Tony



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


Re: TblSetCustomDrawProcedure() - illegal implicit conversion

2003-08-14 Thread Frank Schaeckermann
[EMAIL PROTECTED] wrote:
That worked, but I'm now getting this error:
'illegal implicit conversion from
'void(*) (void *, unsigned short, unsigned short, struct RectangleType *)'
to
'void(*) (void *, short, short, struct RectangleType *)'
First of all, I'm only sending 3 parameters, so why is it saying I'm
sending four?
It's not the call to TblSetCustomDrawProcedure (with 3 parameters) 
that's the problem here but the third parameter of that call which is a 
pointer to a function that is expected to have a signature of

 void ()(void *, unsigned short, unsigned short, struct RectangleType *)

but actually has a signature of

 void ()(void *, short, short, struct RectangleType *)

Got it? Your definition of MainListDrawFunction is the problem! The 
second and third parameter of MainListDrawFunction must be unsigned 
short instead of short as it currently is in your code!

Secondly, I tried casting these parameters to (UInt) with no luck...

I didn't realize out last developer was using C++ whcih I'm not all that
familiar with,
is this a C++ issue as well? This'll take care of 4 out of 6 errors if I
can figure
this out, so hopefully I can squeeze by the C++ barrier on this.
Thanks.

Nole


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


Custom fonts

2003-08-14 Thread LionScribe
Is there anyway for me to have my application replace (while my application
is running) stdFont with a custom font. That way I do not have to play
around with alerts and helps so that they should use my custom font. I am
also thinking of putting my font in a shared library, and I do not want the
developer to have to change all fonts to fntAppFontCustomBase...
Lionscribe



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


Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On 05 Aug 2003 10:57:18 +0100, kcorey <[EMAIL PROTECTED]> wrote:
>
>On Tue, 2003-08-05 at 10:43, bullshark wrote:
>> >2) Allocate an array from dynamic memory for the strings and copy all
>> >the strings into memory.
>> 
>> That's the ticket. 'Dynamic'. Copy is what you do when you draw.
>> The difference is that with a LstSetListChoices you have access to the
>> list after you create it.
>
>So you're saying that it's better to allocate n blocks of memory,

If you are referring to that abominable example in the article
then the answer ia absolutely not. The author was on drugs.
He/She didn't have a clue how to manage memory or Dynamic lists.

If done correctly, the list is allocated/freed with one MemPtrNew/Free 
call.

>I'd rather not clutter up dynamic memory with any more locked blocks
>than I must.  

One locked block per list? Sheesh. But still I must ask "Why?".

Locked-Schmocked...Locked memory is nothing. The principle
purpose of Handles is to permit reorganization of DB memory 
into contiguous extents for sequential access. For purposes
of lifetime program allocations, it is inconsequential.

>
>> No, you're not chewing up 'large amounts' of memory, and what is the
>> memory for anyway?  Do you think your program is 'better' if it leaves
>> the heap unutilized'? 
>
>It's quite simple: you're less likely to run out of memory if you're
>careful of your memory requirements.  

Less likely than what? I've never run out. That would be 'Less likely than Zero'.
Code space OTOH, is in desperately short supply.

>Until your program is done, you're never sure exactly how much memory it will require.

Why is that? If you're talking about "to the byte" your life must be
hard. Knowing requirements to the nearest 10K is good enough
and quite easy to estimate.

>Why burn memory when you don't need to? There's not enough dynamic
>memory on the Palm as it is.

There's not? What are you doing with it? Burning it up with
C++? If that's the case, then we're on different pages.

>
>> So is LstSetListChoices. Quite a bit easier, in fact.
>
>You're not taking into account allocation/assigning
>strings/deallocation.  

Yes I am. Deallocating is:

if(pListTxt != NULL)//pretty hard
   memPtrFree(pListText);   //huh?

and there are at most two of those clauses for a dynamic list.
Since one of those is in the builder method, it is never repeated
for additional lists. Additional lists get one clause in the 
stop program method.

>> Not as boiler plate as LstSetListChoices(). Your code is a maintenance
>> chore. Building a list for LstSetListChoices is a piece of cake.
>> It is so 'boiler-plate' that a single subroutine, written once, lib'd
>> and never touched again will do for most applications.
>
>*smile* I'm glad you've found a solution that works for you.  

I didn't find it.
The solution was provided by the engineers that developed the API.
They even provided support methods to make the job easy.
The API is one of the most efficient and finely crafted in the world.
If you use it well, as intended, very small programs do very large
things.

All I do is make use of it, as opposed to replacing it.

bullshark

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


Re: FrmNewLabel

2003-08-14 Thread Alan Ingleby
"gamepower111" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> FrmNewLabel (&frmP, 1500,labelCaption , 30,30, stdFont) ;

You have to call FrmDrawForm to get the label redrawn.  Or you could try
hiding and then showing it again.  I've heard that the dynamic UI on PalmOS
is a bit unstable, so why not just use WinDrawChars("Hello",5,30,30) to do
this job?

Alan



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


Re: TblSetCustomDrawProcedure() - illegal implicit conversion

2003-08-14 Thread Ben Combee
At 11:06 AM 8/12/2003, [EMAIL PROTECTED] wrote:

This compiles and runs fine in CodeWarrior Release 5:
TblSetCustomDrawProcedure (pTable, Col_SlotCode,
MainListDrawFunction);
 but it says for CW9 that I'm performing an:
"illegal implicit conversion from 'void (void *, unsigned short, unsigned
short, struct RectangleType *)' to
'void (*) (void *, unsigned short, unsigned short, struct RectangleType *)'
Is there something not working with the TblSetCustomDrawProcedure() when
using
#include  that I'm not aware of???
Try writing

TblSetCustomDrawProcedure (pTable, Col_SlotCode,
&MainListDrawFunction);
C++ doesn't allow the implicit taking of a function pointer from a function 
bare name.  That's what the error is saying.  If you notice, the type 
difference is the "(*)" after the first void.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


newbie question: how to read a string from a MemHandle?

2003-08-14 Thread blaman
hi everbody, i am new to palm and its memoryhandles.

I receive a string and have to store it in a MemHandle, because i resize it
in a loop while receiving the data. However, i´ve got no idea how to read
the data from the handle, neither a normal (char*) cast, nor a sprintf
works. I´m sure it is pretty easy but i don´t know how to do it :o|

thanx in advance, Jan Pfluger



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


Codewarrior Runtime Lib probs

2003-08-14 Thread Mike Shubeck
 I'm trying to move my C++ app to CW 9 and have been running into the error
"Link Error : _RuntimeModule_: '_Startup_' referenced from _DummyStartup_'
is undefined". I currently have the project linking to MSL_C++_PalmOS_2i.lib
which I believe is correct (Targeting the Palm OS platform ->...-> Runtime
Library Reference uses different names).  What am I missing?

Thanks,
Mike

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


How to get WinDrawBitmap to handle GIF format?

2003-08-14 Thread Ray Lee
Hi!

I have a gif image that I'm trying to draw inside my form but am having
trouble.  Doesn't WinDrawBitmap handles GIFs or is there another function
that I'll need do this?  Any insight would be greatly appreciated.  Thanks!!

Ray


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


Re: Re[2]: DB create/write problem

2003-08-14 Thread Thomas Damme
Hello Boris,

this is more fundamental:

1) It seems, you dont understand the meaning of sizeof(). This function is
processed at compile-time and just inserts the length of a specific
data-type. That means:
sizeof(UInt8) == 1
sizeof(UInt16) == 2
sizeof(Char) == 1
sizeof(Char*) == 4 (its a pointer and all pointers are 32 bit)

what about your struct? : struct Airline
sizeof(Airline) == 6 since its a UInt16 and a Char*

the sizeof-function only works for datatypes not for memory-chunks.

2) when you assign a new chunk of memory to airlineName, it resides
somewhere in memory but not at the address of air.airlineName.

Thats why you have to create the new record like this:
ulLen=sizeof(air.airlineID)+StrLen(air.airlineName)+1;
h = DmNewRecord(gDB, &index, ulLen);

and write it to the record like this

// The ID; here sizeof() works
err = DmWrite(p, 0, &(air.airlineID), sizeof(air.airlineID));
// The Name; here it does not.
err = DmWrite(p, sizeof(air.airlineID), air.airlineName,
StrLen(air.airlineName)+1);

Hope this helps,

Thomas


"Boris Epshteyn" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
> Unfortunately this does not work. :(
> I've tried to write the record with one DmWrite, without any success:
> err = DmWrite(p, 0, &air, sizeof(air));
>
> Boris
>
>
>
> TD> Hello Boris,
>
> TD> I think your problem is there:
>
> >>err = DmWrite(p, sizeof(air.airlineID), &(air.airlineName),
> TD> sizeof(air.airlineName));
>
> TD> it should be like this:
> TD> err = DmWrite(p, sizeof(air.airlineID), air.airlineName,
> TD> StrLen(air.airlineName));
>
> TD> 1) air.airlineName is already a pointer since you aquired it by
MemPtrNew
> TD> 2) sizeof(air.airlineName) is wrong since this is only a sizeof(Char*)
which
> TD> is 4 byte, not the length of your string.
>
> TD> Thomas
>
> TD> "Boris Epshteyn" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> TD> news:[EMAIL PROTECTED]
> >>
> >> Hi,
> >>
> >> I am trying to create a DB from the static data. In my AppStart, if DB
> >> does not exists, I create it with four records. The records is defined
> >> as following:
> >> typedef struct Airline
> >> {
> >> UInt16 airlineID;
> >> char  *airlineName;
> >> } Airline;
> >>
> >> Since my airlineName is variable length, I am allocating memory for
> >> it, then using StrCopy populating it. Using DmWrite I am writing itto
> >> the database. But when my temporary object gets released, data from the
> >> DB also disappears. I would appreciate any advice. Or, may you can
> >> suggest an application/utility to create DB for initial load from
> >> static data. I have tried pdbc, but when POSE gives an error when
> >> trying to load db into POSE. The code for my appStart is:
> >>
> >> static char * airlines[AIRLINE_COUNT] = {"Delta", "AA Airline",
> TD> "Lufthansa", "United"};
> >>
> >> static Err AppStart(void)
> >> {
> >>MemHandle han;
> >>Err err = 0;
> >>
> >>gDB = DmOpenDatabaseByTypeCreator('DATA', kCreator,
dmModeReadWrite);
> >>if (!gDB) {
> >>   err = DmGetLastErr();
> >>   if (err == dmErrCantFind) {
> >>  err = DmCreateDatabase(0, "AirlineTable-ABCD", kCreator,
'DATA',
> TD> false);
> >>  FrmCustomAlert(alrtNODB, "Created?", NULL, NULL);
> >>  if (err == 0) {
> >> FrmCustomAlert(alrtNODB, NULL, NULL, NULL);
> >> gDB = DmOpenDatabaseByTypeCreator('DATA', kCreator,
> TD> dmModeReadWrite);
> >> if (gDB) {
> >>UInt16 i;
> >>// create initial records
> >>for (i = 0;i < AIRLINE_COUNT && err == 0; i++) {
> >>Airline air;
> >>UInt16 index = dmMaxRecordIndex;
> >>MemHandle h;
> >>air.airlineID = i + 110;
> >>air.airlineName = MemPtrNew(StrLen(airlines[i]) +
1);
> >>if (air.airlineName != NULL)
> >>{
> >>   StrCopy(air.airlineName, airlines[i]);
> >>}
> >>h = DmNewRecord(gDB, &index, sizeof(air));
> >>if (!h)
> >>err = DmGetLastErr();
> >>else {
> >> MemPtr p = MemHandleLock(h);
> >> MemPtr tr;
> >> err = DmWrite(p, 0, &(air.airlineID),
> TD> sizeof(air.airlineID));
> >> err = DmWrite(p, sizeof(air.airlineID),
> TD> &(air.airlineName), sizeof(air.airlineName));
> >> MemHandleUnlock(h);
> >> DmReleaseRecord(gDB, index, true);
> >>}
> >>MemPtrFree(air.airlineName);
> >>}
> >> }
> >>  }
> >>   }
> >>}
> >>FrmCustomAlert(alrtNODB, "Exiting Init", NULL, NULL);
> >>return err;
> >> }
> >>
> >> --
> >> Best regards,
> >>  Boris  mailto:[EMAIL PROTECTED]
> >>
> >>
> >>
>
>

Re: DmAttachRecord with MemHandleNew

2003-08-14 Thread José dos Santos Machado
Todd Niec escreveu:
Is it possible to use DmAttachRecord with memory that was allocated with
MemHandleNew()?  The documentation doesn't say you can't, but it seems
like I get weird behavior if I try this.
Short answer: No, you can't. Use DmNewHandle instead. 

-- J. Machado
-- [EMAIL PROTECTED] 

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


Re: Please Help LstSetListChoices not working

2003-08-14 Thread Ben Combee
At 05:14 PM 8/13/2003, Steve K wrote:
I tried your suggestion still I get nothing.  I've tried adding a
LstDrawList still get nothing.
Have you stepped through with a debugger and verified that the system call 
that makes your list of string pointers is correctly formatting up the list?

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: .rsrc Zero Bytes

2003-08-14 Thread Paul Johnson
Can someone explain to me why this is btw ? I find it a total pita so I
guess its a Mac hangover.

Flame on. lol  :)


Regards,
Paul Johnson
Applewood House
www.applewoodhouse.com


- Original Message -
From: "Ben Combee" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 9:57 PM
Subject: Re: .rsrc Zero Bytes


> At 01:22 PM 8/5/2003, Manohar Chapalamadugu wrote:
> >Hi,
> >
> >I am in midst of developing a small application which
> >has 4-5 forms. Today, I added a new form to the
> >Constructor and the codewarrior simply shuts off
> >itself when trying to copy resources while compiling.
> >I checked the size of the .rsrc and it says 0 bytes.
> >But when I open it with constructor, I can see all the
> >forms. I tried to remove the new form that I
> >introduced, I still have the same problem. I even
> >deleted all the temp files and rebuilt all. I am
> >struck up.
>
> There is a hidden folder in the same location as your zero-byte .rsrc file
> called RESOURCE.FRK.  The real resources are inside this folder.
>
> Which version of CodeWarrior are you using that it crashes while copying
> resources?  Are you using the 5.0 R2 SDK with the latest version of
PalmRez
> installed into your CW bin/plugins/Linker tree?
>
> --
> Ben Combee <[EMAIL PROTECTED]>
> CodeWarrior for Palm OS technical lead
> Palm OS programming help @ www.palmoswerks.com
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


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


Re: Codewarrio stack usage with temporaries

2003-08-14 Thread Ben Combee

>#pragma stack_cleanup on
>
>will cause the compiler to remove items from the stack as soon as a
>function returns.
AHA.  the temporaries in question are all being passed to a function...

Are there dissadvantages to using that pragma?  speed might be one.  Is
the speed difference signficant?
speed will be slightly slower, but it's not significant; I don't remember 
why we didn't make that always on for Palm OS.

If there are dissadvantages, Can I turn that pragma on in one section of
the code and then off again afterwards?
You can control it function-by-function, but not within a function.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: newbie question: how to read a string from a MemHandle?

2003-08-14 Thread Gearoid Murphy
I'm not sure what you are doing wrong.  As I see it to write the data to the 
handle you should be doing something like the following:

// global MemHandle
MemHandle h = NULL;
// Append data to whatever is already in handle
void WriteDataToHandle(Char *dataInP)
{
   Char *strP;
   Err err;
   UInt16 len = StrLen(dataInP);
   if (!h)
   {
h = MemHandleNew(len+1);
if (h)
{
 strP = (Char *)MemHandleLock(h);
 if (strP)
 {
   StrCopy(strP, dataInP);
   MemHandleUnlock(h);
 }
}
   }
   else
   {
 err = MemHandleResize(MemHandleSize(h)+(len+1));
 if (!err)
 {
  strP = (Char *)MemHandleLock(h);
  if (strP)
  {
// Append data
StrCat(strP, dataInP);
MemHandleUnlock(h);
  }
 }
   }
}
// Read data from handle
void ReadDataFromHandle()
{
Char *strP = NULL;
if (h)
{
  strP = (Char *)MemHandleLock(h);
  if (strP)
  {
DisplayStr(strP);
MemHandleUnlock(h);
  }
}
}
// Finally free handle
MemHandleFree(h);
Regards,

Ger

From: "blaman" <[EMAIL PROTECTED]>
Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Subject: Re: newbie question: how to read a string from a MemHandle?
Date: Thu, 7 Aug 2003 11:30:08 +0200
at first thanx for your reply. However, when i try to access strP my
programm crashes telling me it read memory from the memory manager data
structures. Any idea what i did wrong? i locked the handle to write it,
unlocked it, locked it again by
strP = (Char *)MemHandleLock(h);

accessed strP and it crashed.

"Gearoid Murphy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Char *strP;
>
> strP = (Char *)MemHandleLock(h); // h is a MemHandle
>
>
> if (strP)
> {
> // Do stuff with strP
> }
>
> // Make sure to unlock MemHandle
> MemHandleUnlock(h);


--
For information on using the Palm Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

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


Setting WinDrawTruncChar issue

2003-08-14 Thread Régis Daniel de Oliveira
Hy all!


I use the folowing code to set color of the text that i will draw on a list
to blue:


RGBColorType rgb;
MemSet(&rgb, sizeof(rgb), 0);
rgb.b= 255;

WinSetTextColor (WinRGBToIndex(&rgb));

WinDrawTruncChars(Descricao, StrLen(Descricao), bounds->topLeft.x,
bounds->topLeft.y, 150);

But, when I set the focus on this text, the color continues blue, and not
changes to white.

How can i set the color of the text when it is selected?


Thanks!

Régis Daniel de Oliveira



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


Re: Recording problem

2003-08-14 Thread rguevara
Yes, but was an error in IngresaItem, now i cleanup the code and should work
logically:

void GrabaNuevoItem(void)
{
 UInt16 NuevoIndice;
 MemHandle registroH;
 OrderReg item;
 Int16 length = 0;
 Char *s;
 NuevoIndice=gNumOrden-1;

 registroH = DmGetRecord(PedidosDB, NuevoIndice);
 if(!registroH)
FrmCustomAlert(Mensaje,"Handle null", NULL,NULL);
 else
length = (MemHandleSize(registroH)); //Calcule last size of record

 DmReleaseRecord(PedidosDB, NuevoIndice, true); // right?

 IngresaItem(item.items);   //Load from fields to 
 item.cantitems=gcantitems; //struct,(only item and quantity of items)
//Calcule the size of new item to add to record
 length += 16;  //In the struct codigo size is 15
 length += sizeof(item.items[gcantitems-1].cantidad);
 length += sizeof(item.items[gcantitems-1].precio);

 registroH = DmGetRecord(PedidosDB, gNumOrden-1); //Open again, ok?
 if(!registroH)
FrmCustomAlert(Mensaje,"Handle null", NULL,NULL);
 else
  if ((MemHandleResize(registroH, length))==0)//Resize the handle, don't problem
   {
 s=MemHandleLock(registroH);  //Lock the handle, i think don't work

 IngresaItem(item.items); //I lost the record(¿?), load again
 item.cantitems=gcantitems;
//Write the records
DmWrite(s,offsetof(OrderReg,cantitems),&item.cantitems,sizeof(item.cantitems));
 DmWrite(s,offsetof(OrderReg,items[gcantitems-1].cantidad),
&item.items[gcantitem
s-1].cantidad,sizeof(item.items[gcantitems-1].cantidad));
 DmWrite(s,offsetof(OrderReg,items[gcantitems-1].precio),
&item.items[gcantitems-
1].precio,sizeof(item.items[gcantitems-1].precio));

 DmStrCopy(s,offsetof(OrderReg,items[gcantitems-1].codigo),
item.items[gcantitems
-1].codigo);

 MemHandleUnlock(registroH);//here error in POSE->SysFatalAlert:NULL HANDLE
}
 DmReleaseRecord(PedidosDB, gcantitems-1, true);
//Other error: lost program counter
}

this time write the records, (i see with the RscrEdit) but i get these errors
what happend?
--
Open WebMail Project (http://openwebmail.org)

-- Original Message ---
From: "Albert J. Franklin" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Mon, 11 Aug 2003 20:31:23 -0400
Subject: Re: Recording problem

> Sean,
> 
>I am puzzled by your response.  The variable len is defined in a 
> block, and then the variable length is defined in a block within the 
> scope of the block where len is defined.  By the rules of C, len 
> should still contain the value of (MemHandleSize(registroH)).  I don't 
> understand why defining length in the outer scope as you recommend 
> will cause the value of len to not be lost.
> 
> Al
> - Original Message -
> From: "Sean Yang" <[EMAIL PROTECTED]>
> Newsgroups: palm-dev-forum
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Monday, August 11, 2003 4:12 AM
> Subject: Re: Recording problem
> 
> > Int16 length=len ---> here is error,
> > because the "len" is a dynamic variable, not a const variable.
> > You should define the "length" at the start of function.
> > e.g:
> > Err GrabaNuevoItem(void)
> > {
> > Int16 length;
> >...
> > }
> >
> > Best regards!
> >
> > Sean Yang
> > Aug.11.2003
> >
> > "rguevara" <[EMAIL PROTECTED]>  news:[EMAIL PROTECTED]
> > >
> > > Hello!
> > > here a new problem:
> > >
> > > Err GrabaNuevoItem(void) //Record a new item in the actual record
> > > {
> > >  UInt16 NuevoIndice;
> > >  MemHandle registroH;
> > >  Err error=0;
> > >  OrderReg item;  //It's similar to 'Sales' example struct
> > >  NuevoIndice=gNumOrden-1;
> > >  registroH = DmGetRecord(PedidosDB, NuevoIndice);
> > >  if(!registroH)
> > > error = DmGetLastErr();
> > >  else
> > > {
> > >  Int16 len = 0;
> > >  UInt16 Indice = gNumOrden-1;
> > >  len = (MemHandleSize(registroH));
> > >  IngresaItem(item.items);
> > >  item.cantitems=gcantitems;
> > > {
> > >  Char *s;
> > >  Int16 length=len; //lose 'len' why?
> > >  length += StrLen(item.items[gcantitems-1].codigo)+1;
> > >  length += sizeof(item.items[gcantitems-1].cantidad);
> > >  length += sizeof(item.items[gcanti
> > >  DmResizeRecord(PedidosDB, gNumOrden-1, length);
> > >
> > >  registroH = DmGetRecord(PedidosDB, gNumOrden-1);
> > >  if(!registroH)
> > >  FrmCustomAlert(Mensaje,"Handle null", NULL,NULL);
> > >  s=MemHandleLock(registroH);
> > >
> >
> DmWite(s,offsetof(OrderReg,cantitems),&item.cantitems,
> sizeof(item.cantitems)
> > );
> > >
> >
>
DmWrite(s,offsetof(OrderReg,items[gcantitems-1].cantidad),&item.items->canti
> > dad,sizeof(item.items->cantidad));
> > >
> >
> DmWrite(s,offsetof(OrderReg,items[gcantitems-1].precio),&item.items-
> >precio,
> > sizeof(item.items->precio));
> > >
> >
>
DmStrCopy(s,offsetof(OrderReg,items[gcantitems-1].codigo),item.items[gcantit
> > ems-1].codigo);
> > > }
> > >  DmReleaseRecord(PedidosDB, Indice, true);
> > > }
> 

Re: Recomnd 16-Bit editor/converter?

2003-08-14 Thread Ben Combee

there lies another issue, which, would definately be something for
ben combee (metrowerks) to look into, and, handle more correctly
on their side. the resource output is a whopping 84096 bytes.
yes, thats > 65505 (max limit set allowed for a resource). most
likely, rez is barfing within codewarrior because it cannot handle
the large resource.
Ah... you hit a bug in the V9 linker where it would crash if an input PRC 
file (or PilRC RO file) had a resource that was too larget.  This is fixed 
in 9.2 -- the linker doesn't crash, but instead warns you that your 
resource is larger than supported by HotSync.  The CW debugger supports 
downloading these "larger than 64K" resources, but you can't get them on to 
a device by normal means (HotSync, beaming, VFS).

BTW, 65505 isn't the limit anymore... the OS 5 devices actually have a 
slightly lower limit due to the larger size of the internal data 
structures.  I don't know the exact number, so I'm warning for 64000 bytes 
or more in a single resource to be safe.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: nilEvent problem

2003-08-14 Thread Alan Ingleby
Perhaps you should be checking how long it's been since your last "time bar
drop", an don't do it again if it's been less than 250ms.

You should also look into UserEvents, and generate them where needed, rather
than relying on nilEvents, as these can be generated when you don't expect
them.  nilEvents are generated by the system to flash the cursor on and off
for example.

Alan
"Season Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I have design an timing critical application that having a time bar
dropping
> every 250ms, so I used
>
> EvtGetEvent(&event, SysTicksPerSecond() / 4)
>
> at my EventLoop routine and handled the dropping of time bar at nilEvent,
it
> works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the time
> bar drops very fast. Please help!
>
>
> Thanks!
>
> Tony
>
>
>
>



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


Re: launching IR or Modem HotSync

2003-08-14 Thread Dave Lippincott
enqueue the HS2 button (modem sync).  It will start the modem sync process.
I don't know if its possible to force Hotsync to use a particular sync
transport other than have it perform the sync method already setup that
responds to the cradle or modem buttons.

- Original Message -
From: "matt apt" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, August 11, 2003 11:41 AM
Subject: launching IR or Modem HotSync


> I know that to start a HotSync I can launch the
> HotSync app with a launch command of:
>
> sysAppLaunchCmdSyncRequestLocal or
> sysAppLaunchCmdSyncRequest
>
> However, is there a way to cause HotSync to launch a
> modem or IR sync instead? As it is, it seems that I'm
> only able to get HotSync to launch local (serial/USB)
> syncs.
>
> thanks
> mattapt
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


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


RE: Codewarrior Runtime Lib probs

2003-08-14 Thread Ben Combee
At 01:29 PM 8/6/2003, Mike Shubeck wrote:
The lib has always been in the 1st segment.  I did some monkeying and now I
get "Link Error : _RuntimeModule_: Entry Point '_InitCode_' is undefined."
as well.
I had to set the linker to Macintosh 68k so I could use my Constructor
resources (right?) could that have something to do with it?
It could.  .lib files are compatible between the two linkers, but you may 
need to fix your target settings in the 68K Target panel, since that 
wouldn't have transferred over from the Palm OS 68K panel.  Maybe your 
target type is wrong.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: Any tool for multi-platform?

2003-08-14 Thread wterreblanche
You did not really specify what language you prefer to program in.  I 
think this should be you first priority.  For example... if your 
applications will rely heavily on graphics and speed, then I 
recommend you consider a C compiler like GCC (open source) or 
CodeWarrior (commercial).   But if you prefer something similiar to 
the Visual Basic environment, I recommend NSBasic.  These compliers 
have versions available for Palm and for WinCE.

But be warned... the PPC and Palm are quite different machines and 
whatever tool you choose... you will probably still have to write two 
versions of the same program.  There are some highly experienced 
programmers that manage to write their code in such a way that they 
can compile it for both platforms, but this is not easy to achieve 
and require in-depth knowledge from the programmer of both 
platforms.  

There are of course many other solutions that you can consider if you 
do not specifically require a low level compiler.  But such solutions 
might be good for in-house corporate solutions, but not so good if 
you wanted to create a commercial program.  It all depends on what 
type of program you really want to create.

Werner






--- In [EMAIL PROTECTED], apple k <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there any tool in the market where we can develop
> palm/PDA application in PalmOS platform /
> PocketPC/WinCE or other platform? The tool must be
> able to cater to various kind of business needs? Is
> there anybody has seen this before? 
> 
> 
> 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> -- 
> For information on using the Palm Developer Forums, or to 
unsubscribe, please see http://www.palmos.com/dev/support/forums/


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


Re: Crash after hot sync?

2003-08-14 Thread mpclubfoot
--- In [EMAIL PROTECTED], John <[EMAIL PROTECTED]> wrote:
> On 02 Jul 2003 08:05:59 +0200, Daniel Seifert <[EMAIL PROTECTED]>
> wrote:
> 
> >
> >Am Mon, 2003-06-30 um 22.59 schrieb John:
> >
> >Hi,
> >
> >> Have anyone ever crashed their Palm after a hot sync?  I don't 
have
> >> any 3rd parth conduit on my desktop.  But once in a while, after 
the
> >> hot sync, when my handheld just finished displaying the message
> >> "cleaning up", I get an error dialog box with the following error
> >> message:
> >> 
> >> "MemoryMgr.c, Line: 3036, Chunk over-locked".  and then I'll 
have to
> >> do a soft reset to my device.
> >> 
> >> Does anyone know why it may happen?
> >
> >The PalmOS sends every application a launch code after a hotsync to
> >process new databases, etc. Maybe one of your installed apps has a 
bug
> >when it receives/processes this launch code.
> >
> >-> http://www.79bmedia.com/resetemu
> 
> Thanks for the info.  I tested all my installed apps with the
> CmdSyncNotify launch code, but the program doesn't seem to report 
any
> problem.  Oh well.
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to 
unsubscribe, please see http://www.palmos.com/dev/support/forums/

Hi John,

Did you ever find an answer to this issue?  I get the same error 
message and had the same luck with ResetEmu.

Thanks!


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


Re: new and delete in Palm

2003-08-14 Thread drvirens
Dave,

> The 64K limitation I think is an arbitrary choice. If I recall
> correctly, the chunk header allows up to 16M chunks, but they limit 
it
> to 64K because the hotsync protocol only supports up to 64K record
> sizes.

Again, I have a doubt. Sorry for this Dave. But I am not gettin why 
would the hotsynch protocol needs to be restricted to handle a data 
of 64K _only_ ?I mean, why not 32K or 128K or whatever? Is it just an 
arbitrary decision again ? I remember I was asked this question in an 
interview recently but shame on me, I have not done anything specific 
to find out the answers. :-)

-Viren



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


Re[2]: Error while deallocating memory

2003-08-14 Thread Boris Epshteyn
Steve,

You are allocating 8 byte for every string, but using only 2. May be
this is why your code is crashing?

-- 
Best regards,
 Boris




Steve,

Friday, August 8, 2003, 12:42:28 AM, you wrote:

SK> Boris,

SK> Although I do not have a solution for you, I too am attempting the same type
SK> of list manipulation.

SK> I have taken your code as an example, however am running into problems.

SK> My code is similar to yours, however, I am not reading the info from a DB
SK> instead it is hard coded.  You said that you were loading the list fine,
SK> just having cleanup problems, I'm receiving a fatal error trying to load the
SK> list...  What am I doing wrong?

SK> static void PopulateList()
SK> {
SK>  char** lstArray = (char**) MemHandleNew(2 * sizeof(char*));
SK>  FormType* frmP = FrmGetActiveForm();
SK>  ListType* lstP = (ListType*) FrmGetObjectPtr(frmP, lstDesc);


SK>  lstArray[0] = (char*)MemPtrNew(8);
SK> StrCopy(lstArray[0], "a");
SK> lstArray[1] = (char*)MemPtrNew(8);
SK> StrCopy(lstArray[1], "b");

SK> LstSetListChoices(lstP, lstArray, 2);

SK> LstDrawList(lstP);

SK> for (int i = 0; i < 2; i++) {
SK>   MemPtrFree(lstArray[i]);
SK>  }
SK>  MemPtrFree(lstArray);
SK> }



SK> "Boris Epshteyn" <[EMAIL PROTECTED]> wrote in message
SK> news:[EMAIL PROTECTED]
>>
>> Hi,
>>
>> I have an interesting problem. I am allocating an array of strings.
>> This array is filled from the database and then used for populating
>> pop-up list. When program is ran, list pops up fine, item gets
>> selected, but when I tap on the trigger again I get:
>> "just read from the ... which is the reserved field of the
>> frmControlObj," bla-bla-bla.
>>
>> If my clean-up portion of the code is commented out, everything runs
>> fine, but creates memory leaks. Clean-up portion is:
>> for (i = numRec - 1; i >= 0; i--)
>> {
>> MemPtrFree(programsArray[i]);
>> }
>> MemPtrFree(programsArray);
>>
>> I would appreciate any ideas why it is happening. The code is bellow:
>>
>>
>> static Boolean frmNewM_trProg_OnSelect(EventPtr event)
>> {
>> ListType *list = GetObjectPtr(lstPrograms);
>> Int16 listItem, cardNo;
>> UInt32 numRec = 0;
>> Err err;
>> char** programsArray;
>> MemHandle record;
>> LocalID progLocID;
>> Program* prog;
>> int i;
>> MemPtr ptr;
>> err = DmOpenDatabaseInfo(progDB, &progLocID, NULL, NULL,&cardNo,
SK> NULL);
>> if (progLocID != 0)
>> {
>>err = DmDatabaseSize(cardNo, progLocID, &numRec, NULL, NULL);
>> }
>> programsArray = (char**)MemPtrNew(numRec * sizeof(char*));
>>
>> for (i = 0; i < numRec; i++)
>> {
>>record = DmQueryRecord(progDB, (UInt16)i);
>>if (record)
>>{
>>   prog = (Program*)MemHandleLock(record);
>>   ptr = &prog->programName;
>>   programsArray[i] = (char*)MemPtrNew(StrLen(ptr) + 1 );
>>   StrCopy(programsArray[i], ptr);
>>   MemHandleUnlock(record);
>>}
>> }
>> LstSetListChoices(list, programsArray, numRec);
>> listItem = LstPopupList(list);
>>
>> if(listItem != -1)
>> {
>> ControlType *trg = GetObjectPtr(trProg);
>> CtlSetLabel(trg, programsArray[listItem]);
>> }
>> for (i = numRec - 1; i >= 0; i--)
>> {
>> MemPtrFree(programsArray[i]);
>> }
>> MemPtrFree(programsArray);
>> return true;
>> }
>>
>>
>>
>>
>> --
>> Best regards,
>>  Boris  mailto:[EMAIL PROTECTED]
>>
>>
>>




   mailto:[EMAIL PROTECTED]


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


Re: Unable to connect to Palm Device using Palm Debugger

2003-08-14 Thread Ben Combee
At 02:14 AM 8/7/2003, apple k wrote:
Hi,
I'm using CodeWarrior's Palm Debugger and try to read
(dir) the pdb/prc inside the real device. When I type:
"dir 0" - supposingly it will give me a list of
prc/pdb but it gave me an error: #0404. Do you
have idea what is the error. In fact, I have tried on
the other PC, and it still gave me the same error.
Which device?  This works for Palm OS 4.1 and less, but might not work for 
OS 5 devices.  It requires that the debugger know a bit about the way the 
heap is structured, and we don't have that info for newer OS versions.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: Palm Emulator

2003-08-14 Thread Ben Combee
At 07:24 PM 8/13/2003, Steve K wrote:
In that case, I'm curious what is wrong with this code that runs fine on the
palm handheld but is rejected by the emulator with the following error on
line marked with *:
Project (1.0) called SysFatalAlert with the message: "Field.c, Line: 7221,
NULL parameter".
Is there something wrong with setting fldAttr to NULL before calling
FldGetAttributes?
Yes.  Your fldAttr variable should be of FieldAttrType, not a pointer to 
it.  Then, you would pass in &fldAttr, to take its address.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Notification

2003-08-14 Thread Chris Apers
Hi,

Is there any notification when reading/writing to a memory card ?

Thanks
Chris

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


Re: Sony clie TG50

2003-08-14 Thread Jonatan Fernstad
> Hi all,
>
> I'd like to know ehat do you think about sony clie tg50? I'm planning to
> buy it and want to be sure that it's not a waste of money.

This is not the correct forum for such questions.
Try www.cliesource.com instead.



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


Re: tables

2003-08-14 Thread Ralf Krauss
I think there is no special funktion...

...use "TblGetBounds" to calculate the rectangle
of the table and  "WinDrawLine" for drawing the rect

Ralf

"Pablo Martin Vera" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
>
> I need help using tables.  How can I do to display the table borders???
>
>



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


Re: TblSetCustomDrawProcedure() - illegal implicit conversion

2003-08-14 Thread Ben Combee

I don't quite understand what you mean by "adjust the actual type of the
function" I'm passing in...
The return type of MainListDrawFunction is void, and the 2nd and 3rd
parameters are of type "Word" being "UInt16".
I tried casting the everything to UInt16, as well as changing "Word" to
"UInt16" with the same results
I just noticed that I got it backwards.  It was an UInt16/Word, but now the 
type is just Int16.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: newbie question: how to read a string from a MemHandle?

2003-08-14 Thread Gearoid Murphy
correction, should be
err = MemHandleResize(h, MemHandleSize(h)+(len+1));

From: "Gearoid Murphy" <[EMAIL PROTECTED]>
Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Subject: Re: newbie question: how to read a string from a MemHandle?
Date: Thu, 07 Aug 2003 11:10:16 +0100

 err = MemHandleResize(MemHandleSize(h)+(len+1));
--
For information on using the Palm Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

--
For information on using the Palm Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/
_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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


Re: Codewarrio stack usage with temporaries

2003-08-14 Thread Ben Combee
At 02:30 PM 8/8/2003, Todd Niec wrote:
How does code warrior handle stack usage for unamed temporary variables?
I have a procedure that creates lots of unnamed temporary variables as a
result of conversion operators.  I can see that, in terms of
constructors
and destructors, these temporaries are being created and destroyed as
the
function executes, but the stack usage steadily increases and increases
as the function executes.  Eventually I run out of stack space.
CW allocates all temporaries on the stack at function entry time.  However, 
there is a case where your stack usage can increase while your function is 
running -- the compiler defaults to deferring cleanup of the stack used for 
argument passing.  If you've got a loop with a function call, using

#pragma stack_cleanup on

will cause the compiler to remove items from the stack as soon as a 
function returns.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


RE: Palm Emulator

2003-08-14 Thread Eric Cloninger
Steve,

You are abusing pointers.  Your code should read

 void foo()
 {
 // Verify field attributes
 FieldAttrType fldAttr;
 FldGetAttributes(fldP, &fldAttr);

-E

> -Original Message-
> From: Steve K [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 13, 2003 7:25 PM
> To: Palm Developer Forum
> Subject: Re: Palm Emulator
> 
> 
> In that case, I'm curious what is wrong with this code that 
> runs fine on the palm handheld but is rejected by the 
> emulator with the following error on line marked with *:
> 
> Project (1.0) called SysFatalAlert with the message: 
> "Field.c, Line: 7221, NULL parameter".
> 
> Is there something wrong with setting fldAttr to NULL before 
> calling FldGetAttributes?
> 
> void foo()
> {
> // Verify field attributes
> FieldAttrType* fldAttr = NULL;
> FldGetAttributes(fldP, fldAttr);
> 
> *   if(fldAttr->numeric && (strP[0] < '0' || strP[0] > '9')) {
> // Field is set to numeric only and strP is not a 
> numeric value
> // Alert with error beep
> SndPlaySystemSound (sndError);
> return false;
> }
> }
> 
> tia,
> 
> Steve
> 
> "Dave Carrigan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> On Wed, Aug 13, 2003 at 04:45:28PM -0700, Steve K wrote:
>
> > Why is it that some things run on the palm just fine, however, cause
errors
> > on the Palm emulator?  Is the emulator more strict on what you can 
> > and cannot do?
>
> Yes, for good reason. The emulator is designed to catch a lot of bugs 
> in your code that may not cause problems the device you happen to have

> right now, but might cause problems on other devices or other versions

> of PalmOS. A well-written app will not trigger any errors from the 
> emulator.
>
> --
> Dave Carrigan
> Seattle, WA, USA
> [EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQ
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++L
>
> Dave is currently listening to Crosby, Stills, Nash & Young - 
> Shadowland
(American Dream)
>
>



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




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


Re: The PalmOs command line accept arguments for applications?

2003-08-14 Thread Jim Cooper

> NormalLaunch doesn't accept arguments, but some PalmOS applications
> support other custom launch codes which allow an argument parameter
> block to be passed in.  

Indeed, which is why I suggested he look at launch codes :-)

> And there are a few 3rd party utility applications which will allow 
> one to insert CmdGoto parameters on a "command line".

That's just confusing the issue isn't it? :-)

There is not a command line in the PalmOS in the sense that there is in
most desktop OSes. He needs to learn about launch codes.

Cheers,
Jim Cooper



Jim Cooper  [EMAIL PROTECTED]
Tabdee Ltd  http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi with your Palm


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


Re: LstSetListChoices

2003-08-14 Thread bullshark
On Fri, 8 Aug 2003 09:51:28 -0700, Dave Carrigan <[EMAIL PROTECTED]> wrote:

>
>On Fri, Aug 08, 2003 at 12:26:13PM -0400, bullshark wrote:
>
>> >static char* gPlateString =
>> >"PL3/16x\0PL1/4x\0PL5/16x\0PL3/8x\0PL1/2x\0PL5/8x\0";
>> 
>> The above doesn't work. The compiler knows that dquote strings end with \0
>> so there is nothing in the .o image after PL3/16x. 
>
>What are you talking about? That's simply not true for any C compiler
>I've ever seen.

You're absolutely right (I just checked), thanks for correcting that.
It's one of those "I been programming too long" memories...


It's still a cumbersome thing, hard to read, and fraught with peril. 
What happens if the following character is numeric, instead of a 'P'?

...it's probably that kind of 'gotcha' that forever purged
my consciousness of that type of expression (c:


bullshark



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


Re: FrmNewLabel

2003-08-14 Thread gamepower111
Great! Now i decide to use WinEraseRectangle and WinDrawChars to do my
task...
Thanks Alan!

fan


"Alan Ingleby" <[EMAIL PROTECTED]> дÈëÏûÏ¢ÐÂÎÅ
:[EMAIL PROTECTED]
>
> "gamepower111" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > yes, WinDrawChars() is a good and easy way. but I have to change the
data
> > while the data has been updated. do you have a good suggestion of this?
>
> Try WinEraseRectangle, then another WinDrawChars...
>
> Or...
>
> Can't you just use a static label, and mark it as nonusable, until you
want
> to see it?  Mind you, you'll get redraw problem when you use FrmCopyLabel,
> unless you hide the label, change it, then show it again...  Too much
> trouble if you ask me.
>
> Alan
>
>
>
>



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


Re: Okay to use DmWrite() on ordinary memory?

2003-08-14 Thread Alan Ingleby

"Todd Niec" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is it possible to use DmWrite() on ordinary memory?  I have cases where
> buffers might be stored in "ordinary" memory (stack, heap, or static
> globals) or might be in a record in a file and I would like 1 method
> to write to both of them.

Try it and see.  My suspicion is that is will probably fail, as DmWrite is
designed to stop you from writing to the wrong place etc, but you never
know...

Why can't you just keep track of the type of memory yourself, then use the
appropriate DmWrite or MemMove calls? Even if DmWrite happens to work, it is
always going to be slower than MemMove...



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


Re: Displaying gif and jpg images on Palm

2003-08-14 Thread Hal Mueller
That question was asked and answered 72 hours ago here.  Sheesh.

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


RE: Coding Standards

2003-08-14 Thread Keith Rollin
That's close to mine.  Personally, I'd have it as:

void MyFunc(Char* buffer, UInt32 type)
{
switch(type)
{
case 1:// This is an example with braces.
{
StrCopy(buffer, "One");
break;
}

case 2:// This is an example without braces.
StrCopy(buffer, "Two");
break;

default:
StrCopy(buffer, "Huh?");
break;
}
}

That is: braces always line up, and use 4-space TABs (I'm using spaces above since not 
all email programs expand TABs the way I'd like them).

I hate the way MS lines the case statement under the switch statement.

-- Keith

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


Multiplatform IDEs

2003-08-14 Thread Sebastian Cancinos
We are thinking about making our software available
for Smartphones, wich would mean porting the projects
to Symbian and PPC. The leading idea right now is
using J2ME, does anyone have experience with it? Do
you recomend any other enviroment?

Thx
Sebas

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: new and delete in Palm

2003-08-14 Thread drvirens
Dave,

> You're wrong on this part. MemPtrNew allocates a non-movable chunk 
that
> is immune to compaction or defragmentation. MemHandleNew allocates a
> movable chunk that will be essentially flagged as non-movable when 
you
> lock it with MemHandleLock. 

Yikes!! :-P Thanks Dave for that piece of info. Apologies for the 
misinformation guys.

Dave, would you please take this opportunity and let us know furhter 
in this direction ? I have read somewhere that palm devices dont have 
any MMU. 

Let me keep it in this way please...My understadning is that Palm OS 
does not have any virtual memory...so its all segment/chunk oriented 
stuff. Does that the reason why any resource in Palm cannt be larger 
than 64K ? And thencannt I hide the physical addresses behind the 
handles ? I thought a handle is really a pointer to pointer. I 
particularly wanna know more on how does the system make up for lack 
of a typical MMU ?


> It's perfectly safe to allocate long-lived pointers with new. The 
only
> thing is that it can cause memory fragmentation (this is generally 
true
> in any OS, but on small-memory systems it can be more of a
> problem). However, the same thing can be said if you allocate a 
handle
> and lock it for the length of the program.

Neat. So till date I was under wrong impression. Bleeh!!

Thanks again Dave for that beautiful piece of info. 

-Viren


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


Re: lists (how to change scrollbar look & feel)

2003-08-14 Thread kcorey
On Thu, 2003-08-14 at 12:36, Toshiro V wrote:
> When I have a list with more items than the number of
> visible items, the object creates a couple of arrows
> (like a scrollbar); when I tap into the down arrow the
> list scroll down one page. 
> 
> The question is: is it possible to change that
> behaviour? I want a full scrollbar to appear to the
> right of the list (not just the 2 arrows); also I'd
> like the list to scroll one line (not one page)
> everytime I tap the arrows.
> 
> Anybody know how to do it?

There's not a really easy way to do it.  You're going to have to mock up
a few elements yourself to make this work.

You can put a scrollbar widget on top of the listbox widget in the GUI
designers, so that's easy enough.

The tough part, though, is that you'll have to set the scrollbar's
appearance when the form opens, when the number of items changes.  

When you change the scrollbar, you'll have to redraw the listbox
(whether through a custom list draw function, or by changing the set of
strings the listbox points to.

-Ken


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


RE: pilrc rcp files and chinese characters

2003-08-14 Thread Ken Krugler
Hi there,

I'm answering this based on some slightly out-of-date pilrc source 
that I've got, so it might not be accurate for the latest version.

}I saw that pilrc supports GB/BIG5. Now which characterset must=20
}my rcp file be in? I mean, it could be UTF-8 or BIG5 or=20
}whatever.
It has to be in the corresponding Windows code page, which is what 
Palm devices typically use for their charset. So if you're doing 
Big-5, then the input text is CP950 (basically Big-5), and so on.

How do I tell pilrc which characterset I used to=20
}encode my rcp file... Or is it always a certain format and=20
}some escape sequences. In Java for example you can encode=20
}unicode characters like so: "\ua0b0" (unicode character 0xa0b0).
Check out the pilrc manual's description of the -F command 
line parameter. For example -F5 for Big-5, -Fg for GB. Based on this 
setting, pilrc assumes that the input file uses the corresponding 
character encoding.

-- Ken
--
Ken Krugler
TransPac Software, Inc.

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


Application/DB Install From Web

2003-08-14 Thread Ken
Hi,

I would like to know if there is a web browser for the Palm that would
install an application and the associated database directly to RAM and not
to a memory card?

Thanks,
Ken

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


LstSetListChoices

2003-08-14 Thread Steve K
It has been a few days and I have not heard on this, so I thought I would
post again.

I am trying to set the choices in a list using LstSetListChoices, and know I
am getting very close to getting it to work.

I call my function to populate the list and I receive no error and I get no
data displayed in my list.

Here is the function.

static char* gPlateString =
"PL3/16x\0PL1/4x\0PL5/16x\0PL3/8x\0PL1/2x\0PL5/8x\0";
static char** gListString;
MemHandle gStringH;

static Boolean PopulateList(FormType* frmP, ListType* lstP)
{
gStringH = SysFormPointerArrayToStrings(gPlateString, 6);
gListString = (char**)MemHandleLock(gStringH);

LstSetListChoices(lstP, gListString, 6);
MemHandleUnlock(gStringH);

return true;
}

...

case frmCloseEvent:
MemHandleFree(gStringH);
break;

tia,

Steve



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


Similar Utility to palmdump

2003-08-14 Thread nmailey
Hey all...

Anyone have any fancy-smancy UNIX utilities that dump out ONLY the
records from a pdb? As in, without header info and all that fun stuff...

Nole Mailey
Data Conversion Specialist
ProfitMaster Canada
1.800.340.4492
www.pmcanada.com
[EMAIL PROTECTED]



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


Re: SSL-Error NoTrustedRoot

2003-08-14 Thread Flex
Make a callback and return errNone

"Thomas Damme" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> Hi Folks,
>
> can somebody tell me, how I can overcome the problem of
> sslErrVerifyNoTustedRoot in the VerifyCallbackFunc? No matter which server
I
> try to connect to, I always get this error. When I connect to them via my
> browser, often a window appears that some informations (the server-adress
> mostly) do not match. The browser lets me click "Accept" but how can I do
> this with the Palm? Do I have to set a special return-code or is there
> something to be set in the SslVerify-Struct that comes in the info-param?
>
> Thanks a lot,
>
> Thomas
>
>
>
>



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


RE: Codewarrior Runtime Lib probs

2003-08-14 Thread Ben Combee
At 02:17 PM 8/6/2003, Mike Shubeck wrote:
Is something wrong with my install?  I get the same thing by simply using
C++ app wizard.
Try rebuiling the "Build All.mcp" project in your "CW for Palm OS Support" 
folder.  If you've recently installed a newer Palm OS SDK, it may have 
given you old versions of the .lib files.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: Unable to connect to Palm Device using Palm Debugger

2003-08-14 Thread apple k
when i ping, the error:
Ping failed with error 0x0404. Remote device not
responding.
The COM I have used is working for the real hotsync.
Pls advise as I did close the HotSync before do the
connection on the Palm Debugger.

--- apple k <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm using CodeWarrior's Palm Debugger and try to
> read
> (dir) the pdb/prc inside the real device. When I
> type:
> 
> "dir 0" - supposingly it will give me a list of
> prc/pdb but it gave me an error: #0404. Do you
> have idea what is the error. In fact, I have tried
> on
> the other PC, and it still gave me the same error. 
> 
> Pls help in this regard. Thank you so much.
> 
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread Alan Ingleby
I doubt they'll every add it, since the existing API is capable of doing the
job.

Besides that, it's possible to simulate a "text callback" using the existing
API.. Simply use the userDataP to hold your function pointer, then you only
need to write one ListDraw function (which then calls your "text callback").

Easy huh?.. Take about 15 minutes to write it the first time, stick it into
your standard "library" code, get the exact functionality you need, and it
only adds 10 lines of code to your whole project.

Alan

"James" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> I really, really wish Lists could have an application-defined callback to
> retrieve the text for a specified item.
>
> Here's how I envision it would work:
>
> typedef Char* (*ListGetSelectionTextFuncType)(const ListType* listP, Int16
> itemNum, void* userDataP);
>
> void LstSetListChoices(ListType* listP, Char** itemsText, Int16 numItems,
>ListGetSelectionTextFuncType getTextFunc, void*
> userDataP);
>
> getTextFunc would be optional; if NULL, all Lst functions would try to
retrieve
> strings directly from itemsText.
>
> The advantage of this system would be that:
> 1. there's less need to use a custom drawing function; I'd bet that most
>lists with custom-drawn items are purely textual, so the system now
>could draw the list items itself
> 2. when dealing with pop-up triggers to such lists, the system could
>update the trigger label itself
> 3. it would allow incremental-search to be used with such lists
>
> (While I'm wishing, I wish you could set a callback for a pop-up list's
event
> handler too.)
>
> #3 is the most important to me.  1 and 2 are not that much extra work with
the
> current system, but the combination of incremental-search's dependence on
a
> valid itemsText pointer and the lack of ability to set your own list event
> handler makes it really hard to implement 3 yourself.  Currently if you
want
> incremental-search with a dynamically generated list, it's easiest to make
> copies of all your strings and suffer the additional memory usage.
>
> Obviously there's not much that can be done about this for existing
versions of
> Palm OS, but hopefully this stuff can be changed for Palm OS 6 if it
hasn't
> been already...
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
>



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


Re: prc-tools question

2003-08-14 Thread Mark Slagell
Aaron Ardiri wrote:

did you actually unzip the sdk's to /PalmDev and then run palmdev-prep?
ie:
 

The sdks came in RPM form too, so I just installed them as such. However 
after reading your reply I did run palmdev-prep and got this:


# palmdev-prep
Checking SDKs in /opt/palmdev
 sdk-4 headers in 'include', libraries in 'lib'
 and material in /opt/palmdev used regardless of SDK choice
   (common)headers in 'include', no libraries
When GCC is given no -palmos options, SDK '4' will be used by default

Writing SDK details to target specs files...
...done

Next 'make' had the same "no genuine PalmOS.h found" error.

BUT... I am noticing now that there are two PalmOS.h files on the 
machine in different locations:


# locate PalmOS.h
/usr/share/prc-tools/include/PalmOS.h
/opt/palmdev/sdk-4/include/PalmOS.h

I had tried to install prc-tools from sourceforge before I went to 
palmos.com -- so maybe it's still trying to use the failed sourceforge 
install.  In fact I'm pretty sure it is, because if I rename the one in 
/usr/share, make yields "PalmOS.h: No such file or directory".

This is a newly installed redhat with nothing else on it, so I do have 
the luxury of being able to reinstall absolutely everything from scratch 
and know what I'm dealing with.  That might be the next step.





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


Re: memory leak -- but where?

2003-08-14 Thread rguevara
Hi, use Char nameP[8]=['\0','\0','\0','\0','\0','\0','\0','\0'];
and close all forms in the stop application routine with FrmCloseAllForms(),
generally make the leaks.
--
Open WebMail Project (http://openwebmail.org)

-- Original Message ---
From: David Martin <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tue, 5 Aug 2003 06:32:06 -0700 (PDT)
Subject: memory leak -- but where?

> Greetings
> 
> Here is a subroutine that does a frequently-wanted thing: it retrieves
> the hotsync name. It also leaks "maxsize" bytes every time you call it.
> 
> I thought I had goofed by not Unlocking something, but I have matching
> MemHandleLock/MemHandleUnlock.  what gives?
> 
> thanks,
> 
> David M
> 
> /* parameter returns HotSync name */
> static void Get_PDAName( Char *pda, UInt16 maxsize ){
>   MemHandle nameH;
>   Char *nameP = NULL;
> 
>   nameH = MemHandleNew(dlkMaxUserNameLength + 1);
>   nameP = MemHandleLock(nameH);
>   StrCopy(nameP, "");
>   DlkGetSyncInfo(NULL, NULL, NULL, nameP, NULL, NULL);
>   StrNCopy( pda, nameP, maxsize - 1 );
>   MemHandleUnlock(nameH);
> }
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> --
> For information on using the Palm Developer Forums, or to unsubscribe, 
> please see http://www.palmos.com/dev/support/forums/
--- End of Original Message ---


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


Re: putting a CLIE into console mode

2003-08-14 Thread Ben Combee
At 10:39 AM 8/10/2003, Eric Allen wrote:
How exactly do you do it? I have USBPort.dll in the bin folder, I have
CodeWarrior 9, I've tried both dotdottwo and actually punching in the
shortcut. Nothing worked. Is it even possible to get it to work on a CLIE?
None of the CLIE devices support debugging over USB.  You need to buy a 
serial cable (http://shop.brando.com.hk/ is a good source) to debug to 
these devices.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: Mapping software w/ external interface?

2003-08-14 Thread Brian Smith
On Fri, 8 Aug 2003, Sebastian Cancinos wrote:

> Brian, I don't quite understand your request. I made a mapping software
> that takes coordinates form a GPS via Serial connection. I could give
> you some pointers on that. But what do you mean with 'external
> programm'?

What I'm talking about is allowing a program (a geocaching database, in my
case) to run the mapping program, while passing a set of coordinates (via
the cmdPBP parameter for SysUIAppSwitch()) to mark a waypoint on the map
(optionally with a name for it), so you can find it there in relation to
where the GPS receiver tells you that you are.

Mapopolis does this with street addresses, and allows passing a creator ID
to return back to when a "Done" button was tapped that it would display in
that situation.  If they accepted GPS coordinates to do the same thing,
then that would be a perfect example.

-- 
---
Brian Smith // avalon73 at arthurian dot nu // http://www.arthurian.nu/
Software Developer  //  Gamer  //   Webmaster  //  System Administrator
You're just jealous 'cause the voices talk to me...

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


Re: Bitmap offscreen window larger than 64KB?

2003-08-14 Thread Khaki Wizard
Nice finding.

I also searched the old archives and somebody suggests
use BmpCreate to get bitmap memory as "malloc", which
can be larger than 64KB.

All kinds of tricks!

--- José dos Santos Machado <[EMAIL PROTECTED]>
wrote:
> Ben Combee escreveu:
> >> Is it possible to use BmpCreate() to create a
> bitmap
> >> larger than 64KB, say 640x480 8bpp, and use it to
> >> build an offscreen window for double-buffer paint
> >> purpose?
> 
> Hey guys, look what I found: 
> 
> http://www.cliedeveloper.com/spotlight/kinoma1.html 
> 
> IMHO it's a good tutorial on working with semaphores
> and blocks larger than 
> 64k... 
> 
> Hmm... I guess I shouldn't discover that
> Hehehehe... 
> 
> It seems like my Zire71 will start to hang with my
> programs... Hehehehe 
> 
>  -- J. Machado
>  -- [EMAIL PROTECTED] 
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Replace Substrings

2003-08-14 Thread Jim Duffy

Hi all,

Does anyone know a way to search through a string for all instances of a
substring and replace them with a different substring?

For example:

string1 "This[CR]is a [CR] Test"

I need to replace all the "[CR]" with the '\n' newline character..

I've tried using StrStr() and TxtReplaceStr() but these aren't really cut
out for this.  Can't find any other API that might work..

Thanks for the help..

Jim



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


RE: Replace Substrings

2003-08-14 Thread Roger Stringer

Subject: Replace Substrings
From: "Jim Duffy" <[EMAIL PROTECTED]>
Date: Thu, 7 Aug 2003 01:22:18 -0700
Does anyone know a way to search through a string for all instances of a
substring and replace them with a different substring?
For example:

string1 "This[CR]is a [CR] Test"

I need to replace all the "[CR]" with the '\n' newline character..

I've tried using StrStr() and TxtReplaceStr() but these aren't really cut
out for this.  Can't find any other API that might work..
Your example is character replacement, which can be achieved by:

//   substitute Char  c1 with Char c2
Char *ptr = string1;
while ((ptr = StrChr (ptr, c1)) != NULL) {*ptr = c2; ptr++;}
For substring substitution in-situ, you can use:

// Substitute Char *str1 with Char *str2, using shortest length
Char *ptr = string1;
UInt16 len = (StrLen (str1) > StrLen (str2) ? StrLen (str2) : StrLen (str1));
while (len && (ptr = StrStr (ptr, str1)) != NULL) {
StrNCopy (ptr, str2, len):
ptr += len;
}
Fully handling substrings of unequal size is a tricker because you have to 
make a copy of the original string and copy it back to the original string 
in segments, inserting the new string as appropriate.  Someone else 
provided an example of that.

Roger Stringer
Marietta Systems, Inc.  (www.mariettasystems.com)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


RE: Breakpoint stopping code, But I removed it!

2003-08-14 Thread Ben Combee

I fixed the problem - it's not the IDE, it was just coincidence that the
line that I had the breakpoint on (the diffC =...) did not cause an
error when you stopped on it, then continued, but failed miserably when
run at "full speed". The difference lies in the treatment of pointers.
As far as I knew this should work (tho I can't recall ever doing it
quite this way before):
Int16  * NumberTimes1Ptr, * NumberTimes2ptr
NumberTimes1Ptr = (Int16 *) ((UInt32)rec1 + FishStr1Len
+ 1);
NumberTimes2Ptr = (Int16 *) ((UInt32)rec2 + FishStr2Len
+ 1);
diffC = *NumberTimes1Ptr - *NumberTimes2Ptr;
If this code, the computation of diffC would fail if either NumberTimes1Ptr 
or NumberTimes2Ptr were misaligned (on an odd address).  Any 16-bit or 
32-bit memory access on the 68K must be on an even memory boundary.

It doesn't, at least not with CW9. The following code DOES work:
Int16   NumberTimes1, NumberTimes2
NumberTimes1Ptr = (UInt8 *) ((UInt32)rec1 + FishStr1Len
+ 1);
NumberTimes2Ptr = (UInt8 *) ((UInt32)rec2 + FishStr2Len
+ 1);
MemMove(&NumberTimes1,NumberTimes1Ptr,2);
MemMove(&NumberTimes2,NumberTimes2Ptr,2);
diffC = NumberTimes1 - NumberTimes2;
This works because you use MemMove to copy the values into aligned memory 
first.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: The PalmOs command line accept arguments for applications?

2003-08-14 Thread Ron Nicholson
On Mon, 4 Aug 2003 09:11:23, rguevara wwrites:
> LocalID dbID=DmFindDatabase(0,"MultiMailPROIII");
> SysUIAppSwitch(0 , dbID, sysAppLaunchCmdNormalLaunch, NULL);
>
> the application start correctly but i dont know if this program or 
others
> accepts arguments for the launching.

On Mon, 4 Aug 2003 13:03:32, Jim Cooper replies:
> The PalmOS has no "command line". You want to look at launch flags in
> the SDK docs.
NormalLaunch doesn't accept arguments, but some PalmOS applications
support other custom launch codes which allow an argument parameter
block to be passed in.  (Minicalc and HanDBase are 2 examples.)
sysAppLaunchCmdGoTo and sysAppLaunchCmdFind are other examples
of a launch codes which includes parameters.  And there are a few 3rd
party utility applications which will allow one to insert CmdGoto
parameters on a "command line".
Ron Nicholson
HotPaw Productions
   




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


Re: Okay to use DmWrite() on ordinary memory?

2003-08-14 Thread Alan Ingleby
"Keith Rollin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >>  Is it possible to use DmWrite() on ordinary memory?  I have cases
where

> >Try it and see.  My suspicion is that is will probably fail, as DmWrite
is

> Ugh, I can't believe that advice just crossed this forum!  Using that
> logic, if I rob a house and don't get caught, it must be OK.  :-)

Err... My point was that if Todd want's an answer to such a simple question,
it's usually not very hard to just go out and get the answer yourself.  I
was not trying to judge the merits of *why* you would want to do it.

> >Why can't you just keep track of the type of memory yourself, then use
the
> >appropriate DmWrite or MemMove calls? Even if DmWrite happens to work, it
is
> >always going to be slower than MemMove...

> Now, *this* is advice I like!  To it, I should add "Even if using
> DmWrite works on non-storage heap memory now, there's nothing that
> says it won't in the future".

Nice to see I'm not completely full of bad ideas Mind you, I'm surprised
Aaron hasn't chimed in with advise on replacing all calls with MemMove,
wrapped around a liberal sprinkling of Semaphore tinkering. :-)

Todd, as you can see, you're not heading down the right path.  If you're
going to find it difficult to keep track of the type of pointer you're
dealing with, the legal way of handling your requirement is:

#define SafeUlgyDmWrite(a,b,c,d)
{MemPtrDataStorage(a)?DmWrite(a,b,c,d):MemMove(a+b,c,d);} /*Note - Untested
code... Use at you're own risk!!!*/

You can now use the aptly named "SafeUlgyDmWrite" to replace all your
DmWrites, and not care whether they're into Dynamic or Storage Memory.


Let me know if this helps.

Alan



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


Re: Bitmap offscreen window larger than 64KB?

2003-08-14 Thread Aaron Ardiri
> I looked at the Palm API reference and it seems that BmpCreate can 
> create a bitmap larger than 64K. Anybody can verify that?

yes. 

simple proof = 320x320 @ 16bpp = 204800 bytes. any OS5 device can do 
that *g* you say you want a 640x480 buffer - you should probably 
stick to the size of the screen and only render what is needed.
(ie: basic windowing techniques)

---
Aaron Ardiri[EMAIL PROTECTED]
CEO - CTO   +46 70 656 1143
Mobile Wizardry  http://www.mobilewizardry.com/


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


Re: TblSetCustomDrawProcedure() - illegal implicit conversion

2003-08-14 Thread Ben Combee
At 12:05 PM 8/12/2003, [EMAIL PROTECTED] wrote:

That worked, but I'm now getting this error:
'illegal implicit conversion from
'void(*) (void *, unsigned short, unsigned short, struct RectangleType *)'
to
'void(*) (void *, short, short, struct RectangleType *)'
First of all, I'm only sending 3 parameters, so why is it saying I'm
sending four?
Secondly, I tried casting these parameters to (UInt) with no luck...
The problem is that PalmSource changes the type you pass to that routine to 
take UInt16 rather than Int16.  You need to adjust the actual type of the 
function you were passing in to use UInt16 rather than Int16 or SWord values.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


graphical button

2003-08-14 Thread Pablo Martin Vera

I´ve added a graphical button on my project but when I enter the form I
can´t see it.  I associate the button with a bmp image inside de pirlc
editor.

Anyone knows how to solve this problem??

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


Porting Tool(s)

2003-08-14 Thread Alan Ingleby
Does anyone know if there are any porting tools for PalmOS -> PocketPC?  I'm
not asking for info on a multi-platform development environment (SHARK,
Java, Basic etc..) as these typically require rewriting most of your code.

I'm interested in a C API layer that wraps PalmOS calls to equivalent
PocketPC calls.  A resource cross-compiler would be nice.. I guess fairly
easy too, due to the Open Source nature of PilRC.

It's just that I'd like to be able to take most of my code, and compile it
in eVC3.

I understand that this is a seemingly ridiculous question, but it's worth
asking, before I go jumping into doing it all by myself.

Alan



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


RE: Alternate Row Shading

2003-08-14 Thread Roger Stringer

Subject: Alternate Row Shading
From: "Jim Hoeger" <[EMAIL PROTECTED]>
Date: Tue, 5 Aug 2003 22:41:50 -0400
First of all, this is my first post to this newsgroup, I've searched the
Internet, bought books on Palm and "C" and have searched every archive I
could find.
I'm in the process of finishing up a rather large program (190K+) and would
like to display one of my outputs (currently in a table) with an alternating
row shading (like Pocket Quicken does).
No problem if you do custom drawing for the table cells.  You can draw each 
row independently, which allows you to use different foreground and 
background colors and to display different parts of the cell in different 
ways.  This is also the easiest way to do framing.



Roger Stringer
Marietta Systems, Inc.  (www.mariettasystems.com)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: "Low Memory" - (Newbie Ques)

2003-08-14 Thread nmailey





lmao... well isn't that just swell.

Hey, thanks for bringin me up to speed Dave.. I'm going to see
what book I can find on the matter..

>I don't know of any good books in that regards, because I cut my teeth
>on pointers using an obscure language for the Atari 800 called
>Action. It was so close to the metal that it makes C look like Visual
>Basic.
That's pretty wicked btw...

Anyways...enough of my blabbering... thanks again. *thumbsup*

Nole




|-+--->
| |   Dave Carrigan <[EMAIL PROTECTED]>|
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   .palmos.com |
| |   |
| |   |
| |   08/13/2003 07:43 PM |
| |   Please respond to "Palm |
| |   Developer Forum"|
| |   |
|-+--->
  
>|
  |
|
  |To:  "Palm Developer Forum" <[EMAIL PROTECTED]>|
  |cc:  (bcc: Nole Mailey/pmc) 
|
  |Subject: Re: "Low Memory" - (Newbie Ques)   
|
  
>|




On Wed, Aug 13, 2003 at 07:25:42PM -0500, [EMAIL PROTECTED] wrote:

> >It's also completely illegal. What good is converting an integer into a
> >pointer going to do you?

> Well, although completely illegal it works. Why would CodeWarrior allow
> me to perform such a haneous action if it was that bad.
> I'm asking not to be argumentative as I really do appreciate you
> responding, I'm just curious as a new programmer why something this
> simple could slip through?

A. It's C. C is perfectly happy letting you shoot yourself in the foot.
B. You're using casts. Even if C was less forgiving about foot-shooting,
   casts let you remove even that vestige of protection.

> I've been meaning to get a better understanding of pointers, I'm kinda
> running & gunning it, learning as I go... which I know would make some
> programmers cringe, especially on such a particular device in terms of
> memory. If you have a book in mind, that explains pointers extremely
> well, I'd love to hear it.

If you're going to program in C, you have to know pointers. Unfortunately,
I don't know of any good books in that regards, because I cut my teeth
on pointers using an obscure language for the Atari 800 called
Action. It was so close to the metal that it makes C look like Visual
Basic. However, it did teach me what a pointer was, so when I started
learning C I already understood them.

I think if you ask on any C forum, they'll have lots of suggestions. It's
probably even in a FAQ somewhere.

--
Dave Carrigan
Seattle, WA, USA
[EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

Dave is currently listening to Tom Robinson - Murder At The End Of The Day
(Hope And Glory)

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




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


Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On Fri, 8 Aug 2003 11:32:23 +1000, "Alan Ingleby" <[EMAIL PROTECTED]> wrote:

>
>"bullshark" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Yes I am. Deallocating is:
>>
>> if(pListTxt != NULL) //pretty hard
>{
>>memPtrFree(pListText); //huh?
>  pListText=NULL; //??
>}
>Sounds like you're using C++, 

No, I'm not. It's straight C.

Here is some psuedo-code. It's been years since I even compiled
my list builder code. It's in CVS someplace and I don't feel like
getting it out, but I did compile this. It gobbles down the 
INCREDIBLE sum of 208 bytes of code space.

char** buildList(int listWidth,int cnt){
int amt=cnt*(sizeof(char*)+(listWidth+1));
int i;
char **theList=(char**)MemPtrNew(amt);
char *dest=(char*)(&theList[cnt]);

//If you want to be stingy:
// WARNING: *Grossly* complicates the deallocation to TWO
// statements:
//MemPtrFree(theList[0]);
//MemPtrFree(theList);
//char **theList=(char**)MemPtrNew(cnt*sizeof(char**));
//char *dest=(char*)MemPtrNew(cnt*listWidth+1);
//UInt32 memUsed=0;

for(i=0;iand also violates the coding practice of trying to unallocate
>memory from within the same function in which it was allocated.  

You evidently have no experience with 'Lazy evaluation'.
Never heard of your 'coding practice'.

The fact is, if the global is not null, there is memory allocated to the list.
You need to de-allocate before allocating again. If you like, I'll
move the clause to a separate function, OK?

Your '??' on the setting of pListText to NULL makes me think
you don't get it;

Leaving the de-allocation of the prior list to the list builder
function is what makes memory handling simple. Any time you build
a list, it cleans itself.

>I'm not
>saying either way is wrong... Just offering reasons why some people choose
>different methods.

What you *are* saying is that you don't have much experience with
allocating/deallocating memory for dynamic lists. 


bullshark

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


Re: Palm ZIRE dynamic heap size

2003-08-14 Thread Ron Nicholson
On Fri, 8 Aug 2003 11:23:37, Douglas Handy wrote:
> [bullshark wrote:]
>> No. Available memory depends on memory use. It's not
>> a fixed number.
>
> Wrong.  It is a number fixed by the manufacturer.  Adding 
applications or
> database records has *no* affect on the number.  Running enabled 
hacks may
> reduce the size though.

The two of you are talking about 2 different things.  Although total
dynamic heap size is fixed by the hardware vendor, the amount of 
available
dynamic memory is not, as it may be affected not only by "hacks", but by
display depth, network driver status, whether any OS upgrades have been
installed, background sound threads on newer models, etc. etc.

Because of this, it is important to test an application with much less
dynamic heap available than the default amount available on a clean idle
handheld after a cold boot.
Ron Nicholson
HotPaw Productions
   
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: sending data bytes from a PALM PDA to a server using a WIFI modem/card

2003-08-14 Thread blaman
the post belongs to the communication forum, but i´ll give you my code, i
was trapped by the same problem for 3 days :o|
By the way,  the timeout occures when the header isn´t formatted properly, i
had the same problem. so here you are:

void SendHTTPLogin ()
{
NetSocketAddrINType mySockAddr;

Char cpSendBuf[500];
NetSocketRef mySockFd;

Err err;
UInt16 AppNetRefnum;
Int32 AppNetTimeout;
UInt16 myHowMany;
char textP[2000];
char Buf[255];
UInt16* sizeP;
char Request[255];
Char strX;
Int32 plongAddress;

MemSet (textP, sizeof (textP), NULL);

AppNetTimeout = SysTicksPerSecond() * 10;

SysLibFind("Net.lib", &AppNetRefnum);
NetLibOpen(AppNetRefnum, &err);
mySockFd = NetLibSocketOpen(AppNetRefnum, AF_INET, SOCK_STREAM, 0,
AppNetTimeout, &err);

plongAddress = NetLibAddrAToIN(AppNetRefnum, "server.ip.in.numbers");

mySockAddr.family = netSocketAddrINET;
mySockAddr.port = 80;
mySockAddr.addr = plongAddress;

NetLibSocketConnect (AppNetRefnum, mySockFd, (NetSocketAddrType*)
&mySockAddr,
sizeof(mySockAddr), AppNetTimeout, &err);

// add a blank line to the body
if (!WriteLoginRequest (Request))
return;
StrCat(Request,"\n");

// create the Header, including a blank line
StrPrintF(cpSendBuf,"POST /myapi.oxp HTTP/1.1\r\nHost:
www.myserver.com\r\nContent-Length:%u\r\n\r\n", StrLen (Request));

// send Header
NetLibSend(AppNetRefnum, mySockFd, cpSendBuf, StrLen(cpSendBuf), 0, 0, 0,
AppNetTimeout, &err);

// send body
NetLibSend(AppNetRefnum, mySockFd, Request, StrLen(Request), 0, 0, 0,
AppNetTimeout, &err);

myHowMany = NetLibReceive(AppNetRefnum, mySockFd, &textP, sizeof (textP), 0,
NULL, 0, AppNetTimeout, &err);
FrmCustomAlert(ID_APP_ERRORALERT, "", textP, "");


NetLibSocketClose (AppNetRefnum, mySockFd, AppNetTimeout, &err);
NetLibClose (AppNetRefnum, true);

return;
}
thats it. WriteLoginRequest is the function to write the request (the body
of the post), you have to add you own.

Hope this will save your time.

Regards, jan Pfluger




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


Re: Any doc. about programming on Zire 71

2003-08-14 Thread L.M. Fridael

"Eccles Kwong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Do anyone know, is there any document about the API for the built-in
camera
> of Zire 71 ?
>

You can get the Camera API docs at pluggedin.palm.com. (Registration
required.)

Regards
-Laurens



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


RE: new and delete in Palm

2003-08-14 Thread Keith Rollin
new and delete are not Palm OS functions, so you won't find them in the Palm OS 
reference.  Instead, you should consult the documentation for your development system.

-- Keith

> -Original Message-
> From: Mayank Babu Rastogi, Noida [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 13, 2003 3:35 AM
> To: Palm Developer Forum
> Subject: RE: new and delete in Palm
> 
> Thanks. Palm OS 5 API reference document doesn't talk about 
> new and delete.
> Is there any additional library which provides these functions ?

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


Re: using versamail and the exchange manager

2003-08-14 Thread Manohar Chapalamadugu

I don't really know whether Versamail supports
Exchange Manager. However, the best way to send an
email using Exchange manager is to use the mailto URL
scheme. You need to get the registered application(s)
and popup a screen asking the user to select the email
app. The default application (maynot be Versamail),
registered to handle mailto, will pick up and add the
mail to its database. However, this approach works on
=+4.0

Good luck.
--- richard work <[EMAIL PROTECTED]>
wrote:
> 
> Hi All,
> 
> Does anyone know how to send an email via versamail
> from another
> application? I would assume it would be done using
> the exchange manager but
> I have no details of what versamail requires.
> 
>   Regards, Richard
> 
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/


=
-- Feel the Mantra

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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


RE: (Newbie) Howto send and receive files??

2003-08-14 Thread Jeff Ishaq
> -Original Message-
> From: Ricardo Marques
> Sent: Wednesday, August 13, 2003 8:29 AM
> 
> For example, the user would go to the menu and press "Send 
> File", after which a form would appear asking which file the 
> user would like to send and allowing to indicate it. How can 
> I do that? That is, how do i know where a file is stored 
> within the OS, how do I find it and select it to send, and 
> how do I save a received file in a location chosen by the user

This is a very common functionality and as such, there are helper APIs
that will save you a lot of time, Ricardo.  You can get a list of all
files on the device with SysCreateDataBaseList().  For example:

-
MemHandle haItems  = NULL;  // Handle to array of SysDBListItemType
UInt16wNumDBsFound = 0; // # of SysDBListItemType items in
haItems

SysCreateDataBaseList( sysFileTApplication, 0, &wNumDBsFound, &haItems,
true );
-

Once haItems is generated, you can load up a list control with the
strings inside the SysDBListItemType.name member (see
http://tinyurl.com/jws9 for info on generating a list's contents during
runtime):

-
SysDBListItemType* paItems = NULL;
if ( haItems )
   SysDBListItemType* paItems = (SysDBListItemType*) MemHandleLock(
haItems );

if ( paItems )
{
   for ( UInt16 i = 0; i < wNumDBsFound; i++ )
  AddStringToMyList( paItems[i].name ); // Analogous to
FillListWithYears()
// in the List recipe URL
}

MemHandleFree( haItems ); haItems = NULL;
-

Once a user has selected one of the items from the listbox to beam, you
want to lock down haItems again, advance to the index corresponding to
the user's selection, extract its name, creator ID, and dbID, and then
use the Exchange Manager to send the file.  BE SURE to MemHandleFree(
haItems ) at some point after you no longer need it, or else you will
leak the memory allocated to store the array.

See http://tinyurl.com/jwrd for sample code of how to send a database
using the Exchange Manager.  The only thing I would add to this recipe
is to use one of the prefixes defined in http://tinyurl.com/jwr7 so that
your user is prompted whether they'd like to send (Bluetooth) or beam
(IR) or SMS the file, depending on the capabilities of the device on
which your app would be run.

See the bottom of http://tinyurl.com/jwrw for a sample WriteProc() that
should work for your ExgDBWrite() call.  

I hope this gets you going.  Be patient with the Exchange Manager, it
can be fickle, but once you've beamed a file through thin air, you
realize it was worth it.  At least, I did.

-Jeff Ishaq


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


Re: new and delete in Palm

2003-08-14 Thread Paul Johnson
Nice! That's about like saying the display is limited to 160x160 because
there are 52 wednesdays in 2003.

Not that I'm bitter about trying to use large datasets you understand :)

>The 64K limitation I think is an arbitrary choice. If I recall
>correctly, the chunk header allows up to 16M chunks, but they limit it
>to 64K because the hotsync protocol only supports up to 64K record
>sizes.




Regards,
Paul Johnson
Applewood House
www.applewoodhouse.com


- Original Message -
From: "Dave Carrigan" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 10:29 PM
Subject: Re: new and delete in Palm


> On Wed, Aug 13, 2003 at 07:42:06PM -, drvirens wrote:
>
> > Dave, would you please take this opportunity and let us know furhter
> > in this direction ? I have read somewhere that palm devices dont have
> > any MMU.
> >
> > Let me keep it in this way please...My understadning is that Palm OS
> > does not have any virtual memory...so its all segment/chunk oriented
> > stuff. Does that the reason why any resource in Palm cannt be larger
> > than 64K ? And thencannt I hide the physical addresses behind the
> > handles ? I thought a handle is really a pointer to pointer. I
> > particularly wanna know more on how does the system make up for lack
> > of a typical MMU ?
>
> The Dragonball processor doesn't have a MMU, but the existence or lack
> of a MMU is not really related to how the PalmOS memory manager
> works. Grossly simplified, an MMU is used to map a memory address to
> some other address. This is useful in a multitasking OS so that each
> process thinks that its memory starts at address 0. The MMU takes care
> of mapping the process' virtual address to a real physical address.
>
> At a higher level, you still need something to manage the memory space
> so that when an app calls malloc, or MemHandleNew, or whatever
> (including indirect calls through the new operator), the app gets
> something, and when the app frees up the memory (via free,
> MemHandleFree, delete, etc.), the space is again marked as free. This is
> also a called a memory manager, but has nothing to do with the MMU.
>
> A memory chunk is just an arbitrary name that the PalmOS developers gave
> to a piece of memory that is managed by the PalmOS memory manager. Every
> OS call that allocates memory (MemPtrNew, MemHandleNew, MemHandleResize,
> DmNewRecord, DmResizeRecord, etc.) will eventually get a chunk that the
> memory manager has decided it can have.
>
> The 64K limitation I think is an arbitrary choice. If I recall
> correctly, the chunk header allows up to 16M chunks, but they limit it
> to 64K because the hotsync protocol only supports up to 64K record
> sizes.
>
> --
> Dave Carrigan
> Seattle, WA, USA
> [EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL
>
> Dave is currently listening to Elvis Costello - No Dancing (My Aim Is
True)
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


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


Re: lists (how to change scrollbar look & feel)

2003-08-14 Thread Dave Lippincott
Draw the list and the scroll bar.  Handle the scroll bar messages and update
the list manually.  Its not as hard as it sounds.  If your app displays a
scroll bar and handles the events, you can force the list to do whatever you
want.  As far as not displaying the list scroll arrows, you can set the list
up with just enough lines to fill the screen once and handle tracking which
items are visible/selected.  You can do this with a list, table or custom
gadget.  Its easiest with a list. (IMHO)

- Original Message - 
From: "Toshiro V" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 8:36 AM
Subject: lists (how to change scrollbar look & feel)


> When I have a list with more items than the number of
> visible items, the object creates a couple of arrows
> (like a scrollbar); when I tap into the down arrow the
> list scroll down one page.
>
> The question is: is it possible to change that
> behaviour? I want a full scrollbar to appear to the
> right of the list (not just the 2 arrows); also I'd
> like the list to scroll one line (not one page)
> everytime I tap the arrows.
>
> Anybody know how to do it?
>
> Toshiro.
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


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


RE: Palm Emulator

2003-08-14 Thread Scott Johnson
From: Steve K [mailto:[EMAIL PROTECTED] 
> Is there something wrong with setting fldAttr to NULL before
> calling FldGetAttributes?
>FieldAttrType* fldAttr = NULL;
>FldGetAttributes(fldP, fldAttr);

Yes, that's bad.  You must pass it a valid pointer to an existing
FieldAttrType object which you supply yourself:

FieldAttrType fldAttr;
FldGetAttributes (fldP, &fldAttr);

Otherwise, how would your original version work?  How would the
attribute information be returned to your program?  Is there any way for
FldGetAttributes to modify your passed-in pointer to point to something
the function itself might allocate?

(Do these sound like questions from a programming teacher? :-)

-slj-


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


Re: Testing - Sorry

2003-08-14 Thread Julio Sejtman
Testing 

Sorry



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


Re: How know the name fields of PDB file

2003-08-14 Thread Thomas Damme
Hi,

some CSV->PDB Converters store the field names in the AppInfoBlock of a
database. Take a look at DmDatabaseInfo to retrieve the AppInfoBlock if it
is there. Some FileManagers also show you, if a InfoBlock is there so check
this first before you do too much work.

Thomas


"rguevara" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
> Hi all, i need know the name field of the record in a PDB file for convert
a PDB
> to CSV file (i need for the INF file). Exist one application like "par"
for show
> this name fields?
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>



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


Re: "Low Memory" - (Newbie Ques)

2003-08-14 Thread nmailey





>Where are you allocating memory that your orderQtr pointer will point
>to.  I suspect that orderQtr should really be a UInt32, not a pointer to a

>UInt32.  The same question goes for key and desc.  Unless you allocate
>space somewhere in memory and stick a pointer to that space into the
>fields, you're dealing with unknown values.

>I think you need to read up on C pointers and string handling.  This
>doesn't just apply to Palm OS but to any platform using C.

Thanks Ben, actually I've been reading up at the CodeWarriorU site about
C (as well as another C book) and such but haven't gotten to pointers yet.
These are the problems I was afraid I'd run into when starting this
project.
Thanks for your advice, I'm certainly taking it.

Nole


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


Re: new and delete in Palm

2003-08-14 Thread Ben Combee
At 05:36 AM 8/13/2003, Chris Apers wrote:
Don't think so, just enable C++ compiler in your project.
I use them with no problem.
Don't use the "Enable C++ Compilation" switch in CodeWarrior.  CW will 
always build a .cpp or .c files as C++.  This switch just forces it to also 
build .c files as C++, rather than using C rules for the file.  In V9, the 
wording was changed to "Force C++ Compilation".

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Re: UI internationalization?

2003-08-14 Thread Ken Krugler
I want to make my UI application internationalized . What is the procedure
to start with this .
Read the "Localized Applications" section of the Palm OS Companion 
documentation.

From where can I get the overlay resources ?
You don't need these to create a localized application. Overlays are 
a technique (mostly used internally for multi-lingual EFIGS ROMs) to 
separate out the non-localizable portions (mostly code) from the 
resources that should be localized.

What else
should I do to make the application support internationalisation ?
If you still have questions after reading the "Localized 
Applications" chapter, please re-post specific questions.

How can I
test the Japanese , etc. charactors / words ( I don't know Japanese ) on my
application ?
Once you've got the Emulator or Simulator running with a Japanese 
ROM, running Gremlins is the easiest first step.

-- Ken
--
Ken Krugler
TransPac Software, Inc.

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


Re: Graying of controls on disabling

2003-08-14 Thread Ben Combee
At 04:48 AM 8/13/2003, Marianne wrote:
Hi,

I have designed a form which has a slider control,  checkbox and push
buttons..
When i disable these controls, i want it to be grayed-out...
Is there anyway to do this..
This is non-standard Palm OS UI.  There is no support in Palm OS for grayed 
controls.  In general, disabled controls are hidden on the screen, or they 
are left active with an alert telling the user why the control isn't valid 
right now.  Look at the "Details" button in To Do for an example.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


Graying of controls on disabling

2003-08-14 Thread Marianne
Hi,

I have designed a form which has a slider control,  checkbox and push
buttons..
When i disable these controls, i want it to be grayed-out...
Is there anyway to do this..

Thanks in advance

Marianne


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


Re: new and delete in Palm

2003-08-14 Thread Ben Combee

The 64K limitation I think is an arbitrary choice. If I recall
correctly, the chunk header allows up to 16M chunks, but they limit it
to 64K because the hotsync protocol only supports up to 64K record
sizes.
Palm OS 1.0 and 2.0 had memory heaps that were limited to 64K, so it wasn't 
actually possible to allocate a block of memory larger than that 
size.  This heap structure was reworked in Palm OS 3.0, but the HotSync 
protocol wasn't fixed to support these large chunks.  Palm OS 3.5 provided 
a back door to allocating large chunks, and this is used by the 
MemGluePtrNew call in the glue library included in Palm OS SDK 5.0 R2.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

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


<    1   2   3   4   5   >