Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using functions from iphlpapi.dll

Posted on 2004-07-30
7
Medium Priority
?
9,674 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 375 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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ā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

722 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