Iain Barclay wrote:
> 
> Anyone know if its possible to programmatically launch Avantgo with a URL
> and get it to go and fetch the page?
> Can't find information about this anywhere on their site...
> 
> If Avantgo can't do this, can anything else?
> 
> Thanks,
> Iain

Iain,

Here's some code:


#define AVANTGO_CREATOR_ID              'AvGo'

static void my_run_app(A_THANG *me)
{
  DmSearchStateType stateInfo;
  UInt              cardNo;
  LocalID           dbID;

  if (   !DmGetNextDatabaseByTypeCreator(true, &stateInfo,
sysFileTApplication,
                                         me->creator_id_to_run, true,
&cardNo, &dbID
                                        )
      && dbID
     ) {
    Ptr cmd;

    cmd = (Ptr) NULL;
    if (me->creator_id_to_run == AVANTGO_CREATOR_ID) {
      my_lock_my_resource(me, &me->url_res);
      if (me->p) {
        UInt        len;
        UInt16      sz;
        UInt32      uid;

        len = StrLen((const Char *) me->p) + 1;
        sz  = sizeof(sz) + sizeof(uid) + len + 1;
        uid = 0;
        cmd = MemPtrNew(sz);
        if (cmd) {
          MemMove(cmd,                                      &sz,  
sizeof(sz));
          MemMove((Byte *) cmd + sizeof(sz),                &uid, 
sizeof(uid));
          MemMove((Byte *) cmd + sizeof(sz) + sizeof(uid),  me->p, len);
          MemMove((Byte *) cmd + sz - 1,                    "",    1);
          MemPtrSetOwner(cmd, 0);        /* protect the memory thru the
transfer to the app */
          }
        my_unlock_my_resource(me);
        }
      }

    SysUIAppSwitch(cardNo, dbID, 0, cmd);
    }
}



Alex Robinson
alex @ SPAMLESS tranzoa.com
-eom-

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

Reply via email to