473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Windows API - GetAdaptersInfo()

I am using GetAdaptersInfo( pAdapterInfo,pOutBufLen); to get the adapters info of the machine. I am using GetBestInterface() to get the index of my connection with the far end. So then I am matching this index with pAdapterInfo->index to find out which interface i am using. Then if I disable (disconnect) the interface and connect it back again it wont be able match. I guess pAdapterInfo is changed in the meantime. If I call GetAdaptersInfo() again, then i will be able to match. Is that the expected behaviour?

On what occasions should i call GetAdaptersInfo()? Say if i disconnect an interface that i dont use for my connection with the far end, will pAdapterInfo again change? Will I not be able to match the index?

Do I have to call GetAdaptersInfo() whenever an interface is disabled or enabled?
Do I have to call GetAdaptersInfo() whenever an interface is disconnected or connected (from network without disabling or enabling)?
In other words on what occasion pAdapterInfo will change?


Thanks very much for any help!!

DB

Ps, If anyone thinks this thread should belong to another topic, pls let me know, i'll move it accordingly.
Apr 16 '08 #1
2 8010
weaknessforcats
9,208 Expert Mod 8TB
I assume you have read this: http://msdn2.microsoft.com/en-us/lib...17(VS.85).aspx.

It doesn't mention anything about connecting or disconnecting an interface.

Are you checking the return value from GetAdaptersInfo?
Apr 16 '08 #2
TamusJRoyce
110 100+
It would help if you could explain what's the purpose of using this part of lphlpapi's library. I'm not that familiar with Iphlpapi or the iphelper library, but it's interesting what you can do with it.

Are you trying to change settings within the local computer, gather info from a local computer for a user to see, or use this info to perform some other function?

If it's to perform some other function, explain the purpose of this function alone (and not the whole project : )
Apr 17 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
7
by: marccruz | last post by:
Is there an API where I can get the mac address/es of a computer using C for Windows XP?
2
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.