Solved

Using functions from iphlpapi.dll

Posted on 2004-07-30
7
9,646 Views
Last Modified: 2013-11-17


I want to use GetNetworkParams() from iphlpapi.dll,
to get dns server IPs.

I'm compiling with Borland 5.5 command-line, and its an app for
wide distribution, hopefully to be used on any
Win32 machine, but Win98 or better would do.

I notice on MSDN it says :

//
// Link with IPHlpAPI.lib
//

in the example code for GetNetworkParams()

Why do I get a linker error ?
Ive included iphlpapi.h, and have iphlpapi.lib in
c:\borland\bcc55\lib\psdk


thanks !
0
Comment
Question by:nicklyons
  • 3
7 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 11689531
try the usual way:
LoadLibrary() and  after GetProcAddress().

gtokas.
0
 

Author Comment

by:nicklyons
ID: 11689703
thanks, although I already got there....

why is it different for this DLL ? You dont need to do this for say, Registry functions from advapi.dll

N
0
 
LVL 9

Expert Comment

by:Cayce
ID: 11694649
Do and implib to the DLL, then link the .lib to your executable file.
0
 
LVL 9

Accepted Solution

by:
Cayce earned 125 total points
ID: 11694659
Sorry,

do an IMPLIB to the DLL, that will generate a .LIB file, this can be linked in your executable using the command line tools.
0
 
LVL 9

Expert Comment

by:Cayce
ID: 12449194
No objections on my part.

The complete answer would have been:

Add the iphlpapi.lib on the linker's command line, so it would get linked.
If iphlpapi.lib was no available or incompatible (VC++ .lib files are not compatible with borland tools), just use the implib.exe tool to generate the iphlpapi.lib file.

If you would want dynamic linking, using LoadLibrary() and GetProcAddress() (as gotkas stated above) would be the way, to go. No need to modify the linker's command line (the author is using borland command line tools) or the makefile.

Cayce
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now