Solved

How i chnge the linkage order of network adapter with c/c++

Posted on 2004-03-25
6
441 Views
Last Modified: 2013-12-03
In windows you can go  Network and Dial-up->Connections->Advanced->Advanced Settings->Connections
dialog box where you can set priorities for connections.
The dialog box says:
"Connections are listed in the order in which they are accessed by DNS and
other network services".
In "Connections:" part you can set the order of  accessed.
my question is how to changed it in c/c++ (2000 / XP).

0
Comment
Question by:oferpe71
6 Comments
 

Author Comment

by:oferpe71
ID: 10675676
Increase Points to 300
0
 
LVL 14

Expert Comment

by:wayside
ID: 10679256
This stuff is almost certainly stored in the registry, where the sorting is done using an incrementing key of some sort (connection1, connection2, connection3, etc) or they are listed in order within the value (using a REG_MULTI_SZ type for example). If you use regedit to search your registry for the names listed in this dialog you should be able to find exactly where this is stored and then rearrange the order using plain old registry operations.

For example, one key I found is called DhcpServer and the value is "10.0.3.8 10.0.3.7" .

I can't seem to get to exactly the dialog you list in your question so I can't pin down the registry key exactly.

If your needs are more complicated you will probably have to use the COM interfaces such as  INetCfg, IEnumNetCfgComponent, etc., to find and change this information. There is sample code in the DDK that shows how to use these (look for a program called "bindview").

Hope this helps...
0
 
LVL 1

Expert Comment

by:GJanusz
ID: 10683740
After some poking around I found a couple things that may help you.

The connection list appears to be stored in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}

INetConnection looks interesting, but the only INetXXX interface I could find with ordering abilities was INetCfgComponentBindings [methods MoveBefore() and MoveAfter()].
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:oferpe71
ID: 10704418
Both of the answer didn't work.i Increase Points to 600 and ask it again
In windows you can go  Network and Dial-up->Connections->Advanced->Advanced Settings->Connections
dialog box where you can set priorities for connections.
The dialog box says:
"Connections are listed in the order in which they are accessed by DNS and
other network services".
In "Connections:" part you can set the order of  accessed.
my question is how to changed it in c/c++ (2000 / XP).


0
 

Author Comment

by:oferpe71
ID: 10704425
again Increase Points to 600
0
 
LVL 1

Accepted Solution

by:
mblais1 earned 300 total points
ID: 10762535
These articles may provide you with the information you need:

"How to Change the IP Address List Order Returned" -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;171320

"Cannot Change the Binding Order for Remote Access Connections" -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;311218
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now