Hi Mike,

You just need to supply to right prefix and exchange mgr handles the rest
magically for you. I have a routine defined as below, I then simply call it
with either SendMe( exgBeamPrefix ) for beaming, or SendMe( exgSendPrefix )
for Sending (currently SMS and BT). The rest of the code is from the Beamer
example (from memory).

static Err SendMe( Char * prefix )
{
 Err err;
 MemHandle nameH;
 MemPtr nameP;
 LocalID dbID;

 // Append the prefix to the name
 if ( StrLen( prefix ) )
 {
  nameH = MemHandleNew( StrLen( prefix ) + StrLen( NAMEOFPRCFILE ) +
sizeOf7BitChar( '\0' ) );
  nameP = MemHandleLock( nameH );
  if (nameP)
  {
   StrCopy( nameP, prefix );
   StrCat( nameP, NAMEOFPRCFILE  );
  }
 }

 // Find our app using its internal name
 dbID = DmFindDatabase( 0, NAMEOFDATABASE );
 if (dbID)    // send it giving external name and description
 {
  err = SendDatabase( 0, dbID, nameP, NAMEOFAPPLICATION );
 }
 else
  err = DmGetLastErr();

 if ( nameP )
  MemHandleFree( nameH );

 return err;
}

static Err WriteDBData( const void* dataP, UInt32* sizeP, void* userDataP )
{
 Err   err;

 // Try to send as many bytes as were requested by the caller
 *sizeP = ExgSend((ExgSocketPtr)userDataP, (void*)dataP, *sizeP, &err);

 return err;
}

static Err SendDatabase( UInt16 cardNo, LocalID dbID, Char *nameP, Char
*descriptionP )
{
 ExgSocketType  exgSocket;
 Err     err;

 // Create exgSocket structure
 MemSet( &exgSocket, sizeof(exgSocket), 0 );
 exgSocket.description = descriptionP;
 exgSocket.name = nameP;

 // Start and exchange put operation
 err = ExgPut( &exgSocket );
 if (!err)
 {
  // This function converts a palm database into its external (public)
  // format. The first parameter is a callback that will be passed parts of
  // the database to send or write.
  err = ExgDBWrite( WriteDBData, &exgSocket, NULL, dbID, cardNo );
  // Disconnect Exg and pass error
  err = ExgDisconnect( &exgSocket, err );
 }
 return err;
}



Cheers,
Gavin.


Mike McCollister <[EMAIL PROTECTED]> wrote in message
news:100350@;palm-dev-forum...
>
> I've figured out how to beam my application, but how do I send it via SMS
or
> bluetooth.  My beaming code is based heavily on the code from the Palm OS
> knowledge library at:
>
>
http://kb.palmsource.com/cgi-bin/palmsource.cfg/php/enduser/std_adp.php?p_si
d=RjRgSHtg&p_lva=&p_faqid=24&p_created=1032287797&p_sp=cF9zcmNoPTEmcF9ncmlkc
29ydD0mcF9yb3dfY250PTE2MSZwX3NlYXJjaF90ZXh0PUhvdyB0byBiZWFtIGFuIGFwcGxpY2F0a
W9uJnBfc2VhcmNoX3R5cGU9MyZwX3Byb2RfbHZsMT1_YW55fiZwX2NhdF9sdmwxPX5hbnl_JnBfc
29ydF9ieT1kZmx0JnBfcGFnZT0x&p_li=
>
> I'm assuming that the code should be very similar.
>
> Thanks,
>
> Mike
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
>



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

Reply via email to