Re: graphic button

2003-08-14 Thread José dos Santos Machado
Pablo Martin Vera escreveu:
i´ve created a graphic button and I assigned it two 16 color bitmap images.
When I start the aplication I see the in black and white not in color.
Please tell me how to solve it.
You could start the color suport in your startup code. There's some examples 
in the archives of this list (one very good from Aaron Ardiri, a simple loop 
that sets the maximum color support, if I'm not wrong). 

I do this in my app and don't have any problems in using color graphical 
buttons. 

Cheers ! 

-- 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: How know the name fields of PDB file

2003-08-14 Thread drvirens
Please, can you explain your question in more details ?

Do you wanna know the names of the fields of a PDB file ? If so, I am 
sorry that is not possible to do since the PDB does not store 
the names of fileds anyway. It stores the records as raw data. It 
is the programmer who has to interprete those raw bytes and work 
with. 
 
-Viren

--- In [EMAIL PROTECTED], rguevara [EMAIL PROTECTED] 
wrote:
 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/


-- 
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
 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?
 
 Or I have to draw such large dynamic BMP with WinDrawPixel() directly on 
 the screen?

BmpCreate can allocate memory chunks  64K

however, you cannot save them complete in a single resource. you are free
to allocate a bitmap of 640x480 @ 8bpp if there is sufficient heap space
and then you must fill the contents of the bitmap yourself.

640x480 = a lot of memory. you may want to also use a different technique.

---
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: sizeof

2003-08-14 Thread Engi
On Saturday, August 09, 2003 9:35 PM [GMT+1=CET],
Carsten [EMAIL PROTECTED] wrote:

 most (some.. ;) compliers have the ability to define the struct
 alignment.

Is it the case with CW ?

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


PalmGear StreamLync MathLib, etc.

2003-08-14 Thread Brian Smith
Since I haven't a response from PG on this yet (after a week), and there
are likely others in the same boat on this list, I figured I'd ask this
here as well.

I have an app that is now partially dependant on MathLib.  I say pertially
dependant, because only one feature needs it, and the app will run without
that feature if the library isn't installed.  I'm planning to bundle the
current version of MathLib with the app, but I'm at a loss as to what to
do with PalmGear's StreamLync auto-install with this.  The library may
already be on the device, or may even be in the ROM (the case with
Handspring Visors, at least), and wouldn't need to be reinstalled.  The
question, then, is should I set it up to be auto-installed?

Thanks in advance.

-- 
---
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/


RE: Recomnd 16-Bit editor/converter?

2003-08-14 Thread Randall Pulsifer
For anyone following this thread - it's nice to note that while the
24bpp version starts out (as 1/4 of the 320x320 screen) at 76K, pilrc
converts it nicely to a 16bpp image and the result generated by adding a
4k 1bppD1 version, which is required to satisfy some limitation or other
(is this still the case, Ben?), like so:

 BITMAPFAMILYEX ID ULHome
 BEGIN
 BITMAP ULHome1bppD1.bmp BPP 1 DENSITY 1
 BITMAP ULHome24bppD2.bmp BPP 16 DENSITY 2
 END

 makes a bitmap family resource that is about 55K and looks just
gorgeous.

My mistake was that when I added the 24(16) bpp image version, I didn't
delete the 8bpp image that I had been using, which made the result well
outside the legal limits. However, CW9.0, rather than politely
mentioning the fact that the file or resource was too large, just
crashed and disappeared, which made it rather frustrating to discover
the root cause. Ben now assures us that the 9.2 version has added some
manners to the linker and now gives the appropriate error.

Thanks guys! 

   -Original Message-
   From: [EMAIL PROTECTED]
[mailto:bounce-palm-
   [EMAIL PROTECTED] On Behalf Of Aaron Ardiri
   Sent: Monday, August 11, 2003 6:38 AM
   To: Palm Developer Forum
   Subject: Re: Recomnd 16-Bit editor/converter?
   
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).
   
   :) good now it is documented *g*
   
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.
   
   i tend to stay away from  32k these days.. the max resource i like
is
   32767 - keeps it within an int16 range and gives the OS 32k of extra
   space for doing what it wants :)
   
   of course, i had to update all my algorithms to work with data over
   multi-ple resources when they are that size :)
   
   ---
   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: Strange issue

2003-08-14 Thread Engi
On Thursday, August 07, 2003 1:48 AM [GMT+1=CET],
Alan Ingleby [EMAIL PROTECTED] wrote:

 Engi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 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.

 How are you drawing the note icon?

In fact, my value column have textTableItem style when there is no note and
textWithNoteTableItem style when there is a note.
In this case, the note indicator is shown by the system.

  It seems to me that you night be setting the font to a weird value?

 Try wrapping all your plain text custom drawing in this:

 // Before drawing text...
 FontID oldFont = FntSetFont(stdFont);

 ///Normal text drawing code here...

 // After drawing text...
 FntSetFont(oldFont);

 Let me know how this goes.

Unfortunately, I never change the font in my sources !


-- 
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 Dave Carrigan
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/


Re: How to use Radio Button

2003-08-14 Thread Ben Combee
At 02:10 AM 8/8/2003, Marianne wrote:
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..
You can draw your own using gadgets.

Radio buttons are not supported on Palm OS.  You should use either push 
buttons or popup lists.  They just aren't space-efficient, and they won't 
match the rest of the user interface.

--
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/


Pilot Link Question???

2003-08-14 Thread nmailey




I've got a bunch of include files on my UNIX box, with names such as:
pi-args.h, pi-cmp.h, pi-dlp.h, and many more... beginning with 'pi-'

I'm guessing from what I've Googled so far that they're a part of
Pilot-Link
or at least a modified version of it. Does anyone have a link to the
explanations
of what the functions doetc. I'm trying to figure out what some of the
arguments
are supposed to represent for a few functions

Thanks.

Nole Mailey


-- 
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 Eric Allen
Oh, okay. Thanks!

Ben Combee [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 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: pdb file

2003-08-14 Thread rguevara
exist the pdb2csv in the palm-db-tools-0.1.2 , i can convert csv to pdb, but
even not can convert correctly pdb to csv , always display this message:

./pdb2csv: unable to determine database type

somebody know the cause?
influence much the .inf file?

sorry for my bad english...
--
Open WebMail Project (http://openwebmail.org)

-- Original Message ---
From: henry [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Thu, 7 Aug 2003 11:48:59 +0800
Subject: pdb file

 Dear All,
 
I would like to ask how can i get data from a pdb file which
 contains data in excel format.
 
 --
 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/


bitmap movie

2003-08-14 Thread John McDowell
I have a series of bitmaps which when run one after another form a crude
movie. I put them into a loop and I would like the movie to keep running
until the user taps the screen.

What is the best way to break out of the loop?

John Mc



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


Emulator

2003-08-14 Thread henry
Hi everybody,


Could any one tell me how to hotsyc in my emulator?
what config have to set?



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


Re: Why are offscreen bitmaps so big?

2003-08-14 Thread kcorey
On Thu, 2003-08-14 at 16:51, kcorey wrote:
 Hi All,
 
 I've run into a strange thing that's killing my application on a
 Tungsten|T device.
 
 I've set the screen to 320x320x8. (The screen cleared and there was no
 error, so far so good).  I then set the coordinate system to the native
 coordinate system withkCoordinatesNative.
 
 Then I allocate a 320x320x8 offscreen buffer, in nativeFormat.

Oops...this should be a 320x300x8 offscreen buffer, specifying
'nativeFormat'.

 The problem is, that buffer is being allocated 384000 bytes of data
 space, and 24 bytes of header space.
 
 At 8 bits per pixel, it seems to me it shouldn't be bigger than 102,400,
 plus the (24) header bytes.  Heck, even at 16 bits per pixel, it should
 be no larger than 204,400, I think.  
 
 Can anyone explain where the rest of the size went to?

When I allocate a smaller window, say 160x150x8, it's 24000 bytes, which
is exactly as I'd expect.

It's a real puzzler.

-Ken


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


Re: HotSynk trouble

2003-08-14 Thread Ben Combee
At 03:19 AM 8/14/2003, Eugene wrote:
Hello,

We are developing testing program on CodeWarrior 9.0.

When we try to install prc file to Palm M550 it stops during HotSync
operation.
And it's written cleaning up on the palm screen. And then only hard reset
helps.
When we do this on emulator it works ok. It also works when we debug program
on Palm throuh CW.
Sounds like you're not handling a launch code correctly and trying to 
access global variables when they aren't available.

The CW debugger can show you the problem.  In the Palm OS Debugging panel, 
tell it to launch as a subroutine, and use the launch code 
sysAppLaunchCmdSyncNotify.  This will simulate the launch code that gets 
sent to your app after it is HotSync'd to the device.  You should be able 
to see the place where your code does 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/


no subject

2003-08-14 Thread Christian Lindemeier
Hello 

I tried to implement a TableLoadDataFuncType:

  TblSetLoadDataProcedure (table, attribColumn, drawLabel);

Everything I got from it was some strange signs:  ŸŸŸ
I cut every piece of code out of it to elimate every possible failure 
source. But the result is still the same, so I think I'm missing something
important.

  Err drawLabel (void *table, Int16 row, Int16 column, Boolean editable,MemHandle 
*dataH, Int16 *dataOffset, Int16 *dataSize, FieldPtr fld )
{
   return(0);
}

I hope somebody is able to help me.

THX
Christian
__
Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter,
Adressverifizierung, digitale Unterschrift: http://freemail.web.de


--
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 Jeff Wheeler
Jeff:
 4. Tabs set to four spaces.

Stuart:
 4 space good, two space bad?

 This sounds like a religious war in the making.  So I say 2 
 spaces for a tab and don't use tab characters.  If you can 
 cleanly fit your code into 80 columns that would also be 
 nice (though I realize that is unlikely for Palm OS).

2?  Fine.  4?  Fine.  Just not 3!  ;-)  (just kidding)

Isn't the advantage of tabs that if you and I are sharing code and using
well-mannered IDEs, you can set your tabs to be 2 spaces wide and I can set
mine to 4 spaces wide, and we're both happy?

I expected more guff over the { and the } than the tabs and spaces!

On a slightly related note, I've always thought that programming is a
pleasant mix of both science and art.  There's a certain aesthetic about a
well written function that also looks good.  Of course, code beauty is in
the eye of the beholder.

Jeff




-- 
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
Actually I just want to create a blank bitmap for
double buffer purpose, not from a resource. The pixels
are generated programatically. I looked at the Palm
API reference and it seems that BmpCreate can create a
bitmap larger than 64K. Anybody can verify that?

Thanks
--- José dos Santos Machado [EMAIL PROTECTED]
wrote:
 Khaki Wizard escreveu:
  Hi, all: 
  
  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?
 
 Actually you cannot create any resource larger than
 64kb on PalmOS, unless 
 you do it on the memory card or split in several 64k
 blocks. 
 
 
  Or I have to draw such large dynamic BMP with
  WinDrawPixel() directly on the screen?
 
 Urgh, that would be very ugly... You can split your
 resource (image or 
 anything you want) and make blocks to render on the
 screen. 
 
 Aaron, that's with you. :) 
 
  -- 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/


RE: new and delete in Palm

2003-08-14 Thread Ben Combee
At 05:34 AM 8/13/2003, Mayank Babu Rastogi, Noida wrote:
Hi Chris,

Thanks. Palm OS 5 API reference document doesn't talk about new and delete.
Is there any additional library which provides these functions ?
They aren't mentioned in the API reference as these aren't OS functions, 
but the responsibility of your development environment.  With CodeWarrior, 
you just link in the standard Palm OS runtime library, something done 
automatically with projects created by the CW for Palm OS wizards.

--
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: Coding Standards

2003-08-14 Thread Stuart Eichert
 4. Tabs set to four spaces.
 
 Jeff
  
4 space good, two space bad?

This sounds like a religious war in the making.  So I say 2 spaces for a tab
and don't use tab characters.  If you can cleanly fit your code into 80
columns that would also be nice (though I realize that is unlikely for
Palm OS).

-- 
Stuart Eichert
Copera, Inc.
[EMAIL PROTECTED]


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


OS5.2: has SysNotifyBroadcastFromInterrupt WakeupHandler been fixed ?

2003-08-14 Thread Steve Mason
Hi all.

I'm stumped by a problem with OS 5.0 where the PACE environment in that OS
does not support SysNotifyBroadcastFromInterrupt() and is inconsistent with
a serial wakeup handler (set by SrmSetWakeupHandler). (See copy below of an
FAQ taken from the PalmSource KnowledgeBase that details this problem.) As
far as I can see I need both these functions for my application to function
properly.

My question is: Does anyone know if the SysNotifyBroadcastFromInterrupt() is
supported in OS 5.2?

Also can someone confirm that the interrupt-driven wakeup handler is fully
functional in OS 5.2 as claimed in the FAQ.

I'd appreciate any help on this at all since I don't want to invest in a
OS5.2 device if it's not going to work. Thanx

Steve

PS. Do you know if the latest version of the OS 5 Simulator for Windows can
now handle interrupt-driven wakeup handlers?

---

PalmSource Knowledge Base search result

Answer ID: 413

Answer Type: FAQ

Category: Operating System

PACE

Serial Manager

Date Created:01/31/2003 02:18 PM

Date Updated:02/19/2003 12:15 PM

Question:

Palm OS 5 applications may have trouble running at interrupt time

Answer

The Palm Application Compatibility Environment (PACE) is not interrupt safe
so 68K applications running through PACE may experience problems if they
attempt to run during an interrupt. A couple of ramifications of this are:

1) SysNotifyBroadcastFromInterrupt is non existent through PACE in Palm OS
5. Developers should check the OS version before they attempt to make this
call.

2) Serial Wakeup Handlers set with SrmSetWakeupHandler may work
inconsistently under different versions of OS 5 and will not work at all via
the Palm OS 5 Simulator. In general, developers should avoid using serial
wakeup handlers in OS 5.

**If you do attempt to use wakeup handlers in an OS 5.0 environment note
that they will only work while the application that set the wakeup handler
is still active. This is fixed in OS 5.2, but the wakeup handler itself
should be stored in a memory location separate from the application (such as
copying the function into a FtrPtr and setting the wakeup handler to this
FtrPtr). For example:

//The size of the handler function can be calculated by subtracting the
memory location //of the handler function from the next function in your
code resource. sizeOfPatch = (UInt32)((UInt32)FunctionAfterHandler-

(UInt32)HandlerFunction);

//allocate a FtrPtr the size of our handler and then copy it in.
FtrPtrNew(appFileCreator, ourFuncFeature, sizeOfPatch, funcP); if (funcP)
{ //copy callback function to the above address. DmWrite(funcP, 0,
(MemPtr)HandlerFunction, sizeOfPatch); }



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


Data call notification in Telephony Manager

2003-08-14 Thread Geoff Day
I'm using a Tungsten W with GSM, I've registered for notifications using the
kTelTelephonyNotification constant and all is well for incoming voice calls
(I get launched with sysAppLaunchCmdNotify). However incoming data calls
don't give me a notification - anyone know how I can enable that?

The Telephony Manager knows there is an incoming call because I can poll
TelGetCallState() and the .state value changes from zero to 1. Polling is
not a practical option in my application however.

Thanks,

Geoff Day
Interaxis Computing Ltd



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


Re: fill a seperated area of a form

2003-08-14 Thread Hal Mueller
You'll have to draw it yourself using the WinPaint/WinFill/WinDraw 
routines (Rectangle, FilledRectangle, Line), or use a bitmap. 
There's no high-level way to define it in terms of form functionality.

H

--
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 Dave Carrigan
On Wed, Aug 13, 2003 at 10:11:29PM -, drvirens wrote:
 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 ? 

You would have to ask the PalmOS development team why they chose that
number.

-- 
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 Neil Young - Helpless (Unplugged)

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


Re: Non-relocatable chunk leaked

2003-08-14 Thread Sebastian Voges

 
 the dump from the log file is as following. any clue? thanks.
 
 0.000: WARNING: 
 0.000: WARNING: Memory Leaks
 0.000: WARNING: 
 0.000: WARNING: Begin Memory Leak Dump 0.000: WARNING:
  0.000:
 Non-relocatable chunk leaked at 0x0003C460, size = 8 0.000: Chunk
 allocated by:
 0.000:  Unknown @ 0x000474D0
 0.000:  Unknown @ 0x00046F08
 0.000:  Unknown @ 0x0004732A
 0.000:  PrvSendEventToForm
 0.000:  FrmDispatchEvent
 0.000:  Unknown @ 0x000459E0
 0.000:  Unknown @ 0x00045B9E
 0.000:  Unknown @ 0x00044FDE


if you turn on debug symbols in you build you will get the function names instead of
the Unknown.
for codewarrior9 that is under settings-Code Generation-68 compiler.

then you know at least where in you code this memory got allocated und you just have to
figure out why it was not deallocated.

Best regards,

Sebastian 





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


Re: Sorting Records Question (Newbie)

2003-08-14 Thread Brad Figler
Read the palmOS API reference!

Under Data and Resource Manager you will find a list of functions that you
can use to operate on palm databases.  Look at DmInsertionSort and
DmQuickSort for two sorting options.  No tutorial required!

~Brad


Julio Sejtman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hi All.
 I'm looking for some information like a tutorial where I can have some
 information about sorting records in a PDB file (on the palm) I'm using
 PRC-Tools (SDK-4.0)

 Thanks

 Julio







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


Re: memory leak

2003-08-14 Thread gamepower111
Thanks a lot!!

Dave Carrigan [EMAIL PROTECTED] ??:[EMAIL PROTECTED]

 On Thu, Aug 14, 2003 at 12:53:10AM +0100, gamepower111 wrote:

  In the FormHandleEvent function, i used the following codes, when the
form
  can be closed correctly and return to the main form of the project. but
if i
  exit the application, memory leak occured. If I delete the
frmCloseEvent
  codes in this form, it works well. Who can tell me the reason?
  I have to use this event, because i have to free some memory which were
  allocated during the form runing.
 
  // the frmCloseEvent codes
  case frmCloseEvent:
 frmP = FrmGetActiveForm();
 FrmEraseForm(frmP);
 handled = true;
 break;

 Don't set handled to true; it prevents PalmOS from doing some of its own
cleanup.

 --
 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 Crosby, Stills, Nash  Young - Drivin'
Thunder (American Dream)





-- 
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






This is not such a good idea because StrAToI doesn't like NULL pointers,
and if the user has never entered something into the field, then it will
complain.
It actually does fine thus far. But, I see where the concern is. Good
practice
would be to get the Ptr, check for NULL, and then assign it, correct?

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?

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.

Thanks Dave.

Nole Mailey




|-+---
| |   Dave Carrigan [EMAIL PROTECTED]|
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   .palmos.com |
| |   |
| |   |
| |   08/13/2003 06:54 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 06:41:19PM -0500, [EMAIL PROTECTED] wrote:

 Okay, this a bit of a dorky question. I asked at a C Forum, and this
 was the suggestion. I'm hoping this is a Palm Dev Forum related issue:

It is a C issue, although the error message you get is a bit nicer than
the error message you might get from another OS.

   typedef struct
   {
 UInt32 *orderQty;
 Char *key;
 Char *desc;
   } OnOrder;

   onOrder.orderQty = (UInt32 *) StrAToI(FldGetTextPtr(field));
// Gets the number from the field

This is not such a good idea because StrAToI doesn't like NULL pointers,
and if the user has never entered something into the field, then it will
complain.

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

   UnpackOnOrder(onOrderFound, packedOnOrder);  // Grabs from
 pdb
   *(onOrder.orderQty) += *(onOrderFound.orderQty);// THIS
LINE CAUSES THE ERROR

Well, since you did that bizarre assignment earlier, the value of
orderQty is whatever value was in the form. My guess is that it was 20,
since your error message was Application just read from memory location
0x14, and 0x14 == 20.

You should get a good book on C and programming with C pointers. If the
people on the C forum had read your code more carefully, they would have
seen the problem as well.

--
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 Crosby, Stills, Nash  Young - This Old
House (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: Non-relocatable chunk leaked

2003-08-14 Thread gamepower111
  From the size of the log file, it looks the leaks come from the
  link-list. The log file contains the following sentence:
  Non-relocatable chunk leaked at 0x0003C460, size = 24

 Looks like you allocated the memory by MemPtrNew() [ or new if
 C++ ] and then forgot to de-allocate it.

 Would you mind posting the relevant dump from the log here so that we
 could probably zero in where exactly / what exactly the leak would
 be ?

 -Viren

Hi Viren,

the dump from the log file is as following. any clue? thanks.

0.000: WARNING: 
0.000: WARNING: Memory Leaks
0.000: WARNING: 
0.000: WARNING: Begin Memory Leak Dump
0.000: WARNING: 
0.000: Non-relocatable chunk leaked at 0x0003C460, size = 8
0.000: Chunk allocated by:
0.000:  Unknown @ 0x000474D0
0.000:  Unknown @ 0x00046F08
0.000:  Unknown @ 0x0004732A
0.000:  PrvSendEventToForm
0.000:  FrmDispatchEvent
0.000:  Unknown @ 0x000459E0
0.000:  Unknown @ 0x00045B9E
0.000:  Unknown @ 0x00044FDE
0.000: Chunk contents:
0.000:  00 03 C4 70 00 00 00 00   ...p
0.000: 
0.000: Non-relocatable chunk leaked at 0x0003C470, size = 24
0.000: Chunk allocated by:
0.000:  Unknown @ 0x00046EE6
0.000:  Unknown @ 0x0004732A
0.000:  PrvSendEventToForm
0.000:  FrmDispatchEvent
0.000:  Unknown @ 0x000459E0
0.000:  Unknown @ 0x00045B9E
0.000:  Unknown @ 0x00044FDE
0.000: Chunk contents:
0.000:  66 61 6E 00 00 00 00 00  00 00 00 00 00 00 00 00  fan.
0.000:  00 00 00 00 00 03 D0 6E   ...n
0.000: 
0.000: Non-relocatable chunk leaked at 0x0003C490, size = 4
0.000: Chunk allocated by:
0.000:  Unknown @ 0x00045A82
0.000:  Unknown @ 0x00046EA4
0.000:  Unknown @ 0x0004732A
0.000:  PrvSendEventToForm
0.000:  FrmDispatchEvent
0.000:  Unknown @ 0x000459E0
0.000:  Unknown @ 0x00045B9E
0.000:  Unknown @ 0x00044FDE
0.000: Chunk contents:
0.000:  00 03 C4 60   ...`
0.000: WARNING: 
0.000: WARNING: End Memory Leak Dump
0.000: WARNING: 




-- 
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 Dave Carrigan
On Wed, Aug 13, 2003 at 12:57:15PM -, drvirens wrote:

 AFAIK, the implementation of new keyowrd on Palm is such that it 
 always calls the MemPtrNew() API of the Memory Manager 
 internally...so you are really given a direct physical address by the 
 system. Since this poiner is not locked, it may become a dangling 
 pointer should the system run a compaction routine or other similar 
 job behind your back. 
 
 So, the wise thing to do would be to use the new only if you are sure 
 you are not gonna need the object for longer periods of times. 
 
 Guys, please correct me if I am wrong. 

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. 

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.

-- 
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

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


Fw: Re: How know the name fields of PDB file

2003-08-14 Thread drvirens

Thanks Doug for that explanation. And nice to see ya' after a long 
time. :-)

 No, things fell apart because you made the assumption the 
recordlist info would
 follow a 78 byte header.  Per the Palm OS docs you need to account 
for the
 AppInfoBlock, if present, and the SortInfoBlock, if present.  It is 
not
 AppForge's fault if you made false assumptions.

Correct. But Doug, how would I know what all info is it dumping in 
the AppInfoBlock or SortInfoBlock ? I mean there is no way for me to 
know by how much do I have to increment my offset unless I know what 
all bytes have been dumped in there. One could simply put in some 
secret messages/easters etc in the above block and it would be just 
too much for my lil palm-based PDB reader.

-Viren



-- 
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 Steve K
I appreciate all the feedback.  It runs smoothly now, and makes much more
sense.

Thanks,

Steve

Dave Carrigan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 On Wed, Aug 13, 2003 at 05:24:44PM -0700, 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?
 
  void foo()
  {
  // Verify field attributes
  FieldAttrType* fldAttr = NULL;
  FldGetAttributes(fldP, fldAttr);

 I'm actually amazed that it runs fine on the palm handheld. I guess the
 handhelds are more forgiving about writing data to memory location
 0. That code is bad bad bad.

 Try

  FieldAttrType fldAttr;
  FldGetAttributes(fldP, fldAttr);

 Or, if you insist on passing a real pointer to FldGetAttributes:

  FieldAttrType* fldAttr;
  fldAttr = MemPtrNew(sizeof(FieldAttrType));
  FldGetAttributes(fldP, fldAttr);
   ...
  MemPtrFree(fldAttr);

 Hint: don't do it this way, but it might give you some insight on what
 was wrong with your code.

 Also, find a good book on C that explains pass by reference via pointers
 vs. pass by value.

 --
 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 Questions - Price You Pay (Instrumental)
(Price You Pay)





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


Armlets

2003-08-14 Thread Paul Johnson
Hi.

I have a massive project I need to convert to palm os5. I've stubbed out all
the platform dependent stuff finally, and am about to start a conversion
proper.

Where's the best place to learn about armlets and how to use them. Please
note I know nothing about them at this point and have only heard that these
are what I need to look at.

Thanks


Regards,
Paul Johnson
Applewood House
www.applewoodhouse.com


-- 
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 Viren
Thats okay. :-). I did something same yesterday afternoon.

Welcome to dev-forum.

-Viren


-- 
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/


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: 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/


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.
http://www.transpac.com
+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: 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: 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: 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: 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: 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: 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: 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: (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: 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: 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: 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: 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: 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
   http://www.hotpaw.com/rhn/palm
--
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;icnt;i++){
int itemLen;
char *src=GetAListItem(i);//this is simplified for brevity
StrNCopy(dest,src,listWidth);
theList[i]=dest;
itemLen=StrLen(dest)+1;
dest+=itemLen;
//if you want to be stingy:
//memUsed+=itemLen
}
   // If you want to be stingy:
   // MemPtrResize(theList[0],memUsed);

return theList;

}
If you want to get really ooky for no particular reason,
you can use handles and lock them.

and 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: 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: 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/


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/


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/


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/


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: 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: 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
   http://www.hotpaw.com/rhn/palm




--
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: 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/


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: 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/


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: 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: 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: 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: 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: 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/


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/


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/


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/


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 -Fwhatever 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.
http://www.transpac.com
+1 530-470-9200
--
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: 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/


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: 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...
somewhere, someplace, I have a compiler that failed to include
dquoted text following an embedded '\0', but it ain't this one

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: 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: 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: 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: 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: 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: 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: 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: 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/


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: 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: 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: 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/


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: 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/


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/


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/


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/


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/


  1   2   3   4   5   >