Solved

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

Posted on 2004-03-25
6
455 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

735 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