--- R�gis Daniel de Oliveira <[EMAIL PROTECTED]> wrote:
> 
> Can anybody show me how can I make the FrmCustomResponseAlert work?

Sure.

> I've declared it but, when  my app run, i got a message that that 
> isn't a valid chunck address. I looked at the palm sdk for 
> MemHandleNew and MemHandleLock, but it not worked well.
> ...
> char Text;
> 
> FrmCustomResponseAlert (FrmAlert, "Regis", NULL,
> NULL, Text, 10, NULL)
> 

I got this question personally and already answered it, but in case
there is anybody else with the same question, here is the short version
of the answer:

1. "FrmAlert" is the name of a Palm OS function.  The first parameter
to FrmCustomResponseAlert should be the id of an alert in your project.

2. FrmCustomAlert (and probably also FrmCustomResponseAlert) won't work
properly if you pass NULL for any of the replacement parameters.  Pass
in " " (a string with a single blank) instead.  (Your alert does have
^1, ^2, and ^3 in the message somewhere, doesn't it?)

3. You have to allocate space for Text because FrmCustomResponseAlert
uses that buffer to hold the string the user types into the dialog. 
Try this:

  Char Text[10];
  FrmCustomResponseAlert( AlertID, "What is", "your", "name?", 
    Text, 10, NULL );

Or, if you really like to type, use this:

  Char *Text; 
  Text = MemPtrNew( 10 );
  FrmCustomResponseAlert( AlertID, "What is", "your", "name?", 
    Text, 10, NULL );
  MemPtrFree( Text );

Or, if you are getting paid for every line of code you write, use this:

  Char *Text;
  MemHandle mh;
  mh = MemHandleNew( 10 );
  Text = MemHandleLock( mh );
  FrmCustomResponseAlert( AlertID, "What is", "your", "name?", 
    Text, 10, NULL );
  MemHandleUnlock( mh );
  MemHandleFree( Text );

(All untested code.  I assume that if you are getting paid for each
LOC, you can test it yourself. :) )

4. The last parameter to FrmCustomResponseAlert should be the name of a
callback function that is called when the user taps a button on the
dialog.  This function should return true if the dialog can close,
false otherwise.  If you don't use a callback, there isn't much point
to using FrmCustomResponseAlert.
 

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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

Reply via email to