🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#14781
From: Maurice Anderson
Date: Sat, 02 Aug 2003 19:56
56 lines
2739 bytes
> Bob Gonder wrote:
> Look carefully at that:
> MS:   string IPAddress[]
> You:  String IPAddress1[2]

Answer - I believe the "s" is the equivalent of "S" in BCB for a string data
type, so as far as I know, there is no difference.

> I would also think that  IPAddress1[1] should be emptied.
Answer - Why?? In either case, I shouldn't get the compiler error.

> Example: "192.168.12.1 192.168.46.1"
Are you saying the code should read like this:
  ret_code =  (Variant(NetAdapter)).Exec(Function("EnableStatic") <<
       "192.168.12.1 192.168.46.1", "255.255.255.0 255.255.255.0");

-M-



"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:d94oiv8f5kkthiai47n7jtd6kv0rdueinq@4ax.com...
> Maurice Anderson wrote:
>
> >  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);
>
> Look carefully at that:
> MS:   string IPAddress[]
> You:  String IPAddress1[2]
>
> Is a "S"tring a "s"tring?
> I would also think that  IPAddress1[1] should be emptied.
> I submit for your contemplation (from MS)
>
> DefaultIPGateway
> Data type: string array
> Access type: Read-only
>
> Array of IP addresses of default gateways that the computer system
> uses.
>
> Example: "192.168.12.1 192.168.46.1"
>
> Note that this is just a char array with a space between values.
>
>
>
Technical Details
Message-ID: <3f2c16a5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f2bfc2f$1@newsgroups.borland.com> <d94oiv8f5kkthiai47n7jtd6kv0rdueinq@4ax.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-02 12:56:37 PST
From: "Maurice Anderson" <mauriceanderson@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f2bfc2f$1@newsgroups.borland.com> <d94oiv8f5kkthiai47n7jtd6kv0rdueinq@4ax.com>
Subject: Re: Trying to use a variant type for API/WMI access
Date: Sat, 2 Aug 2003 12:56:03 -0700
Lines: 58
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: <3f2c16a5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059853989 64.30.203.223 (2 Aug 2003 12:53:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail