Re: [newbie] frmOpenEvent

2004-04-04 Thread Albert J. Franklin
Stephane,

Try putting the alert inside the case statement.  All events will arrive at
the switch statement.

FrmAlert();// where you said you put the statement
switch(var)
{
   case 1:
   ...
   break;
   case 2:
   FrmAlert();// where I would put the statement
   ...
   break;
}

Al
- Original Message - 
From: Stephane Pinel [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Sunday, April 04, 2004 2:14 PM
Subject: Re: [newbie] frmOpenEvent



Le 4 avr. 04, à 20:04, SLO Revo News a écrit :

 FrmAlert(DebugAlert); is not executed. I know that
 CustomersHandleEvent is really called, but it seems that
 frmOpenEvent doesn't fire.

 How do you know that CustomersHandleEvent is really called?

because I've put a FrmAlert(DebugAlert); just before the switch
statement and it fired. Once I put it in the frmOpenEvent case,
nothing happens...

Thanks for your kind help.

Stéphane


-- 
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: Structure initialisation

2004-03-28 Thread Albert J. Franklin
Joe,

   One way to set all bytes of a structure to zero is to use
MemSet (void *changeThis, UInt32 numberOfBytes, Byte value)
(reference Palm OS Programming Bible 2nd Edition, Lonnon R. Foster)
as in

struct xStruct { ... };
MemSet (xStruct, sizeof(xStruct), 0);

Al
- Original Message - 
From: Keith Rollin [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Saturday, March 27, 2004 9:45 PM
Subject: RE: Structure initialisation


Joe,

This is a generic C programming question.  It is not specific to Palm OS or
its development tools, so you should probably post questions like this in a
how to program in C forum.

In short, static structs (that is, those created as global variables or as
statics local to a function) have their fields initialized to zero when the
application starts.  Automatic structs (that is, those created as local
variables) or structs allocated with malloc or MemPtrNew will have garbage
in their fields.  It is up to you to initialize them to appropriate values
after you've allocated the memory for them.

There is no supported method for determining if a pointer type contains a
valid or invalid value.

-- Keith


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of joe
bloggs
Sent: Saturday, March 27, 2004 6:37 PM
To: Palm Developer Forum
Subject: Structure initialisation


Hello Forum,

When a structure is created, does anyone know if it's
elements are initialised? e.g. initegers set to 0 and
pointers/references set to NULL.

The reason I am asking is that my error handling code
deallocates memory by checking if mem pointers are not
NULL.  If structure elements are initialised, I can
check to see if memory has been allocated as follows:

if (someStruct.memPointer)
...

If structure elements are not initialised, can anyone
recommend a way to determine if a pointer is pointing
to allocated memory (instead of just garbage).

-- 
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: Running apps ontop of another app

2004-01-23 Thread Albert J. Franklin
York,

One way is to use a database to hold the field's text data between
application invocations.  Some of the more experienced programmer's may know
of a way to use a locked memory chunk to accomplish the same thing.  To my
understanding, the two applications do not share any process space, so some
external memory must provide persistent storage between the two
applications.

Al
- Original Message - 
From: York Kie Tan [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, January 23, 2004 7:42 PM
Subject: Running apps ontop of another app


 Hi, I'm currently trying to write an application that runs ontop of
 another application. It will read all the text in the active text field of
 the previous application, does some processing (or even prompt a dialog to
 get user input) and then replaces the text on the text field (of the
 previous application) if necessary. The behaviour is like some of the
spell
 checkers available on the market that is activated via hard-button
presses.

 I need help on how to read text from a text field of the previous active
 application and how to write text back to the field before my application
 quits. Any pointers will be very much appreciated. Thank you

 Regards,
 York Kie

 _
 Download ringtones, logos and picture messages from MSN Malaysia
 http://www.msn.com.my/mobile/ringtones/default.asp


 -- 
 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: Software Protection - opcode counting

2004-01-22 Thread Albert J. Franklin
This reminds me of a problem in Quantum Mechanics: it is impossible to
measure something because the act of measuring it changes it.  This is why
beaming ala Star Trek is not possible, and the show had a Maxwell whatever
to account for that.

Anyway, you could provide a small database with the predetermined values for
comparison.  Then there is nothing to hardwire that would affect the value
you want to hardwire.

Al
- Original Message - 
From: James Zatorski [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 2:56 PM
Subject: Re: Software Protection - opcode counting


  The only methods I can come up with are based upon
  multiple final compilations.  The first to get the
  expected values and the second (with the expected
  values embedded within the code) to actually
  distribute.

 I forgot to mention the additional step of loading the
 first compilation onto an actual device so that the
 device can calculate the results.

 JiMZ

 -- 
 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: Fonts Metrowerks CW Constructor uses for WYSIWYG

2004-01-18 Thread Albert J. Franklin
 VFDIDE (http://www.vfdide.com) lets you specify the fonts and gives true
 WYSIWYG form editing.  You compile to PILRC resource .RCP file.

 Al

I bought Falch.net Developer Studio on sale for $49.00.  As I use it, I am
becoming more aware of how easy it is to use.  For instance, if I get a
fatal error dialog because the form variable I thought persisted did not, I
just say Debug-Stop and I am back in the editor.  But to the point: its
editor also is WYSIWYG respective to the choice of font.  And another nice
feature, it will read a .RCP file (generated by VFDIDE, in my case).

Al



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


Re: Fonts Metrowerks CW Constructor uses for WYSIWYG

2004-01-18 Thread Albert J. Franklin

 Is that alive again ? I heard it had gone the way of the dodo

Unfortunately, I believe that falch.net is no longer operational.  The web
site has been up and down, but seems to have been up recently.

Version 2.7.2 Professional is being sold on the www.falch.net site through
Visage e-services.  The product is no longer supported.

As a non-commercial Palm developer, unable to justify the price-ier software
development systems, I find it a very good IDE for $49.00.

Al



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


Re: Fonts Metrowerks CW Constructor uses for WYSIWYG

2004-01-17 Thread Albert J. Franklin
VFDIDE (http://www.vfdide.com) lets you specify the fonts and gives true
WYSIWYG form editing.  You compile to PILRC resource .RCP file.

Al

- Original Message - 
From: Ben Combee [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 9:14 PM
Subject: Re: Fonts Metrowerks CW Constructor uses for WYSIWYG


 At 05:18 PM 1/10/2004, Konstantin Klyatskin wrote:
 Is there any way to customize or change fonts used by Constructor in its
 WYSIWYG environment?

 Not that I know.

 Are there any WYSIWYG reource editor allowing to use customized PalmOS
 fonts?

 This feature isn't in PilRC Designer.  I don't know if other editors let
 you do this.

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


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




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


Re: Code Warrior vs DeveloperStudio

2004-01-08 Thread Albert J. Franklin
Teddy,

   The last cost of DevelopStudio was $229.00 before this sale.  I believe
this sale is due to the demise of the company.  I bought the software myself
over Christmas vacation when the offer first appeared (for two days; this is
the first time I've seen the site back up since then).  I considered it a
great value for the price.

   I am not a serious Palm developer, in that I am working on one project
(porting it from NSBasic), on a schedule of July 3-4 and Dec 28-31.  I had a
tough time getting the software; I do not know if this problem still exists.
The software itself is extensive, but not bulletproof.  I have had crashes,
and some wierd behaviors.  I do not regret the purchase, though.

   Since I am not making any money from my hobby, I cannot justify buying
CodeWarrior (I do not qualify for the educator price).  Aside Some
development systems have very reasonable, i.e., low or no, purchase prices
for personal use, requiring full purchase when becoming commercial.  I would
respond to an offer like that just to experience CW.  /Aside  I would
assume that CodeWarrior is a mature product.

   Developer Studio binds the PRC-Tools into a cohesive package, including
an effortless install.  CW is a different compiler.

   Hope this helps, even though I can not really answer your questions.  You
have to weigh your budget and expectations against your planned usage for
the development system.

Al

- Original Message - 
From: Teddy Law [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 11:00 AM
Subject: Code Warrior vs DeveloperStudio


 Dear experts,

 Which development tool is better amongst Code Warrior vs DeveloperStudio ?
 According to the website of Falch.net, DeveloperStudio costs US$49.00
only,
 while Code Warrior costs US$399.00 ?
 Do anyone know why the cost difference between them so big ?
 Do the expensive one better ?

 Rgds.
 Teddy Law



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


Re: how to draw the slope text ?

2003-12-25 Thread Albert J. Franklin
Ken,

   I think that what Aaron means is that the every pixel in the offscreen
window buffer is rotated before being overlayed on the original window
display.  What you are doing is calculating one point, and using that as the
source of the a WinDrawChars (hence, new origin, but no rotation).

Al

- Original Message - 
From: KEN [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, December 26, 2003 1:09 AM
Subject: Re: how to draw the slope text ?



 Aaron Ardiri [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED]
 ???...
sorry, that should have read:
   
 *_x = ( cos(angle) * x) + (sin(angle) * y);
 *_y = (-sin(angle) * x) + (cos(angle) * y);
   
new co-ordinates = value based on old co-ordinates
  
   the orginial XY system changes to the new X'Y' system, however, if I
 draw
   the texts, they should appear as horizontal no matter as XY or X'Y'
 system,
   so how can I display the texts with slope in the orginial XY system?
 
  simple:
 
  step #1
  - draw text to *normal* buffer, using WinDrawChars()
 
  step #2
  - apply rotation of the *normal* buffer, using rotation matrix
 
  step #3
  - copy (using invert/overlay) the rotated buffer to the display
 

 step #2 is the process I don't understand

 if using these 2 formulae:
 *_x = ( cos(angle) * x) + (sin(angle) * y);
 *_y = (-sin(angle) * x) + (cos(angle) * y);
 only the coordinates will be changed
 e.g., if x=0, y=50, angle=90 degrees, then *_x = 50, *_y =0

 then, just for demonstration, below code segment only draw the rotated
 text abc to a different position but not sloping it, thats what I don't
 understand
 ---
  WinHandle  originalWindow, offscreenWindow;
  UInt16  err;
  RectangleType r;

  offscreenWindow = WinCreateOffscreenWindow(160,160,genericFormat, err);
  originalWindow = WinSetDrawWindow(offscreenWindow);

  WinDrawChars(abc,StrLen(abc),0,50);   //original x,y position at
(0,50)
  WinDrawChars(abc,StrLen(abc),50,0);   //new *_x , *_y position at
 (50,0)

  WinGetBounds(offscreenWindow, r);
  WinCopyRectangle(offscreenWindow, originalWindow, r, 0, 0, winOverlay);
  WinSetDrawWindow(originalWindow);
 ---

 so how does the rotation achieve?


  thats about all the help i'll give you - you can figure out the
  rest :) also, you might also want to consider doing something
  like the following screen shots (works nice, and, doesn't require much)
 
  http://www.ardiri.com/palm/citikey/map3.gif
  http://www.ardiri.com/palm/citikey/map4.gif

 It is very nice, in fact I am working sth very similar to it.


 
  damn.. that code is so old *g* - long were the days of hacking
  grayscale on old 16Mhz devices *g*
 
  ---
  Aaron Ardiri
  [EMAIL PROTECTED]
  http://www.mobilewizardry.com/members/aaron_ardiri.php [profile]
 



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




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


Re: a Treo 600 Simulator mystery

2003-12-24 Thread Albert J. Franklin
Paul,

   In my experience, problems like this can be caused by writing to memory
more bytes than allocated/expected.  Adding the junk (including compiling
for debug) seems to move the instruction/argument that gets stomped, so that
your code, though modified, is not modified in a fatal manner.   Without
some memory management analyzer, you will have to inspect your code for such
a mismatch.

Al

- Original Message - 
From: Paul Nevai [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 10:43 AM
Subject: a Treo 600 Simulator mystery


 This is the oddest thing I ever seen.

 I use the Treo 600 simulator and am running a somewhat elaborate function
 which works perfectly in every possible hardware, emulator, and simulator
 known to mankind [well, I didn't test all] except on the Treo 600
simulator
 just before I do an FrmDrawForm() job, it gives the message

 I:\Ripple\ARM\Core\Emul68K\SrcSlowEmu\Run68K.c
 Line:2299, Null access read from 

 BUT, here comes the juicy part. If I add the code

 {
 RectangleType rT;
 RctSetRectangle (rT,0,0,0,0);RctSetRectangle (rT,0,0,0,0);
 RctSetRectangle (rT,0,0,0,0);RctSetRectangle (rT,0,0,0,0);
 }

 just before FrmDrawForm() then it works OK. If I add one less
 RctSetRectangle() job, then the crash comes.

 Can any of you shed light to it please? I am very curious to see what you
can
 come up with.

 Thanks, PaulN [pedit etc.]

 P.S. How did I find out that the RctSetRectangle() job does a fix?  By
pure
 accident. As a matter of fact, it seems that I could do other fixes too as
 long as enough junk is added right before FrmDrawForm().

 -- 
 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: Telling if POSE running with debug ROM [Was: Migrating color indexes between screen depths]

2003-11-28 Thread Albert J. Franklin
I can't find the message, but I believe that Keith Rollin addressed these
issues in a prior message in this forum.  Include this forum in your search.
Maybe Keith can respond again with the answers.

Al

- Original Message - 
From: John Marshall [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, November 28, 2003 10:17 AM
Subject: Re: Telling if POSE running with debug ROM [Was: Migrating color
indexes between screen depths]


 Luc Le Blanc [EMAIL PROTECTED] wrote:
  How can I detect I'm running under POSE,

 Well, I'm sure you know how to do that, or where to look in the Poser
 documentation or the archives to find out (e.g. type detect into the
 search box at escribe's emulator-forum archive).

  and with a debug ROM?

 Look at sysFtrNumErrorCheckLevel in Core/System/SystemMgr.h.  Hopefully
 it's set right on the ROMs you're interested in.

 John

 -- 
 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: Writing an XML file from an application

2003-11-06 Thread Albert J. Franklin
RK,

   errP is a pointer; apparently it is pointing to location 0x42.  Try Err
error (to allocate space on the stack for the error return) and pass error
in the FileOpen call.

Al
- Original Message - 
From: Rudra [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 8:38 PM
Subject: Re: Writing an XML file from an application


 Hi,
 What is the error in the following lines of code?

 FileHand out;
 Err *errP;

 out = FileOpen(0, MyInfo.xml, 0, 0 ,
 fileModeReadWrite | fileModeDontOverwrite, errP);

 I am geting the following error.

 MyApp just wrote to memory location 0X0042, which
 is in low memory.

 Thanks,
 RK

 --- kcorey [EMAIL PROTECTED] wrote:
  On Thu, 2003-11-06 at 17:25, Rudra wrote:
   I want to store some information from a palm
   application in XML format. Is it possible to write
  out
   information from an application as an XML file?
   This XML file will then be read by an application
   running on a desktop.
   I have not found much information on files for
  Palm
   OS.
 
  You can write whatever content you want to a file on
  a memory card (SD
  or Memory stick) with the VFS* functions and then
  move the memory stick
  to a card reader that would allow programs on the PC
  to read the file.
 
  There's no built-in support for XML in the
  system...you'll have to roll
  your own, or use one of the pre-built libraries
  that're out there.
  Search the archives for more info on that.
 
  -Ken
 
 
  -- 
  For information on using the Palm Developer Forums,
  or to unsubscribe, please see
 http://www.palmos.com/dev/support/forums/


 __
 Do you Yahoo!?
 Protect your identity with Yahoo! Mail AddressGuard
 http://antispam.yahoo.com/whatsnewfree

 -- 
 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: Treeview in Palm-OS???

2003-11-01 Thread Albert J. Franklin
Harry,

   There is sample treeview code on the VFDIDE (http://www.vfdide.com) site.

Al
- Original Message - 
From: Harry Schuster [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, October 31, 2003 11:58 AM
Subject: Treeview in Palm-OS???


 Hi all,
 how can i use a tree-view or a tree-control in PALM OS?
 Is it possible or must i develop a tree-view for myself?

 Thx for answering

 Bye
 Harry

 -- 
 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: How do I remove scroll buttons?

2003-10-15 Thread Albert J. Franklin
Jim,

   The only answer I've seen in other posts is to set the size of the list
to the number displayed (so that the automatic buttons are not displayed),
and to emulate your own scrolling by redrawing the list with the appropriate
entries.  Hope this is enough information for you to try this out.

Al
- Original Message - 
From: James Zatorski [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, October 15, 2003 5:11 AM
Subject: How do I remove scroll buttons?


 I have a dynamic list that grows too long to fit on one screen.  Once this
happens, I would like to have my own buttons using symbol7Font drawn in the
footer area defined for scrolling the list.  I've got this part working,
but the OS also draws scroll buttons (symbolFont 34) right on the list.

 Is there a way I can tell the OS not to draw thebuilt-in scroll buttons?

 JiMZ
 -- 
 __
 Sign-up for your own personalized E-mail at Mail.com
 http://www.mail.com/?sr=signup

 CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
 http://corp.mail.com/careers


 -- 
 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: Easier way in creating pdb file

2003-10-12 Thread Albert J. Franklin
Mark

   A quick google search for PDBMake leads to the PDBMake site that has a
download link.

Al
- Original Message - 
From: Brian [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Saturday, October 11, 2003 8:20 AM
Subject: Re: Easier way in creating pdb file


 Thanx guys, i'll look into it.

 P.S. Excuse me shushil, where can this PDBMake application be located?

 Best Regards,
 Brian

 Mark Cameron wrote:

 E-camm (www.ecamm.com) also has a cross-platform tool, the Palmfile
Toolkit.
 Haven't tried it yet, but their other tools are great.
 
 -Mark
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of David
 Williams
 Sent: Friday, October 10, 2003 10:15 PM
 To: Palm Developer Forum
 Cc: [EMAIL PROTECTED]
 Subject: Re: Easier way in creating pdb file
 
 
 On Fri, 10 Oct 2003 8:00 pm, Brian wrote:
 
 
 Good Day,
 
Has anyone know of a software that can create a pdb file on a fly.
 before it will be sync to a PDA?
 or better yet a source code( if anybody has). ;-)
 
 
 
 Please try par:
 
 http://djw.org/product/palm/par/index.html
 
 Executables, library to use in your program, source code.
 
 djw
 
 
 



 -- 
 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: ClipboardGetItem and StrNCopy

2003-09-19 Thread Albert J. Franklin
John,

   Went to the URL of the second message, and observed this response:
Message 2812 does not exist in palm-dev-forum.  This does not pass as a
good read. ;)

Al

P.S. If you still have a copy of your more recent response, please consider
responding with that here.


- Original Message - 
From: John Marshall [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, September 19, 2003 10:00 AM
Subject: Re: ClipboardGetItem and StrNCopy


 Jan Slodicka wrote:
  I thought that a check for cmdptr!=NULL was redundant as cmdptr is
obtained
  from a non-NULL handle.

 You're right of course -- I was thinking of checking hCmd != NULL, which
 you are indeed doing.  Sorry, it was a late night last night!

  (The string on the clipboard was non-empty.)

 I would have thought you would get access past end of chunk in that
 case rather than low-memory access, but yeah, any way you slice it
 the current StrNCopy is not going to work in that case either.  So my
 suggestion wasn't very helpful -- sorry.  My analysis three years ago
 was better; maybe I had slept the night before I posted it :-).

  Strange - I searched the forum for ClipboardGetItem string before
posting,
  but did not receive the links you list bellow.

 The more recent one (which is a good read, if I say so myself :-)) was
 on emulator-forum.

 John

 -- 
 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/delete problem in PALM OS

2003-08-22 Thread Albert J. Franklin
Just to clarify what Jeremy is saying:  the i++ produces a side effect.  For
example, when i == 1, then execution of the statement x[i++] = y[i++] sets
x[1] == y[2], and i ==3; or x[2] == y[1], and i ==3; depending on which side
of the equation the compiler executes i++ first.  Your best bet is: x[i] =
y[i]; i++;.

Al
- Original Message - 
From: Jeremy Neal Kelly [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 11:41 AM
Subject: Re: new/delete problem in PALM OS


 Alucard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 
  Just like to ask who has encountered this new/delete problem in PALM
  OS? i tried to implement one using the codewarrior..  with this given
  value : Char* y = babc/b n.\n;
  wherein i first allocate a storage
  e.g. Char* x = new Char[256];
 int i = 0;
  then started storing characters
  e.g. x[i++] = y[i++];
 
  during this storing characters i've encountered garbages also being
stored
 
  then lastly i deallocated
  e.g. delete[] x;
  during deallocation also, it does not free the allocated memory wherein
  in fact this call is within a function call.

 Hmmm... You're copying like this, right?

   x[i++] = y[i++]

 Are you seeing 'garbage' at every other character? How many times per copy
 are you incrementing that index counter?

 I don't really understand what you wrote about the deallocation problem,
but
 let me ask: how do you know it's not being deallocated?

 Jeremy Neal Kelly
 Software Engineer
 Peapod




 -- 
 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: Recording problem

2003-08-14 Thread Albert J. Franklin
Sean,

   I am puzzled by your response.  The variable len is defined in a block,
and then the variable length is defined in a block within the scope of the
block where len is defined.  By the rules of C, len should still contain the
value of (MemHandleSize(registroH)).  I don't understand why defining length
in the outer scope as you recommend will cause the value of len to not be
lost.

Al
- Original Message - 
From: Sean Yang [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Monday, August 11, 2003 4:12 AM
Subject: Re: Recording problem


 Int16 length=len --- here is error,
 because the len is a dynamic variable, not a const variable.
 You should define the length at the start of function.
 e.g:
 Err GrabaNuevoItem(void)
 {
 Int16 length;
...
 }

 Best regards!

 Sean Yang
 Aug.11.2003

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

DmWite(s,offsetof(OrderReg,cantitems),item.cantitems,sizeof(item.cantitems)
 );
 

DmWrite(s,offsetof(OrderReg,items[gcantitems-1].cantidad),item.items-canti
 dad,sizeof(item.items-cantidad));
 

DmWrite(s,offsetof(OrderReg,items[gcantitems-1].precio),item.items-precio,
 sizeof(item.items-precio));
 

DmStrCopy(s,offsetof(OrderReg,items[gcantitems-1].codigo),item.items[gcantit
 ems-1].codigo);
  }
   DmReleaseRecord(PedidosDB, Indice, true);
  }
   return error;
  }
 
  Allways say Handle null, the index it's all right.
  if delete the second DmGetRecord the handle point to nobody location
  Please helpme!
 
 
 
 



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




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


Re: Link Error : PalmRez Error:

2003-08-10 Thread Albert J. Franklin
Ed,

   Just a guess, but could the English version be interpreting the (2-byte)
Unicode wide characters as (double the length) single byte characters?

Al
- Original Message - 
From: Edward P. Ross [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Saturday, August 09, 2003 10:06 PM
Subject: Link Error : PalmRez Error:


 When compiling an application I am getting the following error:

 Link Error   : PalmRez Error: Menu 1000 'S«?Ý'è' item
 'fNf?fCfAffg?Efvf?ftfB?[f' is wider than the screen.

 Link Error   : PalmRez Error: Total: 6 errors encountered. Compilation
halted

 This is a japanese language application compiled on an English version of
 WIndows.  I have done this so many times in teh past, most recently last
week.

 If I open the RSRC file on a Japanese PC the resource looks fine.  Then I
copy
 the RSRC and .h file over to the English PC to compile and I get these
errors.
 The lengths of the menus aren't too long I know that for sure.

 I am wondering if there is somethign I can do to alleviate this one.

 Any help would be greatly appreciated.

 Thanks...
 Ed




 --
 Acrocat Software, L.L.C.
 Do you workout?  Get Results.  Get PDAbs.
 http://www.Acrocat.com/PDAbs



 -- 
 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: poptriggers, lists..

2003-06-19 Thread Albert J. Franklin
Henrik,

Try setting handled to true in the popSelectEvent code.  This will
effectively remove the event from the event queue, and prevent your popup
label from being overwritten by the selected item.

Al.
- Original Message - 
From: Henrik Fredriksson [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, June 18, 2003 7:15 AM
Subject: poptriggers, lists..


 Hi

 I am having some problems (as usuall). I have a list and a poptrigger, the
 thing is that in the list I want to display more charachters for the
 selections/items than what will be shown on the trigger once I select an
 item, I want to truncate the selected item to lets say 10 characters. If I
 connect the trigger and the list (by setting the list ID for the trigger
in
 Constructor) and try to call CtlSetLabel when I receive popSelectEvent the
 text I put myself gets overwritten. The other solution is not to connect
 them, but then I must handle all events myself for selecting, updating,
and
 pressing outside the list. This seems to much work, can't I override what
 happens by default when a list and a trigger is connected? Or is there
 another solution that I havn't though about?

 /Henrik



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


Re: Change taext of a button

2003-06-11 Thread Albert J. Franklin
Archivator,

   First, get the object's index from the object's ID (assigned during IDE
construction).
   UInt16 objectIndex = FrmGetObjectIndex(FrmGetActiveForm(), objectID);

   Then get the object pointer from the object's index.
   ControlType *ctl = FrmGetObjectPtr(FrmGetActiveForm(), objectIndex);

   Now you are able to set the label:
   CtlSetLabel (ctl, New Label);

   I am constantly referring to
Palm OS Programming Bible by Lennon R. Foster
   for syntax and usage.

   I refer to
Palm OS Programming (The Developers Guide) by Neil Rhodes and Julie McKeehan
from Oreilly
   for the best way to put all the pieces together.

Al

- Original Message - 
From: Archivator [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 7:35 AM
Subject: Change taext of a button


 Hi,

  I need to change text of button.
 Maybe someone know how to make it.
 I gues function is
 void CtlSetLabel (ControlType *controlP, const Char *newLabel)
 i have a problem of making a pointer to ControlType *controlP :)


 Thanks.



 -- 
 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: PRC Tools

2003-06-05 Thread Albert J. Franklin
An IDE that is easy on the wallet is VFDIDE (http://www.vfdide.com).  There
are three levels of support: Visual Form Development (VFD), VFD plus Code
Development (CD), and VFD-CD plus source level debugging.

Al
- Original Message - 
From: Dan Patrutiu [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 7:21 AM
Subject: PRC Tools


 Hello all, I downloaded and installed PRC Tools and the latest SDK,
but
 .. what now? I need a free IDE (for the moment) to use with. Where can I
 find such an IDE?

 Dan Patrutiu




 -- 
 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: FrmAlert and vchrHard Keys

2003-06-03 Thread Albert J. Franklin
Scott,

   As I understand it from discussions on the NSBasic/Palm forum, the
FrmAlert has its own event handler, and your event handler is not involved.
Two suggestions are to forgo using alerts, or roll your own MyFrmAlert
method where you provide the event handler (where MyFrmAlert is a modeless
dialog box that looks like FrmAlert).  I do not know if there are any other
ways to solve this problem.

Al
- Original Message - 
From: Scott Heffron [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Monday, June 02, 2003 5:27 PM
Subject: FrmAlert and vchrHard Keys


 I have written an application that needs to bypasses the system workings
of
 the 4 hardware buttons.  I have code in the AppEventLoop of the
application
 to check if these buttons are pressed in the application.  The code works
 for all windows, except the alerts when using the FrmAlert function.  Has
 anyone experienced this and could tell me how to bypass the events from
 going to the system handle when an alert window is opened up.




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


Re: Where are defined the character (codes/modifiers) tables ?

2003-05-31 Thread Albert J. Franklin
I am sure that I do not fully appreciate your question.  However, the code
for backspace is defined in (for me)
C:\PalmDev\sdk\include\Core\System\Chars.h.  Using a grep-like capability,
there are a lot of include files that can be searched for the strings you
are looking for.

Al
- Original Message - 
From: Raison Mikhael [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 3:14 PM
Subject: Where are defined the character (codes/modifiers) tables ?



 SysEvtMgr.h defines :

 Err EvtEnqueueKey(WChar ascii, UInt16 keycode, UInt16 modifiers)
   SYS_TRAP(sysTrapEvtEnqueueKey);

 where the args are :

 WChar  asciiCode; // ascii code for key event
 UInt16 keyCode; // virtual key code for key event
 UInt16 modifiers; // modifiers for key event

 - Does s.o. know where these codes/modifiers are defined?

 - The asciiCode are 'a', ... '\n', '\t', '\r' ...  Where can I find the
code
 for the backspace for example?

 thanks.

 _
 MSN Messenger : discutez en direct avec vos amis !
 http://messenger.fr.msn.be


 -- 
 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: FrmHideObject not consistent?

2003-05-31 Thread Albert J. Franklin
You can make a field look and act like a label by setting no underline and
not editable.  There is no box around the text this way.

Al
- Original Message - 
From: Don Heitzmann [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Saturday, May 31, 2003 12:33 AM
Subject: Re: FrmHideObject not consistent?


 As followup to this thread:  I tried tnn's suggestion, and it worked the
 same as FrmHideObject.  When I looked at the rectangle returned by
 WinGetObjectBounds, it was too short -- it only covered about 2/3 of the
 actual label string that was displayed.  This is probably why
FrmHideObject
 doesn't work -- it's using the same, incorrect, bounds.

 I also tried this with different fonts in the label, thinking that maybe
the
 bold font I was using was throwing off the calculation of field size.  But
 there was no difference depending on the font.

 My circumvention is to use a selector trigger instead of a label.  It
looks
 the same, except for the box it draws around the text... I disable it so
 don't get any events.  But I sure wonder what's wrong with those same
 functions applied against a label.  It's even more mysterious because
there
 are two different labels on the same form; both are created with the same
 PiLRC syntax, and the same code (literally the same functions) are applied
 to each.  One works correctly, the other does not.

 Is there a knowledgebase somewhere of known bugs and fixes in various
 releases of PalmOS?  I didn't see such a database on the Palm site.
 -don

 Don Heitzmann [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  Hi, Thanks! I'll use your model and I believe that you've solved my
 problem.
  And no, it is my fault for being imprecise in my language, but I'm not
  trying to do this with a Field but rather with a Label... I guess I
  sometimes think of everthing on a form as a field, but I know that in
  Palm-speak, that's wrong... Thanks again.
  -don
 
  ThuNguyet Nguyen [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  
   Hi Don,
  
I apply the same code to yet another label object on the form, and
for
  some
reason, the FrmHideObject only clears a portion of the label field,
  leaving
garbage (the old string) in roughly the last half.  It's as if the
WinEraseRectangle that (I'm guessing) is done inside FrmHideObject
  doesn't
see the entire length of the field.
   
   I did use FrmHideObject() when I wanted to change the text in the
label
  but I don't use it
   anymore, I read something about it  I had the same problem as you
have.
  So, now, I use
  
   // some code to make sure that labelText is shorter than
   // the original string in the label (or cut it)
   // ...
 FrmGetObjectBounds(frmP,objIndex, r);
 WinEraseRectangle(r, 0);
 FrmCopyLabel(frmP,objID,labelText);
  
   This code works every time for me (different OS version)
  
I'd do the WinEraseRectangle, but how do I know the
real, current, area of the field?
   
   When you mention field, I don't know if you still talk about label
or
  you also talk about text
   field. I use SetTextField(), GetTextField(), FreeTextField() to
 manipulate
  text fields. These
   functions are mentioned a lot in Palm books, in this forum and I can
 send
  you my code if you want.
  
   HTH,
  
   tnn
  
  
   __
   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/



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


Use of DmQueryRecord function

2003-05-29 Thread Albert J. Franklin
I have searched through books, Palm Knowledge Base, and this forum for
DmQueryRecord.  They all say the same thing:
Get handle, get pointer with MemHandleLock, *Use the database data*, and
then MemHandleUnlock.

My code:

static Err ReadDealStateFromDB()
{
   Err err = errNone;
   MemHandle recordHandle;
   UInt16 index = gameState.LastDealRecord;   // Always record 1 until
implement Undo/Redo
   struct DealState *dState;

   recordHandle = DmQueryRecord(gameDB, index);
   if (! recordHandle)
  err = DmGetLastErr();
   else
   {
  dState = (struct DealState *)MemHandleLock(recordHandle);
  MemMove(dealState, dState, sizeof(dealState));
  MemHandleUnlock(recordHandle);
   }
   ErrFatalDisplayIf(err != errNone, Can't read deal state from database);
   return err;
}

where my *Use the database data* is to MemMove from the database to my
global structure variable.

I have similar code to successfully write and read a global structure
gameState variable at index 0.  However, my dealState structure is totally
bogus (there are no runtime errors, i.e., err is errNone).

Using VFDIDE, configured per the www.vfdide.com site.
prc-tools-2.0, cygwin-b20.1-full, SDK 4.0 Update 1.

What am I doing wrong?  Am I misunderstanding the use of index as the record
number?

Thanks,
Al



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


Re: Use of DmQueryRecord function

2003-05-29 Thread Albert J. Franklin
Jeff,

   Thanks for the idea to check after the write.  My problem was that I had
removed code in the write state routines that had used DmGetRecord if there
was already a record in the database at my index (and DmNewRecord if there
was not).  I incorrectly interpreted the description of DmNewRecord to put
the record at the specified index to mean OVERWRITE the record at the
specified index.  So what was happening was that the record at index zero
kept getting pushed to index one when I thought I was overwriting the record
at index zero.  Your suggestion to use unsigned char * exposed that, since
my first field is a string, and I recognized the value.

   I now get the number of records in the database, and use DmGetRecord (to
overwrite an existing record) or DmNewRecord (to create the first record at
the index).  This is working fine, even with the struct DealState * cast.

Al
- Original Message - 
From: Jeff Ishaq [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 11:15 AM
Subject: Re: Use of DmQueryRecord function


 At 09:46 AM 5/28/2003 -0400, you wrote:
 static Err ReadDealStateFromDB()
 {
 Err err = errNone;
 MemHandle recordHandle;
 UInt16 index = gameState.LastDealRecord;   // Always record 1 until
 implement Undo/Redo
 struct DealState *dState;
 
 recordHandle = DmQueryRecord(gameDB, index);
 if (! recordHandle)
err = DmGetLastErr();
 else
 {
dState = (struct DealState *)MemHandleLock(recordHandle);
MemMove(dealState, dState, sizeof(dealState));
MemHandleUnlock(recordHandle);
 }
 ErrFatalDisplayIf(err != errNone, Can't read deal state from
database);
 return err;
 }
 
 I have similar code to successfully write and read a global structure
 gameState variable at index 0.  However, my dealState structure is
totally
 bogus (there are no runtime errors, i.e., err is errNone).

 Your code looks fine to me.  I would suspect that something is going wrong
 when you try to WRITE record 1.

 I would put some test code in IMMEDIATELY after you've written record 1
and
 committed it back to the database with DmReleaseRecord()... e.g., do the
 same DmQueryRecord() / MemHandleLock() that you have posted here, and use
 your debugger to view the memory of the resulting pointer -- is it being
 written as expected?

 Sometimes it's best to cast the locked handle to a unsigned char *, rather
 than a structure type *, to isolate the problem and minimize outside
errors.

 -Jeff Ishaq


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