473,585 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using iphlpapi.lib

How would you use iphlpapi.lib (from the platform sdk) from a c# app? I can
use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k. If
need to wrap in c++ dll, please poing to example. Also, would you need to
distribute lib seperatly with you app, or would it compile "into" one c++
dll? TIA!

--
William Stacey, MVP

Nov 15 '05 #1
7 6922
William,

Iphlpapi.dll is listed as being on W2K3 server, XP, and 2000 (server and
professional). You should have no problem declaring the methods in C# and
making the calls through the P/Invoke layer. What APIs are you having
trouble with specifically?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:OG******** ******@TK2MSFTN GP12.phx.gbl...
How would you use iphlpapi.lib (from the platform sdk) from a c# app? I can use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k. If
need to wrap in c++ dll, please poing to example. Also, would you need to
distribute lib seperatly with you app, or would it compile "into" one c++
dll? TIA!

--
William Stacey, MVP

Nov 15 '05 #2
That is what is says, I agree. However, that is not how it works AFAICT, so
I think it is a doco error. The ICMP echo and I think the GetParms work on
xp and w3k, but not w2k (get some kind of entry point error that fails hard
on w2k machine.) The doco also refers to the "lib" version and not the
"dll" version. I don't use c++, so not sure what the lib is here and how to
call. I think the w2k version dll, does not have all the same entry points
(i.e. APIs).
Thanks Nicholas. Any other help would be great.

--
William Stacey, MVP

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:u2******** ******@TK2MSFTN GP12.phx.gbl...
William,

Iphlpapi.dll is listed as being on W2K3 server, XP, and 2000 (server and professional). You should have no problem declaring the methods in C# and
making the calls through the P/Invoke layer. What APIs are you having
trouble with specifically?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:OG******** ******@TK2MSFTN GP12.phx.gbl...
How would you use iphlpapi.lib (from the platform sdk) from a c# app? I

can
use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k. If need to wrap in c++ dll, please poing to example. Also, would you need to distribute lib seperatly with you app, or would it compile "into" one c++ dll? TIA!

--
William Stacey, MVP


Nov 15 '05 #3
William,

I don't have a W2K machine to test this on, but from what you have said,
it would seem that the documentation is incorrect. I doubt that they would
have functions in the library that are not exported in the dll (that would
be a major blunder, greater than the documentation being wrong).

In order to see what the case is, I would create your own DLL which
exports the functions that you need, and link to the lib, and then use that.
Of course, test this to see if it works. At the worse, it is going to
crash, hard (like before), and you will know that the API calls are not
available on the platform. If it does work, then MS should be notified, and
the DLL rebuilt (or the documentation fixed).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:eg******** ******@TK2MSFTN GP11.phx.gbl...
That is what is says, I agree. However, that is not how it works AFAICT, so I think it is a doco error. The ICMP echo and I think the GetParms work on xp and w3k, but not w2k (get some kind of entry point error that fails hard on w2k machine.) The doco also refers to the "lib" version and not the
"dll" version. I don't use c++, so not sure what the lib is here and how to call. I think the w2k version dll, does not have all the same entry points (i.e. APIs).
Thanks Nicholas. Any other help would be great.

--
William Stacey, MVP

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:u2******** ******@TK2MSFTN GP12.phx.gbl...
William,

Iphlpapi.dll is listed as being on W2K3 server, XP, and 2000 (server and
professional). You should have no problem declaring the methods in C# and
making the calls through the P/Invoke layer. What APIs are you having
trouble with specifically?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:OG******** ******@TK2MSFTN GP12.phx.gbl...
How would you use iphlpapi.lib (from the platform sdk) from a c# app?
I can
use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k.

If need to wrap in c++ dll, please poing to example. Also, would you
need to distribute lib seperatly with you app, or would it compile "into" one c++ dll? TIA!

--
William Stacey, MVP



