problem with dll

Discussion in 'C++' started by Eddie, Aug 2, 2004.

  1. Eddie

    Eddie Guest

    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?
    Eddie, Aug 2, 2004
    #1
    1. Advertising

  2. Eddie

    Sharad Kala Guest

    "Eddie" <> wrote in message
    news:ceku17$735$...
    > 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.
    Sharad Kala, Aug 2, 2004
    #2
    1. Advertising

  3. Eddie

    JKop Guest

    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
    JKop, Aug 2, 2004
    #3
  4. Eddie

    Eddie Guest

    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
    Eddie, Aug 2, 2004
    #4
  5. Eddie

    JKop Guest

    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
    JKop, Aug 2, 2004
    #5
  6. Eddie

    Howard Guest

    "Eddie" <> wrote in message
    news:celcaf$dfn$...
    > 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
    Howard, Aug 2, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,630
  2. Weston Fryatt
    Replies:
    2
    Views:
    950
    Weston Fryatt
    Jan 1, 2005
  3. NGM
    Replies:
    0
    Views:
    2,288
  4. wpy
    Replies:
    1
    Views:
    358
    -=Chris=-
    Nov 11, 2003
  5. H. Simpson
    Replies:
    4
    Views:
    244
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page