Re: AddIpAddress

From: Arkady Frenkel (arkadyf_at_hotmailxdotxcom)
Date: 12/22/04


Date: Wed, 22 Dec 2004 11:53:01 +0200

Maybe ask on vb forums about parameter definitions for AddIpAddress
Arkady

"Ignacio" <Ignacio@discussions.microsoft.com> wrote in message
news:58BA32E3-EDB8-403F-AF55-1C9E03B5D2DC@microsoft.com...
>
> "Eugene Gershnik" wrote:
>
> > Ignacio wrote:
> > > Hi:
> > >
> > > I try to use the api function AddIpAddress in VB.net, the definition
> > > is:
> > >
> > > DWORD AddIPAddress(
> > > IPAddr Address,
> > > IPMask IpMask,
> > > DWORD IfIndex,
> > > PULONG NTEContext,
> > > PULONG NTEInstance
> > > );
> > >
> > >
> > > I declare this function in VB.net
> > >
> > > Declare Function AddIPAddress Lib "Iphlpapi" (ByVal Address As
> > > UInt64,
> >
> > Should be UInt32
> >
> > > ByRef IpMask As UInt64,
> >
> > Same here
> >
> > > ByRef IfIndex As Integer,
> >
> > And same here
> >
> > > ByVal
> > > NTEContext As IntPtr, ByVal NTEInstance As IntPtr) As Integer
> >
>
> When I change the parameters address, ipmask and if index to uint 32, I
nedd
> change the function inet_addr to return uint32, but when i realized this
> changes the call to AddIpAddres return the error 87 again.
>
>
> > What I don't understand is why you bother with all this. You are on .NET
so
> > you can write a small DLL in managed C++ that will perfrom this call
without
> > all the mess and expose the result in .NET friendly way.
>
> I try to make a NT service, this service realize a get to a web server, if
> the get, failure, this service add a new ip address in one interface. what
do
> you thing is the best form to do it?
>
> >
> > --
> > Eugene
> >
>
> Thanks.



Relevant Pages

  • Re: Setting IPV6 address
    ... The AddIPAddress function adds the specified IP address to the specified ... IPMask IpMask, ... IP address to add to the adapter. ... >> What is the function available for this in Windows SDK? ...
    (microsoft.public.win32.programmer.networks)
  • Re: AddIpAddress
    ... "Eugene Gershnik" wrote: ... >> I try to use the api function AddIpAddress in VB.net, ... >> DWORD AddIPAddress( ... >> IPMask IpMask, ...
    (microsoft.public.win32.programmer.networks)