🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12890

Re: LAN Connection Status

#12890
From: CSR
Date: Wed, 12 Nov 2003 14:13
48 lines
2197 bytes
Thanks a lot vERUs

Carsten R.

"vERUs" <-verus-@telia.com> skrev i en meddelelse
news:3fafba2a@newsgroups.borland.com...
> You'll need to add the iphlpapi.lib to your project.
>
> #include <iphlpapi.h>
>
>
>      PMIB_IFTABLE IFTable;
>      MIB_IFROW MibRow;
>      ULONG Sz = 0;
>
>      DWORD Result = GetIfTable(NULL, &Sz, false);
>      IFTable = (PMIB_IFTABLE)GlobalAlloc(GPTR, Sz);
>
>      Result = GetIfTable(IFTable, &Sz, true);
>
>      if (Result == NO_ERROR)
>      {
>         for (unsigned int i = 0; i < IFTable->dwNumEntries; i++)
>         {
>            MibRow = IFTable->table[i];
>
>            if (MibRow.dwType != MIB_IF_TYPE_LOOPBACK && MibRow.dwType !=
> MIB_IF_TYPE_OTHER)
>            {
>               // Read whatever value you want from the MIB_IFROW structure
>            }
>         }
>
>         // Avallokera minne
>         GlobalFree((HGLOBAL)IFTable);
>      }
>
>
> For a description of MIB_IFROW:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rras/m
> ib_ifrow.asp
>
> // vERUs
>
>
>
>
Technical Details
Message-ID: <3fb24011$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed.freenet.de!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3faaa223$1@newsgroups.borland.com> <3faac95e$1@newsgroups.borland.com> <3fabf8ce$1@newsgroups.borland.com> <3fafba2a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f495dab9d8b0e06e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-12 06:27:40 PST
From: "CSR" <carstenr@mail.tdcadsl.dk>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3faaa223$1@newsgroups.borland.com> <3faac95e$1@newsgroups.borland.com> <3fabf8ce$1@newsgroups.borland.com> <3fafba2a@newsgroups.borland.com>
Subject: Re: LAN Connection Status
Date: Wed, 12 Nov 2003 15:13:34 +0100
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 80.164.95.73
Message-ID: <3fb24011$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1068646417 80.164.95.73 (12 Nov 2003 06:13:37 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed.freenet.de!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail