🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Trying to use a variant type for API/WMI access

#14779
From: Maurice Anderson
Date: Sat, 02 Aug 2003 18:03
29 lines
2176 bytes
Hello, I got a hold of some sample BCB code using the Wmi classes.  In the
example, the method argument is passes as a simple string:

    ret_code =(Variant(NetAdapter)).Exec(Function("SetDNSDomain")  <<
"borland.com");

Here is the method as deifned in MSDN:   uint32 SetDNSDomain(  string
DNSDomain);

Now I am trying to do something similar with the EnableStatic Wmi method.
EnableStatic is within the same class as SetDNSDomain.  The problem is that
this funtion takes two arguments.  Both are String arrays.

  Here is the function defintion from MSDN for the method: uint32
EnableStatic(  string IPAddress[],  string SubnetMask[]);

Here is my code that doesn't work:

 String IPAddress1[2], SubnetMask1[2];
 IPAddress1 [0] = "169.164.146.81";
 SubnetMask1[0] = "255.255.255.192";
 ret_code =  (Variant(NetAdapter)).Exec(Function("EnableStatic") <<
*IPAddress1, *SubnetMask1);

How would I properly pass the contents of IPAddress1 and SubnetMask1 to the
function?
In the previous example that works just what exactly is the guy doing?
If I were to define a function to pass these two arguments (instead of
defining them locally), how would I declare them as arguments?
Technical Details
Message-ID: <3f2bfc2f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bc37caa35c7396c7,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-02 11:04:06 PST
From: "Maurice Anderson" <mauriceanderson@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Trying to use a variant type for API/WMI access
Date: Sat, 2 Aug 2003 11:03:09 -0700
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 64.30.203.223
Message-ID: <3f2bfc2f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059847215 64.30.203.223 (2 Aug 2003 11:00:15 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail