Hi Leonardo,
Yes, I've been using this code for a _very_ long time.  If you want your changes to be 
saved, you will need to call NetLibConfigSaveAs so that the interface will be 
initialized and attached to the stack the next time the net library is opened.  I'm 
assuming that you are checking for errors, etc?

-Jon

--------------------------------------------
Jonathan Hays
Palm OS Certified Developer
http://hazelware.luggle.com
--------------------------------------------

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Leonardo
Santagada
Sent: Tuesday, April 27, 2004 9:00 AM
To: Palm Developer Forum
Subject: Re: Changing Network Settings


Hays, Jonathan (GE Infrastructure) wrote:

> Short answer:
> Use NetLibIFSettingSet() with netIFSettingUsername to set the user name and 
> netIFSettingPassword to set the password.
> 
> Long answer (with error checking code removed):
> UInt16 ifInstance = 0;
> UInt32 ifCreator;
> UInt16 currnetIFInstance;
>       
> UInt16 i = 0;
> err = NetLibIFGet(netLibRef,i,&ifCreator,&currnetIFInstance);
> while (err == errNone && ifInstance == 0)
> {
>       if (ifCreator == netIFCreatorPPP)
>               ifInstance= currnetIFInstance;
>       i++;            
>       err = NetLibIFGet(netLibRef,i,&ifCreator,&currnetIFInstance);           
> }
> 
> err = NetLibIFSettingSet(netLibRef,netIFCreatorPPP,ifInstance,netIFSettingUsername, 
> (void*)pszUserName, StrLen(pszUserName)+1);
> err = NetLibIFSettingSet(netLibRef,netIFCreatorPPP,ifInstance,netIFSettingPassword, 
> (void*)pszPassword, StrLen(pszPassword)+1);
> 
> -Jon

Have you ever tested this code? does it work? because I did something 
quite like it and after did a NetLibIFSettingGet and it didn't return 
the settings I had set. Instead it didn't return anything at all, not 
even changed the size of the return value like it is documented.



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

Reply via email to