Nov 15 '05 #4
That's correct, not all API's are available on W2K, API's ending with Ex
(f.i GetBestInterfac eEx ) do require XP or W2K3, however, the API's
IcmpSendEcho and GetNetworkParam s should be available on W2K.
Did you check the exports using depends.exe
(http://www.dependencywalker.com/) or dumpbin?

The Iphlpapi.lib is simply an export library, C++ programs must specify the
target OS version at build time, the dll is dynamically bound at run time.

Willy.
"William Stacey" <st***********@ mvps.org> wrote in message
news:eg******** ******@TK2MSFTN GP11.phx.gbl...
That is what is says, I agree. However, that is not how it works AFAICT, so I think it is a doco error. The ICMP echo and I think the GetParms work on xp and w3k, but not w2k (get some kind of entry point error that fails hard on w2k machine.) The doco also refers to the "lib" version and not the
"dll" version. I don't use c++, so not sure what the lib is here and how to call. I think the w2k version dll, does not have all the same entry points (i.e. APIs).
Thanks Nicholas. Any other help would be great.

--
William Stacey, MVP

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:u2******** ******@TK2MSFTN GP12.phx.gbl...
William,

Iphlpapi.dll is listed as being on W2K3 server, XP, and 2000 (server and
professional). You should have no problem declaring the methods in C# and
making the calls through the P/Invoke layer. What APIs are you having
trouble with specifically?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:OG******** ******@TK2MSFTN GP12.phx.gbl...
How would you use iphlpapi.lib (from the platform sdk) from a c# app?
I can
use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k.

If need to wrap in c++ dll, please poing to example. Also, would you
need to distribute lib seperatly with you app, or would it compile "into" one c++ dll? TIA!

--
William Stacey, MVP



Nov 15 '05 #5
William,

Is it IcmpSendEcho that you're using? It's exported from icmp.dll as
well, and I think that DLL has been included with all Windows versions
(the MSDN Dll Hell database can hopefully tell you for sure). See also
KB 170591.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #6
Thanks Mattias. I will check it out.

--
William Stacey, MVP

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:Or******** ******@TK2MSFTN GP10.phx.gbl...
William,

Is it IcmpSendEcho that you're using? It's exported from icmp.dll as
well, and I think that DLL has been included with all Windows versions
(the MSDN Dll Hell database can hopefully tell you for sure). See also
KB 170591.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 15 '05 #7
Thanks to both. I did check depends after first post and many APIs are not
included in w2k version (including the ones I needed.) So now my question
is, how the heck does anyone to ICMPsend on a w2k box? I have seen apps,
and they seem to work. If you use winsock and raw IP, you need to be admin,
so that is not really an option IMO, and icmpsendecho is not supported in
iphlpapi.dll. So how do folks to this on w2k? TIA

--
William Stacey, MVP

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:Ou******** ******@TK2MSFTN GP12.phx.gbl...
That's correct, not all API's are available on W2K, API's ending with Ex
(f.i GetBestInterfac eEx ) do require XP or W2K3, however, the API's
IcmpSendEcho and GetNetworkParam s should be available on W2K.
Did you check the exports using depends.exe
(http://www.dependencywalker.com/) or dumpbin?

The Iphlpapi.lib is simply an export library, C++ programs must specify the target OS version at build time, the dll is dynamically bound at run time.

Willy.
"William Stacey" <st***********@ mvps.org> wrote in message
news:eg******** ******@TK2MSFTN GP11.phx.gbl...
That is what is says, I agree. However, that is not how it works AFAICT,
so
I think it is a doco error. The ICMP echo and I think the GetParms work on
xp and w3k, but not w2k (get some kind of entry point error that fails

hard
on w2k machine.) The doco also refers to the "lib" version and not the
"dll" version. I don't use c++, so not sure what the lib is here and how to
call. I think the w2k version dll, does not have all the same entry points
(i.e. APIs).
Thanks Nicholas. Any other help would be great.

--
William Stacey, MVP

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote

in
message news:u2******** ******@TK2MSFTN GP12.phx.gbl...
William,

Iphlpapi.dll is listed as being on W2K3 server, XP, and 2000

(server and
professional). You should have no problem declaring the methods in C# and making the calls through the P/Invoke layer. What APIs are you having
trouble with specifically?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"William Stacey" <st***********@ mvps.org> wrote in message
news:OG******** ******@TK2MSFTN GP12.phx.gbl...
> How would you use iphlpapi.lib (from the platform sdk) from a c#
app? I can
> use iphlpapi.dll on w23 and xp, but seem to need this "lib" from

w2k. If
> need to wrap in c++ dll, please poing to example. Also, would you need
to
> distribute lib seperatly with you app, or would it compile "into"

one c++
> dll? TIA!
>
> --
> William Stacey, MVP
>
>
>



Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5899
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using X509Certificate ( *.cer file ) so that it can be used to email as attachment. The real part is Encrypting using X509Certificate and CryptoServiceProvider.
1
567
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I want to use a callback from the client side to update webcontrols based on user input without using postback. I am seeking a way to stop the...
10
2642
by: Christopher Benson-Manica | last post by:
Why can't I use a class destructor in a using declaration: using MyClass::~MyClass; ? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
17
3489
by: beliavsky | last post by:
Many of my C++ programs have the line using namespace std; but the "Accelerated C++" book of Koenig and Moo has many examples where the library names are included one at a time, for example using std::cin; using std::cout;
0
1181
by: centrino | last post by:
Hi, Are there something like iphlpapi in .NET 2.0 ? I want to change the metric in the routing table. Which API sould i use ? Can i use it in Winodws Mobile 5.0, too ?
0
7756
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info: http://support.microsoft.com/default.aspx?scid=kb;en-us;170591 ). The problem I have is in order to perform a discovery/ping of an entire subnet...
2
3287
by: Michael M. | last post by:
Hi All I am trying to use the function GetExtendedTcpTable, I looked on the MSDN found the C++ definition and tried to convert it but it does not seem to be working, it returns 87 which is = ERROR_INVALID_PARAMETER I have checked the parameters it looks correct to me. Any IDEAS? Imports System.Runtime.InteropServices
1
2425
by: ling | last post by:
i need to write a prog that will use IPHlpAPI library in Platform SDK, but i don't think it is included in my Microsoft Visual Studio .NET 2003 software. Is there any other way download the library n later attach it to my prog or any other way i can use the library?
3
8241
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0 build with these methods, will appear to encrypt and decrypt, but the resulting decrypted file will be corrupted. I tried encrypting a .bmp file and...
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.