Solved

Using functions from iphlpapi.dll

Posted on 2004-07-30
7
9,658 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Notepad++ search not working 6 1,623
How can I debug SSIS using Visual Studio 2008 2 84
oracle 11g 23 128
difference between sorce folder and folder in eclipise 3 42
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

756 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