🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Trying to use a variant type for API/WMI access

#14640
From: Vladimir Afanasyev
Date: Tue, 05 Aug 2003 14:39
24 lines
1769 bytes
"Vladimir Afanasyev" <avv@systema.kiev.ua> wrote:
>
>
>//////Just main part
>    BSTR IP=SysAllocString(L"192.168.1.10");
>    //create a one-dimensional Variant array
>    Variant IPAddress=Variant(&Variant(IP),0);
>
>    BSTR MASK=SysAllocString(L"255.255.255.0");
>    Variant NetMask=Variant(&Variant(MASK),0);
>
>int Result=(Variant(NetAdapter.pdispVal)).OleFunction<Variant,Variant>("EnableStatic",IPAddress,NetMask);
>
>    if(Result)ShowMessage("EnableStatic error = "+ IntToStr(Result));
>     else  ShowMessage("EnableStatic executed successfully");


and here:
SysFreeString(IP);
SysFreeString(MASK);

now seems all good..
Vladimir.
Technical Details
Message-ID: <3f2fc1a1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f2bfc2f$1@newsgroups.borland.com> <3f2fc011$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bc37caa35c7396c7
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-05 07:40:50 PST
From: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Subject: Re: Trying to use a variant type for API/WMI access
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 212.82.216.226 212.82.216.226    
X-Forwarded-For: 192.168.0.147
References:  <3f2bfc2f$1@newsgroups.borland.com> <3f2fc011$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3f2fc1a1$1@newsgroups.borland.com>
Date: 5 Aug 2003 07:39:29 -0700
X-Trace: newsgroups.borland.com 1060094369 207.105.83.65 (5 Aug 2003 07:39:29 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail