CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    54

    Trouble Using iphlpapi

    Hi, I wanted to use the the iphlpapi library to obtain the computer's MAC address (as it's shown here), however I ran into a bit of trouble with using the library.

    The code works perfectly and in fact I can comment the code out and still have the same problem. The problem comes with linking to iphlpapi.lib. There is no problem linking to the library and starting the program, however once the program is running, it manages to stall itself, the IDE, and pretty much the rest of the computer.

    This behavior is not consistant though. If I do a clean rebuild of my project, the program will run fine. However if I make a non-trivial change to the code, this problem returns. The program does not freeze completely, but processes very slowly. I can step through the code in the debugger, and each line can take about 10 seconds to process.

    Has anyone experienced this before? What could I do to fix it? What might be the cause of this problem? Any thoughts are appreciated.

  2. #2
    Join Date
    Aug 2001
    Posts
    507

    Re: Trouble Using iphlpapi

    This can happen some times....

    tell me, have u included or are using any other libraries ? or any SDK apart from this ?

    check the file paths, in the options -> Directories ...

    some times, u can fix problems like these when u change the order of the included directories paths,

    and some times the # includes in ur source code.
    If you found my reply to be useful, please dont hesitate to rate it.


    DO NOT kick the Axe if it doesnt fall on your foot.

    Salman

  3. #3
    Join Date
    Nov 2004
    Posts
    54

    Re: Trouble Using iphlpapi

    An update:

    I removed the library from the linker completely and added code to do dynamic run-time linking by loading the DLL and getting the function that I use. The problem still persisted.

    I even tried removing the #includes for iphlpapi, moving the definitions of the structs that I need into my .cpp file, but that has still given me this same problem.

  4. #4
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: Trouble Using iphlpapi

    Hi,

    I'd recommend an anti-virus/anti-spyware scan first. Though i have absolutely
    no idea what iphlpapi is all about, the symptoms that you have described
    sounds more like a viral infection rather than some technical issue.
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  5. #5
    Join Date
    Nov 2004
    Posts
    54

    Re: Trouble Using iphlpapi

    I take back my previous post by noting that I didn't do a clean rebuild when I changed the code to use dynamic linking. I haven't seen any more problems now that I've rebuilt my project and am using dynamic run-time linking.

    Thank you for your replies. I may still look into it further, but I'm not sure if it would be worth the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured