Solved

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

Posted on 2004-03-25
6
465 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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 this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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