Err PSyncInfo::SetName(Char *name)
{
        DlkUserInfoPtr          infoP=0;
        DmOpenRef                       dbP;
        MemHandle                       resH=0;
        Err                                     err=0;

        dbP = PrefOpenPreferenceDB(false);
        if (!dbP  ||
                 (resH = DmGet1Resource(sysResTSysPref, sysResIDDlkUserInfo)) == 0 ||
                 (infoP = (DlkUserInfoPtr)MemHandleLock( resH )) == 0) {
                 err = 1;
        } else {
                if (!PDatabase::ChangeString(resH,infoP,infoP->nameAndLog,name)) {
                        UInt8 nameLen = infoP->header.userNameLen + StrLen(name);
                        DmWrite(infoP,&infoP->header.userNameLen-(unsigned char 
*)infoP,
&nameLen,1);
                        StrCopy(m_name,infoP->nameAndLog);
                        MemPtrUnlock(infoP);
                } else {
                        err = 1;
                }
        }
        if (resH) DmReleaseResource(resH);
        if (dbP) DmCloseDatabase(dbP);
        return err;
}

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Nesse,
> Rustin
> Sent: Tuesday, May 16, 2000 11:45 AM
> To: Palm Developer Forum
> Subject: RE: Changing the User Name on a device
>
>
> Anyone know if there's a programmatical way of changing a user name?
> There really isn't a DlkSetSyncInfo function in the DLServer header...just
> curious. (I develop vertical POS apps, and I can think of situations
> where you want to assign a user name to a unit, and keep the user from
> changing it around.)
> //* Rus Daniel Nesse
> >-----Original Message-----
> >From: Foley, Mason [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, May 16, 2000 11:33 AM
> >To: Palm Developer Forum
> >Subject: RE: Changing the User Name on a device
> >
> >
> >That doesn't seem to work for me...
> >
> >Mason W. Foley
> >QA Engineer | Afaria
> >Xcellenet, Inc.
> >770-804-8400
> >http://www.xcellenet.com
> >
> >Software engineer turned mechanic...
> >
> >"I couldn't fix your brakes...so I made your horn louder."
> >
> >
> >
> >-----Original Message-----
> >From: Tim Astle [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, May 16, 2000 1:15 PM
> >To: Palm Developer Forum
> >Subject: Re: Changing the User Name on a device
> >
> >
> >I know this reply may be a bit late, but doesn't "shortcut .
> >5" allow this
> >to take place.
> >
> >If I recall correctly, it should erase the user's name and
> >random number.
> >The next hot sync you have, the device appears to be a
> >never-before-synced
> >device.
> >
> >Regards,
> >
> >Tim Astle
> >
> >
> >
> >
> >--
> >For information on using the Palm Developer Forums, or to unsubscribe,
> >please see http://www.palmos.com/dev/tech/support/forums/
> >
> >--
> >For information on using the Palm Developer Forums, or to
> >unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
> >
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
>


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