Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > problem with dll

Reply
Thread Tools

problem with dll

 
 
Eddie
Guest
Posts: n/a
 
      08-02-2004
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?
 
Reply With Quote
 
 
 
 
Sharad Kala
Guest
Posts: n/a
 
      08-02-2004

"Eddie" <(E-Mail Removed)> wrote in message
news:ceku17$735$(E-Mail Removed)...
> 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:


Off topic. Please read the welcome message for this newsgroup -
http://www.slack.net/~shiva/welcome.txt.


 
Reply With Quote
 
 
 
 
JKop
Guest
Posts: n/a
 
      08-02-2004
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
 
Reply With Quote
 
Eddie
Guest
Posts: n/a
 
      08-02-2004
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?


JKop wrote:

> 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

 
Reply With Quote
 
JKop
Guest
Posts: n/a
 
      08-02-2004
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
 
Reply With Quote
 
Howard
Guest
Posts: n/a
 
      08-02-2004

"Eddie" <(E-Mail Removed)> wrote in message
news:celcaf$dfn$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
WinXP "Windows Explorer has encountered a problem and needs to close...." Shell32.dll and ntdll.dll question. Sparky Computer Support 3 01-24-2004 11:53 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments