🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: sourecode in BCB6 showing how to use WMI in WinXP

#5561
From: Luke Andy
Date: Mon, 08 Aug 2005 09:49
34 lines
2120 bytes
> You might try converting the code at this link:
>  http://www.vbip.com/wininet/wininet_connection_01.asp
>
> WMI is huge.  It would difficult to create the kind of simple code one 
> wants in an example yet exercise a decent percentage of it.  You would 
> probably be best served by getting a book that deals with WMI.
>
> .  Ed
>

Thank you for the link. I also found the following very short VB6 code, but 
it seems to be that it is not that simple to convert it to C++ for BCB6.


Private Sub Timer1_Timer()
    Set nicset =
GetObject("winmgmts:{impersonationLevel=impersonate}!root/wmi").InstancesOf("MSNdis_80211_ReceivedSignalStrength")
    On Error GoTo no80211Error
    For Each nic In nicset
        SignalStrengthValue = Right(nic.Ndis80211ReceivedSignalStrength, 
Len(nic.Ndis80211ReceivedSignalStrength) - 1)
        If SignalStrengthValue <> "" Then
            SendText ("S=NetSignalStrength~" & SignalStrengthValue)
        End If
        Exit For
    Next
    nicset = Nothing
    Exit Sub

no80211Error:
    SendToConsole "No 802.11 network adapters found"
    Timer1.Enabled = False
End Sub
Technical Details
Message-ID: <42f72a8f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42f63ae8$1@newsgroups.borland.com> <42f6504f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,eef40730daa9a1f6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Luke Andy" <landy@umail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42f63ae8$1@newsgroups.borland.com> <42f6504f$1@newsgroups.borland.com>
Subject: Re: sourecode in BCB6 showing how to use WMI in WinXP
Date: Mon, 8 Aug 2005 19:49:16 +1000
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 220.239.18.90
Message-ID: <42f72a8f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1123494543 220.239.18.90 (8 Aug 2005 02:49:03 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail