Solved

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

Posted on 2004-03-25
6
460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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