473,241 Members | 1,481 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,241 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 7990
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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

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.