Re: Pressing the SELECT button on T|T resets Palm

2004-02-17 Thread Gordon, Douglas
I have an application and it has an About screen.  
On the About screen is  one button, OK. If the 
T|T SELECT button is pressed briefly, the Palm 
resets.

Make sure you don't have a graphical button on the modal form. This does cause a TT to 
reset when Select is pressed, but if you handle the keyDownEvent for the Select button 
in your event handler you can prevent it (in the handler you can queue a 
ctlSelectEvent for the OK button). I think only the TT has this problem; it works OK 
on T3s and other devices AFAIK.

  Doug Gordon
  GHCS Software

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


Re: Int32 only 16 bits?

2004-02-09 Thread Gordon, Douglas
I've just written the following code:

Int32 value = 1  16;

Compiling with gcc and PRC-Tools, sdk5-r3, 
I get the following warning:

warning: left shift count = width of type

This has been answered clearly by others, but I just wanted to make a comment about 
coding in C with its sometimes hard-to-remember operator precedence and type 
conversion rules. The two simple things that will get you into trouble and are very 
hard to see when looking at your code are mixing integer sizes and mixing signed and 
unsigned variables. The PalmOS API doesn't help much since it has some parameters as 
Int16 in some calls whereas a similar parameter is UInt16 in another call.

Anyway, having been burned by this often enough, I generally use explicit type-casting 
when mixing types so that I can control when the program will convert to a different 
size integer or from signed to unsigned, etc. It is not only more reliable, but makes 
the code easier to understand.

  Doug Gordon
  GHCS Software

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


Re: How to draw border for table??

2004-02-06 Thread Gordon, Douglas
I'm using the following code to draw border for table

TableType *table;
RectangleType tblbounds;

Table = GetObjectPtr();

TblGetBounds(table,tblbounds);
WinDrawRectangleFrame(simpleFrame,tblbounds);

But the border is not coming to the table when the form 
is shown at runtime.

Where are you calling this code? You have to do it after FrmDrawForm has been called. 
You will also need to call it if the form is refreshed and redrawn, such as in 
response to frmUpdateEvent.


  Doug Gordon
  GHCS Software



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


Graphical button crashes TT

2003-12-04 Thread Gordon, Douglas
I could not find anything on this in the archives, but it's hard to believe it has not 
been encountered. If I have a dialog with a graphical button visible on it, displayed 
with FrmDoDialog, if the app is running on a Tungsten-T and I use the Select key to 
dismiss the dialog (instead of tapping on the OK button), the TT soft-resets. If I run 
it on the TT Simulator, the Simulator crashes and exits.

To eliminate anything I might have trashed somewhere else in my app, I took the 
Codewarrior 9.2 Starter stationery app and simply added a graphical button to its 
About dialog. Same results: crashes on a TT (but not on a T3 simulator). FWIW, I am 
using CW 9.2, Constructor 9.3, and have created these bitmap families with 1-bit and 
8-bit-depth bitmaps. If the graphical buttons are hidden with FrmHideObject, then the 
Select key works OK for dismissing the dialog.

The workaround in my app is to provide an event handler for the dialog and handle this 
key myself by posting a ctlSelect event for the OK button, but it doesn't seem like I 
should have to do this.

  Doug G


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


Extraneous char on T3 Simulator

2003-12-01 Thread Gordon, Douglas
When I run my app on the latest T3 Simulator (and only on that simulator), in one of 
my full-screen modal dialogs I get a letter G near the upper left corner and can't 
figure out where it's coming from. It seems to be periodically refreshed. I have a 
function that draws a line on the screen that happens to cross over the G, but about 
a half-second later the G is back on top again. This happens when my app is really 
doing nothing -- I have an event handler for the dialog that is being called, but at 
this point it is just idling and returning false all the time.

I don't own a T3, but I sent a copy of the app to one of my beta testers and luckily 
he does not see anything unusual on the screen. Anyone know where this might be coming 
from? Strange that it only appears when this particular form is active.

  Doug G

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


Re: Regarding MemMove

2003-11-24 Thread Gordon, Douglas
Tom Hoelscher wrote:
Generally speaking, a MemMove does not actually *move* 
the data, but copies it to the destination, leaving the 
original data (the source) intact. 

It seems like Palm could have avoided lots of confusion by just naming this function 
MemCopy instead of MemMove. After all, everyone is quite familiar with the 
difference between moving a file and copying one. It also seems like they generally 
tried to follow the standard C library names as much as possible, e.g. strcpy became 
StrCopy, memset became MemSet, etc. So why did they change memcpy to MemMove?

  Doug Gordon

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


Graphic Button Select Bitmap

2003-11-20 Thread Gordon, Douglas
When I did the bitmap families for my graphic buttons, I of course have one family for 
the normal appearance of the button and one for the selected appearance when you 
hold the stylus on it. For the normal bitmap family, I made a 2-color bitmap for 
monochrome devices and a 256-color bitmap for color devices (I might fill out the set 
later).

For the selected bitmap family, I really just wanted an inverse white-on-black 
appearance so I created just a 2-color bw bitmap and figured that PalmOS would take 
it from there. It is working OK, but on my Tungsten-T I notice that the graphic is 
actually white on a dark green when the button is selected. Since they are small to 
begin with and it still looks OK, this is not a big deal, but I was wondering why it 
does not map the black in the 2-color bitmap to actual black on the device.

  Doug Gordon

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


Ending a FrmDoDialog session

2003-01-22 Thread Gordon, Douglas
Usually when you put up a form with FrmDoDialog, the window is taken down
and the function returns to the caller automatically when the user taps a
button. If I have my own event handler for the window, what is the method
for finishing up the dialog without the user having tapped a button? My
window will have a sort of picklist (as well as a Cancel button). When the
user taps on an entry in the table, I will save his selection and then want
to end the dialog. What call would be used from within the dialog to end
itself?

  Doug Gordon

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



RE: Truncated chars in table cell

2002-04-22 Thread Gordon, Douglas

Peter Epstein wrote:
FntCharsWidth takes as input the current font. 
You should switch to the font you plan to use 
for drawing the characters before measuring 
the characters. Perhaps that is your problem? 

Actually, what it turned out to be was the invisible pixel between columns
that is apparently put into the table by default by the Constructor. If you
make a table 150 pixels wide and specify 3 columns of 50 pixels each, the
last column will actually be a couple of pixels short of displayable space.
I truly was not aware of this. Since I didn't need the inter-column spacing,
I added calls to TblSetColumnSpacing with zero spacing and my truncation
problem went away.

  Doug Gordon



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



Truncated chars in table cell

2002-04-19 Thread Gordon, Douglas

This is almost too simple a problem to post, but I can't figure out where
it's going wrong. I'm using a custom draw procedure to draw the contents of
some cells in a table. I want the data right-justified in the cell, so I do
some calculation on where to start drawing. The problem is that the contents
of the right-most cell is chopped off slightly, so it looks like I'm
starting the draw a few pixels too far to the right. Here's what I'm doing
in my custom draw procedure:

  1) I get the width of the output string by calling FntCharsWidth.

  2) I calculate the offset to the right in the cell like this: offset =
rect.extent.x - width, where rect is the rectangle argument that is
passed into the function.

  3) I call WinDrawChars to write the string, giving it an x starting point
of rect.topLeft.x + offset.

So why would the field contents end up being truncated? I guess I could fix
this by kludging the offset to be a bit to the left, but I can't figure out
where the calculations are going wrong. Any ideas?

  Doug Gordon

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



Re: Default Event Handler and Memory Leaks

2001-11-02 Thread Gordon, Douglas

FrmCloseEvent will get rid of all the memory 
automatically allocated by the OS relating for 
forms and other things. You are only responsible 
for getting rid of things that you explicitly allocate.

And not even always exactly that. If you allocate memory for a field entry
and pass it to the field with FldSetTextHandle, then that memory will be
automatically deallocated when the form is closed. In fact, this can
sometimes screw you up if you really want to retain that memory, but forget
to call FldSetTextHandle with a NULL pointer before closing the form
(DAMHIK).

  Doug Gordon
  GHCS Software

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



Re: Building External Palm Database

2001-09-06 Thread Gordon, Douglas

From: Nicholas Pleis [EMAIL PROTECTED]

Is it possible to build a Palm Database File (.pdb)
and then move that data to the Palm? 

The format of a Palm database file is published in one of the papers on the
PalmOS site. It's a little tricky to understand if you're not a low-level C
programmer (i.e., someone who knows exactly how to push the bytes around),
but it is not really too difficult to do yourself. Assuming that you're
creating it on a PC, one thing to remember is that you have to swap the
bytes around on any 16-bit or 32-bit integer fields since the PC is
little-endian and the Palm platform (like the Mac) is big-endian. If you
don't know what I'm talking about, then you're better off using one of the
DB builder utilities that was mentioned here.

  Doug Gordon
  GHCS Software

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



Re: VFS Emulation?

2001-07-31 Thread Gordon, Douglas

Is the PalmOS40-en-v-fulldbg.rom the only ROM I can use 
with the Emulator to test my software and actually fake a 
file system in the Emulator? 

In addition to loading the M500/505 ROM, you will need to load the
HostFS.prc app, which is the module that emulates a memory card by using
your PC's file system (PC-based development only). With this installed, you
can assign a directory to represent your card, create subdirectories within
it, etc. One thing to watch out for: each time you start POSE, you will have
to explicitly do a soft *reset* or else your app will crash when it does its
first VFS call. This may be fixed in a future release of HostFS, I guess.
There are also some other shortcomings of the VFS emulation, but it is good
enough to get your product working.

  Doug Gordon
  GHCS Software

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



Re: How to free memory...

2001-02-20 Thread Gordon, Douglas

From: Herman Badenhorst [EMAIL PROTECTED]

Hi group, if i've got the function below...how can i free the memory 
used by these variables?

The memory used by what variables? I see variables that are local to the
function, meaning that they are allocated on the stack when the function is
called and thus go away when it returns. I also see a static variable that
is of course permanently "allocated". I don't think you have any problems
here!

  Doug Gordon


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



Re: HotSync settings

2001-02-19 Thread Gordon, Douglas

From: "DesertHajah" [EMAIL PROTECTED]
I need to deploy the Palm Desktop (hotSync Manager) on a large firm.
All computers run NT Workstation (soon Win2k), and each have their own
hardware configuration. This configuration is known and well documentated.

I need a way of remotely setting the HotSync Manager to listen to a serial
port (COM1, COM2 or COM3), set up a baud rate (115200) and ...

Is there a configuration file, registry settings or ... How can I
automatically set up the hotSync manager, without going over to every
machine and doing it locally.

Also, most machines, have multiple users, and these settings, seem to reset
every time a new user logs on... Any way to solve this ??

Using "regedit", look in the registry under the
HKEY_CURRENT_USER/Software/U.S. Robotics key (the Palm was originally their
product) and you will find all the settings that you are looking for
(they're pretty much self-explanatory). Unfortunately, Palm always puts this
under the HKEY_CURRENT_USER root, which means that it is defined separately
for each user who logs in! Since conduits are also defined within this
registry key, this means that a given conduit must be "reinstalled" for each
user who needs to use the conduit. 

I have found this to be a general PITA even on my home system, where I had
to install Palm Desktop twice so that my wife and I could both use it under
our separate logins. I installed it into the same disk directory, but had to
run the install procedure itself twice so that the registry would be
correctly updated.

This is going to cause you problems in what you're trying to do.

  Doug Gordon



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



RE: Tree

2001-02-16 Thread Gordon, Douglas

I am using Code Warrior. Is there any predefined control 
I can use to create a tree?

"Software is written by fools like me,
But only God can make a tree."

  -- Joyce Kilmer, Palm, Inc.


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



FW: Popup only works once

2001-01-25 Thread Gordon, Douglas

Well, nobody responded to my message, so I guess I'll have to answer it
myself (I guess most questions that get answered here are of the "please
tell me how to do X so that I don't have to read the documentation") :-).

Anyway, the source of this problem is that the list resource that I was
using had the "Usable" attribute checked! I must have left this checked by
mistake, as I definitely know better (and that's why I had not looked
there). Why having this checked would cause this type of stange problem, I
don't have the faintest idea. But, as soon as I unchecked it everything
started working!

  Doug Gordon

 -Original Message-
 From: Gordon, Douglas 
 Sent: Wednesday, January 24, 2001 8:32 AM
 To:   'Palm Developers'
 Subject:  Popup only works once
 
 I use popups in 3 places in my app, but one of them is not working
 correctly and I'm really stumped. Here is how I do it:
 
   -- Since I have to dynamically build the list, when the popup control is
 tapped, I intercept the ctlSelectEvent, build up a list of choices using a
 dynamically allocated array of char *'s, and then set up the list by
 calling LstSetListChoices, LstSetTopItem, LstSetSelection, and
 LstSetHeight. I then return "false" to allow the popup control to work.
 
   -- The list appears. If I then click on a list item, my code intercepts
 popSelectEvent, looks at Event-data.popSelect.selection, etc., and then
 may go to another form if a new selection is made. I also return "false"
 from this handler (although it doesn't make any difference if I'm
 switching forms anyway).
 
 The problem occurs if, when the list appears, I tap somewhere else on the
 screen. The list disappears as it should, but after that, I can't get the
 popup control to work at all! Putting a breakpoint at the top of my event
 handler, when I tap on the control I get events like penDown and penUp,
 but no ctlSelectEvent. It is as if the control has become disabled for
 some reason. The other controls on the screen continue to work, and if I
 go to another view and then come back, the popup will work again (at least
 once).
 
 This is not much different from the other popup lists in the program that
 are working OK. I'm doing this on debug ROMs, so if I were doing something
 really bad I'd expect to see an error message. Any ideas on what can be
 happening here?
 
Doug Gordon

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



Popup only works once

2001-01-24 Thread Gordon, Douglas

I use popups in 3 places in my app, but one of them is not working correctly
and I'm really stumped. Here is how I do it:

  -- Since I have to dynamically build the list, when the popup control is
tapped, I intercept the ctlSelectEvent, build up a list of choices using a
dynamically allocated array of char *'s, and then set up the list by calling
LstSetListChoices, LstSetTopItem, LstSetSelection, and LstSetHeight. I then
return "false" to allow the popup control to work.

  -- The list appears. If I then click on a list item, my code intercepts
popSelectEvent, looks at Event-data.popSelect.selection, etc., and then may
go to another form if a new selection is made. I also return "false" from
this handler (although it doesn't make any difference if I'm switching forms
anyway).

The problem occurs if, when the list appears, I tap somewhere else on the
screen. The list disappears as it should, but after that, I can't get the
popup control to work at all! Putting a breakpoint at the top of my event
handler, when I tap on the control I get events like penDown and penUp, but
no ctlSelectEvent. It is as if the control has become disabled for some
reason. The other controls on the screen continue to work, and if I go to
another view and then come back, the popup will work again (at least once).

This is not much different from the other popup lists in the program that
are working OK. I'm doing this on debug ROMs, so if I were doing something
really bad I'd expect to see an error message. Any ideas on what can be
happening here?

   Doug Gordon

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



Popup only works once (follow-up)

2001-01-24 Thread Gordon, Douglas

I posted an earlier message about a popup control that pops up its list only
once and then stops working. This happens even if you tap off to the side of
the list so that it disappears without doing anything. What I just found out
is that the popup is not totally inactive. If I tap at a particular tiny
spot above the down-arrowhead, the list will pop up again! What it now looks
like is that the control hotspot is reduced to a single pixel (?) at the top
left origin of the control. So what would cause this? Especially since it
happens during an action where my code is really not doing anything (pop up
a list and dismiss it without selection).

  Doug Gordon
  GHCS Software

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



Re: What versions of PalmOS to support?

2001-01-23 Thread Gordon, Douglas

From: [EMAIL PROTECTED] (Rick Kier)

snip

So, the question came up (thanks Danny) did we have to support 
PalmOS 2.0?  The answer is "We don't know."

Any ideas on either: how to determine "DB in rom" on PalmOS 2.0 
or whether we should support PalmOS 2.0?

When I wrote my first app, I was careful to maintain 2.0 compatibility so
that I could reach the max number of customers. It was not really that
difficult, since there were not all that many 3.x-only features that I
needed, and I simply conditionalized the usage of some of them. However, I
now think that there were very few of these customers, and I could just as
well have skipped the effort. Besides, the memory on 2.0 devices was
generally very limited, so people did not tend to load so many 3rd-party
apps, and especially ones like mine that are usually associated with large
databases, etc.

  Doug Gordon
  GHCS Software



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



Database design vs. download time

2001-01-18 Thread Gordon, Douglas

A recent major change that I made in my application has confirmed something
that I had suspected and that you might want to consider in your own
designs: database download (sync) time is much more affected by the number
of records than by the size of the records. That is, if two databases are
the same size in total bytes, the one with fewer records in it will sync
faster (this is due to having to free and/or allocate memory for each chunk
on the Palm, etc.).

In my original design, I had a one-to-one correspondence between my logical
records and Palm database records. So, if my data had 2000 records, that
meant 2000 Palm database records, many of which were quite small (100
bytes). The database is generated on the PC and is loaded to the Palm by
either a regular database install or by using a conduit. My recent change
was to develop a record packing algorithm that puts up to 50 logical records
into each Palm record. This is a little extra work to create the database
and to unpack the records when accessing them on the Palm, but not really
that much.

For comparison, an old-style database that was 120Kb in total size took 70
seconds to download when replacing an existing database on the Palm. The
exact same data using the packed-record design was 122Kb in total size and
took 18 seconds for the same operation!

I thought that these results were quite interesting. Now I'm anxious to get
my new version out there so that I can tout this as a new, improved feature
:-).

  Doug Gordon
  GHCS Software

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



Re: scrolling a form

2000-12-01 Thread Gordon, Douglas

news.palmos.com [EMAIL PROTECTED] wrote in message
news:31636@palm-dev-forum...

 hi!
 i'm sorry if this a silly question but i'm trying to
 put a vertical scroll on a form and not on a
 field or table
 does anyone know how i should do it
 please help





You're trying to scroll an entire form? You mean a form with all its buttons
and other controls?? Putting a scroll bar on it is no problem -- it's just a
control like any other, and you will have to handle all the scrolling events
anyway. But you'll have a lot of "fun" getting the other controls on the
form to "scroll" if that is really what you had in mind!

  Doug Gordon
  GHCS Software

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



What did PalmOS 3.5.2 fix?

2000-11-20 Thread Gordon, Douglas

A customer informed me that my conduit was causing his Palm to crash when it
attempted to update a database (which it does by deleting the existing DB
and then creating a new version). After some unsuccessful attempts to find
the problem, I told him to use the option of creating the database on the PC
as a .PDB file and installing it with Hotsync. It crashed again. Finally, I
told him to just delete the entire application and reinstall from scratch.
Attempting to delete the app from the launcher also crashed the Palm, and
the app would not go away (BTW, the app continued to work OK during all of
this).

Knowing that he had a Palm IIIxe, I then thought that it could be the DRAM
problem that had corrupted something and maybe a hard reset would be
necessary. I suggested that he go to the Palm site and get the DRAM test
program. When I next heard from him, everything was OK again. His unit had
passed the DRAM test, but while he was on the site he noticed the 3.5.2
update, downloaded it and installed it. Problem fixed! My conduit now works
again, and the database can be deleted and re-created.

So, this really makes me wonder what was fixed in 3.5.2. Does anyone know
what problem in the original 3.5 could have caused such a serious-appearing
problem with deleting my database? Anyone else ever see this kind of
problem?

  Doug Gordon

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



Re: Efficiency: Integers: 32bit vs. 16bit vs. 8bit

2000-11-06 Thread Gordon, Douglas

From: "Avner BenHanoch" [EMAIL PROTECTED]

Which of these integral data types is best for saving calculation time on
Palm environment? (also what about 64bit long integers)
(I am programming with Java 2 ME for the Palm)

The 68K CPU core in the Palm devices is equally good at handling
calculations in 8, 16 or 32-bit integer sizes. 64-bit math requires a lot
more gyrations or the use of library routines since there is no native
64-bit support in the CPU.


What will get you into both extra code and extra execution time is when you
*mix* integer sizes. In this case, some extra instructions may be required
to extend or truncate values to match (not to mention possible
side-effects). For example, function arguments are always passed as 32-bit
values on the stack, regardless of whether the function prototype calls for
a Int8, Int16, or Int32. So, for example, an 8-bit argument is always either
sign-extended (Int8) or zero-extended (UInt8) before being pushed onto the
stack. In reality this adds almost nothing to the time, so I wouldn't worry
about it.

The biggest problem with using shorter integers, especially when mixing
them, are potential overflows when doing assignments. For example, if you
had:

  Int16 word_int;
  Int8 byte_int;

  word_int = 500;
  byte_int = word_int;

The assignment to "byte_int" will be done with no error posted, but the
result will be "wrong" since a signed 8-bit integer can't hold a value of
+500. If you printed byte_int out, it would display as -12.

  Doug Gordon
  GHCS Software



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



Visor Prism

2000-10-16 Thread Gordon, Douglas

Does anyone have any technical OS details on the Visor Prism? Mainly I'm
wondering how they work the 16-bit color deal if they're using PalmOS 3.5.
Will color apps written for 3.5 on the IIIc work as-is on the Prism? It's
not going to be a lot of fun if our PalmOS apps have to start taking special
versions of the hardware into account too much.

See http://www.handspring.com/products/visorprism/index.jhtml.

  Doug Gordon
  GHCS Software

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



Visor Prism

2000-10-16 Thread Gordon, Douglas

Does anyone have any technical OS details on the Visor Prism? Mainly I'm
wondering how they work the 16-bit color deal if they're using PalmOS 3.5.
Will color apps written for 3.5 on the IIIc work as-is on the Prism? It's
not going to be a lot of fun if our PalmOS apps have to start taking special
versions of the hardware into account too much.

See http://www.handspring.com/products/visorprism/index.jhtml.

  Doug Gordon
  GHCS Software

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



Re: How to determine color or no color palm?

2000-10-13 Thread Gordon, Douglas

From: "Guy Duplantier, AEC Software" [EMAIL PROTECTED]

How do I tell if I'm on a color Palm? I know I can check 
if I'm on a 3.5 system, but can I check if that system 
is color or not?

If you're on 3.5 or above, use WinScreenMode to determine the bit-depth of
the screen:

  WinScreenMode(winScreenModeGet, 0, 0, Depth, 0);
  if (Depth = 8)
Color!

Doug Gordon
GHCS Software

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



Re: Palm Sort Order

2000-10-06 Thread Gordon, Douglas

DeAnna Davidson wrote:
OK, maybe I'm a little slow or I missed something.  I've 
got an app whose .pdbs are made on the PC, and the databases 
are sorted by a particular field.  The ascii code for a 
space is 20 and the ascii code for a dash is 2D.  So, logically, 
if a the same word is in a field followed by a space, I
put it before the word followed by a dash.  However, I've 
noticed on the Palm, for instance in the Address Book, if a word 
is entered followed by a dash and the same word is entered 
followed by a space, the one with the dash comes before the one 
with the space.  The bottom line to this is that, of
course, using StrCaselessCompare or TxtCaselessCompare, a search 
gets all messed up.  Any insights into why Palm doesn't just 
use ascii sort order?

OK, I've been through this same issue for the same reasons -- needing to
generate records on the PC in the same sort order that PalmOS uses in the
CaselessCompare functions. The reason they do not use a simple ASCII sort
order is that this would not order the international (accented) characters
correctly. These characters live in the upper ASCII range (127) and are
somewhat scattered even in that range. The sort order implied by
StrCaselessCompare, using a table instead of binary character value, would,
for example, put "a" followed by "a-accent", "a-umlaut", etc. This was
actually important to me since my application is used for genealogy research
and I have numerous customers in Europe who would like to have their
ancestors' names in the right places. Using a simple ASCII sort, a name
starting with "A-accent" would come after "Z", making it hard to find.

The solution was for me to create my own "PalmStrCompare" function on the PC
side that matched the sort order used by PalmOS. This was one good reason
for having a PalmOS source license! I can now create my database in the
correct alphabetized order. BTW, the PalmOS documentation notes that the
sort order is correct for German and French, but possibly not for some other
countries. However, it is close enough for most purposes.

Drop me a line if you'd like a copy of the routine.

  Doug Gordon
  GHCS Software


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



RE: Platinum question

2000-09-18 Thread Gordon, Douglas

I'm not going for Platinum certification, but I did make Find support an
optional feature of my product, set in a preferences screen. My program
deals with genealogy and, while using Find can be a powerful way of
searching the database, I did not think that someone who also uses his/her
Palm for PDA purposes would want to search through the information for
10,000 dead people when looking for a business memo that they wrote :-).

  Doug Gordon
  GHCS Software

-Original Message-
From: Stringer [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 18, 2000 11:42 AM
To: PalmOS Entrepreneurs Forum; [EMAIL PROTECTED]
Subject: Platinum question

snip

Right now I'm faced with two alternatives:
A) Implement a C language file scan that will work with Find,
and then provide a configuration option to allow users to
disable this, with a very strong recommendation that it always
be disabled!  In other words, spend a lot of effort to add
a feature to meet Platinum requirements that will normally be 
suppressed.
   We'd also have to modify the C++ classes to leave information
to coordinate with the C language file scan.  And this whole
exercise would be a validation nightmare.
B) Obtain an official exception for non-support of Find because of 
(i) the C++ issue (not our fault!) and 
(ii) the negative User effect of Find hitting these large databases.

Roger Stringer
Marietta Systems, Inc.


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



GetCharCaselessValue

2000-09-07 Thread Gordon, Douglas

The PalmOS routines StrCompare and StrCaselessCompare work by using tables
that are indexed by the value of a single character (i.e., 0-255). This is
so they can work correctly for "accented" and other special characters that
are outside of the A-z value range. For example, StrCaselessCompare calls
GetCharCaselessValue to get a pointer to this array of UInt8 values.

In my program, I need to get access to these values so that I can do
efficient searching; for various reasons, I can't just call the standard
StrCaselessCompare function and get things to work right. So, I'd like to
call GetCharCaselessValue (or GetCharSortValue) and access the array
directly, even though this is not a publicly documented API function.

Is this a good idea, or am I leaving myself open for trouble? Another
possibility is to duplicate the table(s) in my own code, although this adds
256 bytes per table to my program.

  Doug Gordon
  GHCS Software

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



Gremlins found field problems

2000-08-23 Thread Gordon, Douglas

I recently fixed some "bugs" in my app that were ferreted out by the POSE
gremlins. The reason that I put "bugs" in quotes is that it's doubtful that
any user would ever have run into these, but I wanted my product to at least
qualify for the "Designed for Palm" status. Basically, this is what was
happening:

I had a form with a field on it that was non-editable and was used for
displaying status info. I was using FldSetTextPtr to change this field. The
gremlins were causing one of those "read directly from memory mgr.
structures" errors, and it took a lot of digging to figure out why. The
problem was that a gremlin was actually *selecting* the text in this field.
While it was selected, an event occurred that caused my app to make another
FldSetTextPtr call, but with a text string that was shorter than the
previously displayed text. FldSetTextPtr does not cause the selection limits
to be reset, so this resulted in a selection range that exceeded the length
of the current text string, causing a reference to an invalid memory
location in the field drawing routine. I fixed this with a call to
FldSetSelection(fld,0,0) before changing the text pointer. Using the debug
ROMs, I was getting an "invalid insertion point" error for a similar reason,
so I now also call FldSetInsertionPoint(fld,0) before changing the field.

  Doug Gordon
  GHCS Software

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



Re: PDB sync times?

2000-08-17 Thread Gordon, Douglas

The main factor in database download times appears to be the number of
records vs. the size of the records. If you could load a 1 Mb database as 50
20Kb records, you would be amazed at the difference in download time. I had
a database that exhibited this problem. I redesigned it so that instead of
having beaucoup very small records I had fewer, but much larger, records.
This made a tremendous difference in the transfer time.

  Doug Gordon
  GHCS Software

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



Re: Rookie assembler question

2000-08-11 Thread Gordon, Douglas

I have this function, like;

void bogus(){
   //some code
}

And then, in an asm function, I would like to use bogus as a variable to
read from. The way I understand it, bogus is nothing more than an address.
So, I whould like something like:

asm void myFunc(){
   move.l  bogus, d0   //I want the address of the bogus function
in the d0 register.
   //some more code..
}


How can I get this to work.

I don't know if the Metroworks assembler exactly follows the syntax of the
68K assembler that I am used to using, but the following should work with
one caveat:

leabogus, a0
move.l a0, d0

The first instruction loads the "effective address" of the bogus function
into an address register (has to be an address reg, not a data reg). This is
the address that you're looking for -- the absolute address of the function.
If Palm apps were built using fixed addresses instead of being
position-independent, then the line "move.l #bogus, d0" would work. However,
"lea" is more general-purpose since the address is calculated at execution
time.

The caveat that I mentioned is whether the "lea" instruction is supported on
the processor that the Palm uses, but I would guess that it is. I spent most
of my time coding for the 68020 processor, which has a lot of more advanced
instructions than the Dragonball family.

  Doug Gordon
  GHCS Software


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



Re: Someone please help me

2000-08-03 Thread Gordon, Douglas

From: "Someass Koolkarky" [EMAIL PROTECTED]

I'm new at programming PALM applications and would rather 
not have to read all the documentation.

You all don't mind if I just ask you all my questions, right?


ROTFLOL!!! My sentiments exactly about some of the questions that have been
cluttering up what used to be a very useful mailing list lately!


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



Re: Conversion to pdb(Urgent)

2000-08-02 Thread Gordon, Douglas

From: "Mr. Somnath Kulkarni" [EMAIL PROTECTED]
Hi,
How can I convert a given file, which can be in any format(txt,xml,html
etc) into pdb format?

Secondly, how can I access the information about any record in a database.
for eg. type of a record,size of the record etc.
If it is using DmRecordInfo(),How to get it exactly.

The main problem here is that you do not have the right concept of a Palm
"database". Palm databases are nothing more than a collection of memory
chunks that contain nothing more than a contiguous block of bytes/bits. The
interpretation of the contents of a database/record is entirely up to the
application program to which it belongs.

So, as far as converting a file to PDB format, there are as many ways to do
this as there are application authors :-). The same thing goes for accessing
records in a database on the Palm. You can get the size of a record easily
enough, but the "type" is known only to the application that created it
(unless its format is publicly documented).

That said, there are some ad-hoc standards that have come about for some
common types of databases. Many text-oriented applications use what is
called "DOC" format, and these databases can be read interchangeably by
different applications (Teal, iSilo, etc.). There are a number of programs
out there that can convert .txt, .html, etc. to DOC-formatted PDB files that
can be downloaded to a Palm.

  Doug Gordon
  GHCS Software



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



Re: Palm OS 3.5

2000-07-25 Thread Gordon, Douglas

From: "Gregor Jeromen" [EMAIL PROTECTED]
Where can an ordinary user get the PalmOS 3.5 upgrade?

Well, there's no place that you can legally get it until Palm releases it as
a generally-available public download. They might do this now that it has
been patched up to 3.5.2 and might have all the bugs out.

IMO, anyone who writes a general-purpose application that will only run on
3.5 is really cutting themselves out of a large market. There are a lot of
non-upgradeable 3.3 and earlier units out there, as well as a lot of people
who would be way over their heads trying to do an OS upgrade (if they would
even ever know about it).

You can still write an app for 3.5 and have it run on earler versions, up to
a point. Of course, if you write something that is very model-specific, such
as a color-only app, then using the new OS features is no problem.

  Doug Gordon
  GHCS Software


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



Re: MemSet

2000-07-20 Thread Gordon, Douglas

Chris Percival wrote:

 So what we have learn't from this is to not assume a function acts like
 another, just because it has the same name...

Or, to put it more clearly, function name assumptions are case-sensitive
:-). That is, "MemSet" != "memset". If they had used exactly the same name,
we could be all over their case for not following C library standards. But,
by using the new mixed-case names they can claim that it's not really the
same function and you shouldn't assume anything. In this case, however, it
was really bad form to make this change, and I suspect that someone simply
blew it. 

I'm glad that I use an editor (CodeWright) that pops up the function
definition as I'm typing so that I'm always reminded what the arguments are
for this and the rest of the PalmOS API.

  Doug Gordon
  GHCS Software

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



Re: Using OS 3.5 calls...

2000-07-19 Thread Gordon, Douglas

OS 3.5 has some very nice features I could take advantage of.  But if I
use it more than trivially, I'd have to write a substantially different
version of my code to work on  3.5 devices.  And once I finished this,
I'd have accomplished the same thing without using 3.5.

I've also thought about this. I think that if you are a shareware author
trying to reach the maximum number of customers, then you simply have to
stick with the lowest possible common OS features. Most simple but useful
apps can still be written using 2.0 as the minimum version. In my app, the
only "advanced" features that I have added are for the color Palms, and that
code has to be runtime conditionalized in any case. The one nice 3.5 feature
that I'd like to use are the gadget buttons, but, as you say, it makes no
sense to implement the new control as well as a kludge for pre-3.5 devices.

I think that the use of more advanced OS features, that would lock the app
into a higher OS version such as 3.3 or 3.5, would be justified in the
following cases:

1) Apps that depend on some Palm h/w feature that is tied to a particular
minimum OS version. For example, there are no 2.0 devices with wireless
connectivity. The same for future devices with memory slots, etc.

2) In-house corporate apps where the company controls what devices are being
used. If everyone is being given a IIIxe, then you can write to the 3.5 API
exclusively.

  Doug Gordon
  GHCS Software

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



Re: List and a scrollbar

2000-07-17 Thread Gordon, Douglas

From: "Michael Nyrup" [EMAIL PROTECTED]

I have a "List" associated with a "Popup trigger" the normal way. I
wondered
if it is possible to add a scrollbar to this list instead of the little
arrow in the bottom of the list?

The List is a standard PalmOS control, so I do not think it would be
possible to use a scrollbar in place of the provided arrows, especially if
you're counting on PalmOS handling the control details for you.

  Doug Gordon
  GHCS Software


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



Integers in tables, etc.

2000-07-12 Thread Gordon, Douglas

In one view, my app displays a scrolling list of all the records in the
database. The database size is strictly dependent on the user, but I had
originally assumed that nobody would have more than a few thousand records.
The other day I got a report that the program was crashing in Scroll.c due
to an "invalid argument". This user had a database with 35,000 records,
immediately raising a flag with me regarding 16-bit integers and signed vs.
unsigned issues, etc. (sound familiar to anyone?).

Sure enough, the arguments to SclSetScrollBar are Int16, whereas the
database index values that I was using to set the scroll bar values are
UInt16 (since a database can have up to 64K records). So, to get this to
work right I now calculate the values as (record_index  1) and pass these
to SclSetScrollBar to prevent overflowing the range of a signed 16-bit
integer (the position and max values only have to be "relative" so it is
permissible to scale them).

In another place, I was displaying a record index value in a table using the
built-in "numericTableItem" style so that PalmOS would automatically display
the number. Again, this style assumes a signed 16-bit integer, so values
above 32,767 would display as negative numbers. I had to make this a
"customTableItem" and do the conversion and display myself.

I don't have any questions about how to handle this, but thought it would
serve as a warning to others as a danger in mixing signed and unsigned
integers in cases where you're not sure what range of values you might
encounter! BTW, I've always wished that the following code could be made to
generate a run-time error:

  UInt16 x;
  Int16 y;

  x = 5;
  y = x;

This will execute OK, but the result is "wrong" since you can't stuff a
value of 50,000 into a signed Int16. The compiler will usually just transfer
the value of x directly into y, but y will be seen as a negative number. The
bit-wise representation of x  y will be the same, but the values may not be
interpreted correctly depending on how you use them!

  Doug Gordon
  GHCS Software

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



IIIc Charging Light

2000-07-10 Thread Gordon, Douglas

Pardon the off-topic post, but this is the best collection of Palm experts
that I know of. When I put my IIIc in its cradle today, the charging light
came on, and it was *amber* in color. I swear that this used to be *green*!
Am I losing my mind, or is the amber light telling me something? Any ideas?

  Doug Gordon
  GHCS Software

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



POSE, Gremlins, CW Debug

2000-07-10 Thread Gordon, Douglas

I am using POSE 3.0a4 with the debug ROMs and am trying to run Gremlins
under a CodeWarrior debug session so that I can halt and examine errors.
What is happening is that the Gremlins are detecting errors and putting some
information into the log file, but POSE does not put up any sort of dialog
box indicating the error. The current gremlin just quits after the error and
proceeds to the next one. So, my gremlin session ends fairly quickly and I
have no chance to break and examine the error conditions.

I am sure that this used to work way back when I last tested with the
gremlins, although that was an earlier version of POSE, etc. Any ideas how
to get this to work?

  Doug Gordon
  GHCS Software

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



Debug session with POSE gremlins

2000-07-10 Thread Gordon, Douglas

I am using POSE 3.0a4 with the debug ROMs and am trying to run Gremlins
under a CodeWarrior debug session so that I can halt and examine errors.
What is happening is that the Gremlins are detecting errors and putting some
information into the log file, but POSE does not put up any sort of dialog
box indicating the error. The current gremlin just quits after the error and
proceeds to the next one. So, my gremlin session ends fairly quickly and I
have no chance to break and examine the error conditions.

I am sure that this used to work way back when I last tested with the
gremlins, although that was an earlier version of POSE, etc. Any ideas how
to get this to work?

  Doug Gordon
  GHCS Software



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



Field Invalid insertion point

2000-07-10 Thread Gordon, Douglas

Can anyone tell me what type of common error I could be making to get a
field "invalid insertion point" error from the debug ROMs? This has only
shown up when running gremlins, but I have not been able to determine
exactly what is happening when the error occurs. It's apparently not a
serious situation, but I'd like to get rid of it anyway.

FWIW, the fields on the form are single-line editable text fields, but their
specified maximum length is probably longer than what the field will
actually display. Is this a potential problem?

  Doug Gordon
  GHCS Software

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



Re: Creator ID's for one App

2000-06-15 Thread Gordon, Douglas

I am new to the palmos development and I don't know if I can use 1
creatorID
for 1 app that uses more than one database, or if I should use a different
creatorID for each database?
I am developing an App that uses several modules, and each module uses it's
own database - You could call it App's in an App, but it is actual modules.

You would definitely use the same creator ID for your app and all databases.
Each module could then use a different database "type". The type is as
similar datum to the creator ID, being a 4-character value defined as a long
integer constant, e.g.:

   #define MY_DB_TYPE  'Mtyp'

You of course also have to define a unique name for each database. Since
database names must be globally unique, it is a frequent practice to make
your creator ID part of the name.

One reason for having everything with the same creator ID is that this is
how various other PalmOS features associate your app with your databases.
For example, when you delete an app from the launcher, it deletes ALL
databases that have that app's creator ID, which is what you generally would
want to do.

  Doug Gordon
  GHCS Software

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




Shortcut..4 info

2000-06-15 Thread Gordon, Douglas

When I do shortcut-tap-tap-4, it displays my Palm user name and a numeric
value below it. What is this value? If it is the ROM ID, then what is the
much longer string that is displayed as the "ID" when looking at version
info in the launcher, and where does it come from?

  Doug Gordon
  GHCS Software

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




Handling std edit menu

2000-06-12 Thread Gordon, Douglas

What is the method for handling the standard Edit Menu options (cut, paste,
undo, etc.)? In my app I have been handling them by specifically handling
the event code for each one, call FrmGetFocus, and then calling FldCut,
FldUndo, etc. Looking at the source code for the Memo Pad app, however, I
don't see any handling of these events even though they're obviously
supported. Did I miss something? Are there some default event IDs for these
options that the OS will handle if I return "false" in my own event handler?

  Doug Gordon
  GHCS Software

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




Extending preference structure

2000-06-08 Thread Gordon, Douglas

Sometimes I add a new preference option by just adding it to the end of the
structure so that when I read in the preferences, all the existing ones will
be in the correct locations. I also generally want the new fields to
initially be zero. So this is what I was doing:

t_PrefsSize = sizeof(W_PREFS);
MemSet(w_Prefs, sizeof(W_PREFS), 0);
s_PrefVer = PrefGetAppPreferences(GPID_CREATOR, 0, w_Prefs,
t_PrefsSize, true);

In a recent case, I added a new short int field to the structure. The
initial value of t_PrefsSize was 52; after the GetAppPreferences call the
first time after "upgrading" from the previous version, t_PrefsSize was now
set to 50, which was as expected. HOWEVER, the contents of the short int
field that had initially been zeroed by the MemSet call actually contained
garbage after the GetPreferences call. In other words, even though the
function knew that the current saved preferences were shorter than the size
that I passed in and it returned the actual current size, it actually wrote
to memory for the full extent of the passed-in size! This seems a bit
strange, to return a size of 50, but to actually have written 52 bytes.

I got around this behavior something like this:

t_PrefsSize = sizeof(W_PREFS);
s_PrefVer = PrefGetAppPreferences(GPID_CREATOR, 0, w_Prefs,
t_PrefsSize, true);
// Zero any new preference fields
if (t_PrefsSize  sizeof(W_PREFS)) {
MemSet(((char *) w_Prefs) + t_PrefsSize, sizeof(W_PREFS) -
t_PrefsSize, 0);

Kludgey IMO, but it works!

  Doug Gordon
  GHCS Software

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




Re: CodeWarrior Dead Code Optimizations

2000-06-06 Thread Gordon, Douglas

From: Mark Wilden [EMAIL PROTECTED]

but it doesn't sound like
rocket science to strip out resources whose IDs (the identifiers 
used in the .rcp) are only referenced by dead code.

In fact, it would be extremely difficult to do this. First off, Codewarrior
does not really "know" anything about how PalmOS works. If it generates a
resource symbol, say symbol LowMemAlert with an ID of 1020, to the compiler
this is simply a C preprocessor symbol assignment. I can call
FrmAlert(LowMemAlert) or FrmAlert(1020) with the same runtime result, but
the compiler has no idea what the "FrmAlert" function does or why I'm
passing a particular value. Does the appearance of the value 1020 anywhere
in the program mean that I am referring to the LowMemAlert resource? I don't
think so! Some people even assign their own symbols for resource IDs, so the
values can get lost pretty easily.

Basically, the compiler cannot look at a piece of code to determine what
symbols or values in the code have significance to another section of the
program. If you think about what is going on when you compile a program, you
should start to understand the point that I am trying to make. As someone
else stated, this is a class of problem in computer science that is related
to the famous "halting" problem -- it is truly intractable.

  Doug Gordon
  GHCS Software


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




Can digest size be controlled?

2000-05-31 Thread Gordon, Douglas

It is most convenient for me to get messages from this list in digest form.
However, these digests are sent only once a day and tend to be very large,
typically running 80-100 messages. The large size makes it a bit difficult
to take the time to go through it all. Most list management software has
some way of configuration so that it emits a digest after a certain number
of messages or a certain size in Kb. Is there a chance that the Palm
Developers list could be set up to send smaller digests 2-3 times a day
rather than one huge one?

  Doug Gordon
  GHCS Software



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




Re: format of a .pdb file

2000-05-30 Thread Gordon, Douglas

One thing to remember in creating a PDB file on an Intel-based PC is that
all multi-byte fields in both the PDB header as well as your own data
records must be byte-swapped. That is, any 16-bit or 32-bit integers must be
byte-swapped before writing them to the PDB file.

  Doug Gordon
  GHCS Software

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




Re: MemPtrNew function

2000-05-24 Thread Gordon, Douglas

You also have to ask what the content of outbuffer is. If it contains a
valid NUL-terminated string at the time of the call, then StrLen is what you
probably want to use. OTOH, if it is an "empty" buffer to be used later for
some purpose, then you probably want to use "sizeof(outbuffer)" to allocate
space for the whole thing (sizeof will return 1024 in this case).

  Doug Gordon
  GHCS Software


char  outbuffer[1024];


typedef struct
{
 char **name;
 int   *idx;
 int   total;
}AddrRecord;

addrList.name[addrList.total]=(char*)MemPtrNew(StrLen(outbuffer)+1);



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




Re: Sending large PDB files to the Palm

2000-05-23 Thread Gordon, Douglas


I have a large pdb file with over 15000 records that i need to send to the
palm

You may have better results if you can combine several records together,
both for sync time reasons as well as to save memory on the device, since
there's several bytes of overhead for each record.

Also, you should retest using Palm OS 3.5 on the devices, since the code
was enhanced to speed up the record creation process for precisely this
scenario.  The improvement is dramatic, I understand.

-David Fedor
Palm Developer Support

My app's record count depends on the user's original data file, but I have a
couple of customers with record counts approaching 20,000. One guy with a
new IIIxe (OS 3.5) reported that his database took only about 15 minutes to
download (about 19,000 records, 1.8Mb total size). Another person, who must
have been using a pre-3.5 device, reported over an hour to download
databases with about 14,000 records. I was wondering why the big difference
until I saw your post.

  Doug Gordon
  GHCS Software



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




Going to a memo record

2000-05-22 Thread Gordon, Douglas

My app has an option for exporting some information to a regular Palm memo,
i.e., I directly create a record in the MemoPad database. Now I'd like to
add an option for the user to be able to go directly to their new memo so
they can edit it or whatever. Is there a way to launch the MemoPad
application, specifying a record to be opened?

  Doug Gordon
  GHCS Software

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




FrmSetTitle FrmHideObject

2000-05-17 Thread Gordon, Douglas

In the description of FrmSetTitle the ref manual says that you can make sure
it displays properly by calling FrmHideObject and FrmShowObject after called
FrmSetTitle for a new title. What object index would I use in the HideObject
and ShowObject calls? Does the title have an object ID of some sort?

  Doug Gordon

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




FrmReturnToForm

2000-05-15 Thread Gordon, Douglas

It says in the reference manual that FrmReturnToForm does not generate a
frmCloseEvent "when called from a modal form's event handler". If I have a
field on the current form that has a text handle set by FldSetTextHandle,
will this handle be freed or not if I call FrmReturnToForm?

Also, what does the "when" clause in the manual mean exactly? Does the
system know that the function is being called from a modal form? How? The
form from which this will be called will be activated by FrmPopupForm. Does
this make it modal?

I guess what I'm looking for here is the technique to use to pop up my own
modal form with my own event handler (instead of using FrmDoDialog) and then
return cleanly to the original form with all resources properly cleaned up.
What is the sequence of Frm... calls?

  Doug Gordon

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




Numeric font has fixed pitch?

2000-05-10 Thread Gordon, Douglas

Although alphabetic characters in the standard Palm font are proportional in
width, it seems that the numerals are fixed pitch. This makes sense since a
column of numeric values looks pretty screwy if the digits don't line up
vertically. Does anyone happen to know offhand what the width of a digit is
in pixels?

  Doug Gordon

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




Re: Doubles are 8 bytes?

2000-05-02 Thread Gordon, Douglas

I did set the compiler to "not" use 8 byte doubles and 4 byte ints,
however,
it still is creating 8 byte doubles (but the ints are correct at 2 bytes).

This isn't surprising. The full meaning of "double" is "double precision
floating point". If a standard IEEE "float" is 32 bits, then a double must
be 32 bits or else it would be the same precision as a float. Of course,
the size of an "int" can be anything, and it is generally intended to be
CPU-dependent. That is, the size of an int is usually set to the bit size
that that the ALU of the target processor handles the most efficiently.
However, it is an easy setting to override, as we see on the Palm/CW
platform.

  Doug Gordon



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




Small fonts

2000-04-27 Thread Gordon, Douglas

I've seen a couple of Palm apps that use a font that is smaller than what's
standard in the OS. Does anyone know if a font like this is available
somewhere in a form that I could build it into my own app and use it?

  Doug Gordon
  GHCS Software

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Re: App runs ok but just once?

2000-04-24 Thread Gordon, Douglas

From: "Tim Trimble" [EMAIL PROTECTED]

I'm running into some strange behavior with my application.  For example,
the following code is quite standard.  However, the StrLen statement works
the first time, but the second time it is called for the same form field,
it
causes a "just read directly from an unallocated chunk of memory" error.

At first glance, it would seem that the problem isn't with the code that's
in this function, but rather with the "txtP" pointer that you're passing
into it. What are you passing? Is it possible that this is a chunk of memory
that's being deallocated before the 2nd time you call the function?

  Doug Gordon


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Re: PrefGetAppPreferences() question

2000-04-19 Thread Gordon, Douglas

The return value of PrefGetAppPreferences is the *preference version
number*, NOT the size! In your example, the variable "s" is where the size
will be stored after the call. The value 2 in "prefsSize" is correct since
you probably stored version 2 of your preferences.

I would point out, however, that this is not documented (as far as I can
see) in the latest copy of the reference manual that I have. It says that
the routine returns "noPreferenceFound" if there are no preferences, but it
does not say what value it returns when successful. Also, the word "return"
is used in more than one context, which confuses things a bit.

  Doug Gordon
  GHCS Software


From: "Marty Rice" [EMAIL PROTECTED]

I initially thought the same thing but this is more precisely what I'm
doing:

typedef struct { ... } v1_PreferenceType; // global, 142 bytes total
typedef struct { ... } v2_PreferenceType; // global, 228 bytes total

In AppStart()...

Word prefsSize, s=0;

prefsSize = PrefGetAppPreferences(CRID,APPPREFID,NULL,s,true);

StrIToA(str1,prefsSize);
StrIToA(str2,sizeof(v1_PreferenceType));
StrIToA(str3,sizeof(v2_PreferenceType));

The resulting display shows the three sizes to be 2, 142, and 228.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Re: Field Color

2000-04-17 Thread Gordon, Douglas

From: "Thomas Ward" [EMAIL PROTECTED]

I've been playing around with adding some color to my apps. I found how to
use WinSetTextColor for when I use WinDrawChars. I also expected to find a
function called FldSetColor (or something similar), but it doesn't exist.
How do you set the color of a field?

It turns out that this is not easy to do, if it can be done at all. If
PalmOS had been designed for color from the outset, they would probably have
added f/g and b/g colors as control attributes. However, to keep backward
compatibility with older versions, they did not add these features to 3.5.
As you've discovered, the only reliable way to draw text in color is to draw
it yourself, such as in a table drawing callback routine. I tried for quite
a while to make calls to various UI  color-setting routines to try to
force/trick PalmOS to draw a particular field in the colors that I wanted,
but without success. For standard controls, it apparently can't be done
cleanly -- you'll have to do your own drawing where you want non-default
colors.

  Doug Gordon


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Graffiti recognition on IIIc

2000-03-31 Thread Gordon, Douglas

I got my IIIc thru the devel program yesterday and so far it is a MAJOR
disappointment. Mainly, it is impossible to use graffiti on it. Screen taps
also have to be done much more forcefully than on my IIIx, but the graffiti
situation right now makes it pretty much useless.

Bringing up the graffiti learning app, I can see that it just plain misses
much of my strokes if I make them even slightly fast. A good circle is seen
as a very squashed oval as though it missed a whole section of the curve and
interpolated it as a straight line instead. I do the stroke for an "F" and
it completely misses the vertical part. Only by bearing down and doing it
VERY slowly can I get it to work. I have turned off all hacks, etc., just in
case they're part of the problem.

I have heard of this problem on newsgroups, so first thing today I'm calling
Palm and doing an exchange on the unit (tech support did not seem at all
surprised by my complaint). However, I'm wondering how much of this is
specific to certain units (perhaps a QC issue) and how much is inherent in
the IIIc design. The Palm IIIc CPU is still very slow compared to most color
WinCE units -- I wonder if there just isn't enough horsepower to do
digitizer sampling at a high enough rate, etc. If the replacement unit still
has problems like this, I'm going to be asking for a refund.

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Bitmap compression

2000-03-30 Thread Gordon, Douglas

I notice that Constructor has compression settings available for bitmaps.
Can these be used in all PalmOS versions (2.0 and up), and is compression
very useful for the typical small bitmaps such as those used on the new
command bar (16x13)?

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Setting baud rate on Palm

2000-03-22 Thread Gordon, Douglas

Is there any way to change the serial port and/or IR baud rate on a Palm
IIIx? I was able to make a PPP direct serial connection with my NT 4.0 PC
(Mocha PPP support on PC), but only if I set Mocha to listen at 57600 which
is apparently the PalmOS 3.3 default. Is there any way to change this on the
Palm?

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




Getting screen shot of shortcut bar

2000-03-22 Thread Gordon, Douglas

To get a screen shot in POSE of my app with its really cool shortcut bar
icons showing :-), I use the mouse to swipe the shortcut stroke, and then
have to right-click on POSE and select "Save screen" from the popup menu.
Unfortunately, the shortcut bar times out rather quickly and usually
disappears before I can get to the menu item. Is there an easier way to do
this? My best workaround is probably to get my teenage son to do it since he
can click things faster than I can follow along :-).

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html




3.5 gotcha

2000-03-15 Thread Gordon, Douglas

I've been making mods to my app using POSE with the 3.5 ROMs for a while.
After being "sure" that my updates were working, I loaded the app on my
personal IIIx and was greeted with a fatal exception error when I ran it.
What the hey??

It turns out that I added a new table and made use of the functions
TblSetItemInt, TblSetItemPtr, TblGetItemInt, and TblGetItemPtr. Guess what?
The first three have been around since 2.0, but the last one was just added
in 3.5. Fortunately, the ref manual does give a workaround by direct use of
the table pointer. Sometimes it pays to RTFM!

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



Using Exchange Mgr ExgDBWrite, etc.

2000-03-15 Thread Gordon, Douglas

Does anyone have an example of beaming a database using ExgDBRead and
ExgDBWrite? These functions look fairly straightforward, but I don't see
exactly how the transfer is set up in the first place. Is ExgDBRead simply
called in response to the sysAppLaunchCmdExgReceiveData launch code?

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



Deleting databases inside GetNextDatabase loop

2000-03-08 Thread Gordon, Douglas

When my app starts up, I scan for all my databases using a
DmGetNextDatabaseByTypeCreator loop specifying my creator ID and a type code
of zero. While building my list of databases, I also look for obsolete
database types or old version databases that could be present on the Palm
when the user upgrades the app to the newest version. I have to delete these
old databases, or else the user has no way to get rid of them unless they
"hack around" with DB Explorer or some other special tool (in fact, they
would be unaware that the old DBs even exist even though they are sitting
there taking up space).

In any case, I was originally doing this by putting a DmDeleteDatabase call
inside the while-loop where I call DmGetNextDatabase. What I found was that
this caused the database lookup routine to work incorrectly, and not all the
existing databases were being returned. I noticed this when I got my "Old
databases deleted" alert two times in a row when running my app, when it
should only come up once no matter how many old databases exist.

Anyway, I fixed this by saving the card  ID of obsolete databases in an
array while I'm inside the GetNext loop. Afterwords, another loop goes
through the array and deletes the old databases. This now works correctly.

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



Things I've learned about Constructor bitmap families

2000-03-08 Thread Gordon, Douglas

I'm pretty sure that I'm the only one who finds Constructor's UI to be
unnecessarily arcane ;-), but here is my experience on some points about
using bitmap families:

- When you set the bitmap size in the family spec panel, all your
bitmaps must be of that size. However, you must set each bitmap's size
individually when you edit it. It took me a while to find out how to do this
-- it's on the Options menu while you have the bitmap open for edit.

- Family members must be assigned in ascending bit-depth order. You
don't need one for each depth, as the OS will select the one that is = the
device depth.

- The ID of the bitmap family must be unique with respect to the IDs
of all individual bitmaps. This is not obvious when using Constructor, but
the app will fail to load into POSE if there is a duplicate resource ID.

Having learned these details, I was able to successfully create a bitmap
family for a command bar button that now looks really good on a color Palm
and also displays in bw on one of those old, dark-ages monochrome devices.

BTW, does anyone else find it irritating that Constructor does not save the
path to the most recently opened project like every other known Windows app
does? Every time I start it up, I have to browse down my directory tree to
get to the same resource file for my project. This seems like a really
simple feature to include. After all, the IDE supports it!

  Doug Gordon

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



RE: frmUpdateEvent and OS 3.5

2000-03-07 Thread Gordon, Douglas

Thanks for the tip. What I just noticed is that this is only happening when
using the debug ROMs. I guess the 3.5 debug ROMs always assume the "worst
case" and actually do NOT save the screen behind the popup. The misbehavior
in my app has probably always been there, but it has never actually been
seen since a low-memory condition is usually very rare.

  Doug Gordon

-Original Message-
From: Jean Ostrem [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 07, 2000 3:16 PM
To: [EMAIL PROTECTED]
Subject: Fwd: frmUpdateEvent and OS 3.5


I have a form where, in addition to standard controls, I draw a couple of
lines when the form is initialized. This worked OK up to 3.3. On 3.5 I
notice that whenever a dialog pops up over my form (even system-controlled
alerts, etc.), when the dialog is removed my form is restored except for
the
drawn lines. I checked, and in the event handler for frmUpdateEvent I do
call my function that draws the lines.

Putting in a breakpoint while using POSE, I find that when I get the
frmUpdateEvent, the entire Palm screen is blank (even the part not
previously covered by the dialog). My line-drawing routine is then called
and the lines are drawn on the screen. However, when I continue and return
from the event handler, my previous screen contents now appear, but minus
the lines that I just drew.

Anyone have any idea what is going on here, and how I can get it to work
correctly?


If you don't set handled to true for frmUpdateForm, the default form 
handler handles the event by calling FrmDrawForm, which erases what 
you've just drawn. You need to call FrmDrawForm, then draw your 
lines, then set handled to true.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



Re: CW: Cannot remove Breakpoint

2000-03-06 Thread Gordon, Douglas

From: Steve Mann [EMAIL PROTECTED]

Since I have installed the new OS3.5 SDK that was just posted 
yesterday I cannot remove a breakpoint when I am debugging. I set my 
breakpoint, run my program, the debugger breaks and then I click on 
the breakpoint to remove it and I get the error "Unknown error code: 
0x021c"

I've been getting this ever since going to the 3.5 SDK. Actually, it seems
that it does remove the breakpoint, but the red dot remains in the listing
window. I haven't found a way around this problem, and it happens very
consistently.

  Doug Gordon



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html



Re: Palm OS bug found

2000-03-02 Thread Gordon, Douglas

This leads me to believe that there is some code in the Table.c file 
that is buggy in that it assumes that the size of the tableItemStyles 
enum is a byte always instead of an int if the project setting is set.

Can you force an enum to be a certain size in the definition?  e.g.:

enum Uint8 tableItemStyles { checkboxTableItem,
customTableItem,
...
};

Thoughts?
Dan Hewins
Synergy Solutions, Inc.

This certainly doesn't seem like a PalmOS bug. Basically, you can't redefine
a data type to be different from what that data type was defined as when
they built PalmOS itself! In other words, if PalmOS was compiled assuming
that "enums" are always bytes, then any enum that you pass into PalmOS had
better be only a byte or else unpredicatable things are going to happen.
Using project settings that are different in this respect from the PalmOS
"standard" are going to get you into trouble.

Actually, I don't think that an O/S API should use these types of somewhat
"abstract" language constructions at all, since they can be highly compiler
dependent. This issue of what the width of an "enum" is is a typical
problem, especially since it can be redefined in a "project settings" dialog
instead of being forced in a header or something.

  Doug Gordon


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html