🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#14780
From: Bob Gonder
Date: Sat, 02 Aug 2003 19:40
31 lines
1918 bytes
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: <d94oiv8f5kkthiai47n7jtd6kv0rdueinq@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f2bfc2f$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-02 12:48:03 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Trying to use a variant type for API/WMI access
Date: Sat, 02 Aug 2003 12:40:37 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <d94oiv8f5kkthiai47n7jtd6kv0rdueinq@4ax.com>
References: <3f2bfc2f$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.165.71
X-Trace: newsgroups.borland.com 1059853235 67.31.165.71 (2 Aug 2003 12:40:35 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail