Like I said, I stripped this down from some more complex code, so you
may have to play with it a bit. What is probably happening is that
NetLibIFGet() is returning another kind of error than the two expected.
Check for netErrUnknownSetting, which means you're done, and
netErrPrefNotFound, which means the instance hasn't sufficient info. Any
other error is probably telling you NetLib isn't happy, which means you
don't have a newtwork.
For instance...
err = NetLibIFGet(libRefNum,index,&creator,&instance);
if (err == netErrInvalidInterface || (err != errNone && err !=
netErrPrefNotFound))
return false;
On 3/19/07, Luca Bertoncello <[EMAIL PROTECTED]> wrote:
>
> "Jeff Loucks" <[EMAIL PROTECTED]> schrieb:
>
> > Ooops, forgot to increment index. I did too quick a job extracting the
> > example from my code. The point is to start index at 0 and increment
> until
> > NetLib tells me it's too big.
>
> I tough it...
> So is right?
>
> Boolean IsAnyNetworkUp(UInt16 libRefNum)
> {
> UInt16 instance,size,index = 0;
> UInt32 creator;
> UInt8 value;
> Err err;
>
> while(1)
> {
> err = NetLibIFGet(libRefNum,index,&creator,&instance);
> if (err == netErrInvalidInterface)
> return false;
> if (err == errNone && creator != netIFCreatorLoop)
> {
> size = sizeof(value);
>
> if(NetLibIFSettingGet(libRefNum,creator,instance,netIFSettingUp,&value,&size)
> == errNone && value != 0) return true;
> }
> index++;
> }
> }
>
> But it does not work anyway...
> I call the function and it does not return a value...
>
> Any idea?
>
> Thanks
> Luca Bertoncello
> ([EMAIL PROTECTED])
>
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
>
--
[Jeff Loucks]
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/