problem with dll

E

Eddie

When I use “IP Helper API’s functions” In my program, all is ok. until I
run it on Windows 98.

On Windows Xp everything is ok.

On 98 I get an error:

MsgBox:

File MyApp.exe is
linked with missing export IPHLPAPI.DLL:GetPerAdapterInfo




I checked it with IPHLPAPI.DLL 5.0.1717.2 and 5.1.2600.2.

The first one is from 98 and I get with it this error.

The second one is from xp (works fine), but she won’t work when I copy
it do 98.



How to fix his problem?
 
J

JKop

Eddie posted:
When I use “IP Helper API’s functions” In my program, all is ok. until I
run it on Windows 98.

On Windows Xp everything is ok.

On 98 I get an error:

MsgBox:

File MyApp.exe is
linked with missing export IPHLPAPI.DLL:GetPerAdapterInfo




I checked it with IPHLPAPI.DLL 5.0.1717.2 and 5.1.2600.2.

The first one is from 98 and I get with it this error.

The second one is from xp (works fine), but she won’t work when I copy
it do 98.



How to fix his problem?


OFF-TOPIC

On the Win98 system, it can't find the function entitled
"GetPerAdapterInfo" inside the file "IPHLPAPI.DLL".

If I'd to guess, then I'd say that this particular function was only added
to the library recently.

You can go to "www.dependencywalker.com", and download a nice tool to see
what DLLs and functions are involved.

Anyway, to the solution...

Do you need the program to be able to run on Win98? If not, it doesn't
matter.

If you *do* want the program to run on Win98, how would you best describe
your situation:

A) The use of this function is vital in the program

B) The use of this function is a nice feature, but if needs be I won't use
it.

If your answer is A, then your only option is to package the newer version
of this DLL with your executable, or provide a readme.txt that contains a
link to DLL online or something like that.

Now, if you answer is B, here's the beauty:

HMODULE hDLL = LoadLibrary("IPHLPAPI.DLL");

if (!hDLL) { throw "Poo!"; }

return_value (*GetPerAdapterInfo)(arguments);

GetPerAdapterInfo = GetProcAddress(hDLL,"GetPerAdapterInfo");

if (!GetPerAdapterInfo)
{
FreeLibrary(hDLL);
throw "Poo!";
}

//Now you can use the function as normal

Don't forget to free the library at the end

FreeLibrary(hDLL);

I'm sure there must be some sort of template class out there that'll do this
for you, one that will free the library upon an exception and so on. If
there ain't, I might waste an hour or so of my time on one!


-JKop
 
E

Eddie

thanks for advive, it's informative.
my program base on this function, it can't be run with out it.

Is there a replacement code to do the same as the missing one?
 
J

JKop

Eddie posted:
thanks for advive, it's informative.
my program base on this function, it can't be run with out it.

Is there a replacement code to do the same as the missing one?

No. You need the new version of that DLL. No buts about it.


-JKop
 
H

Howard

Eddie said:
thanks for advive, it's informative.
my program base on this function, it can't be run with out it.

Is there a replacement code to do the same as the missing one?

You *really* need to ask in a Windows newsgroup, not here.

It is highly likely that that function is only supported by the newer
operating system. In that case, if your program needs that function, then
your program simply does not support win98. That's really not that bad,
though,since 1998 was six years go. That's a long time in computer terms -
especially considering how often a new Windows system comes out! :)

But you can ask in a Windows newsgroup (on the server news.microsoft.com) if
there is some suitable replacement that *does* work in win98.

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top