Switching between wince synchronization and hard disk Mode

Source: Internet
Author: User
// ================================================ ========================================
// Title:
// Switch between wince synchronization and hard disk Mode
// Author:
// Norains
// Date:
// Month 22-October-2007
// Environment:
// Evc4.0 + Windows CE 5.0 standard SDK
// ================================================ ========================================

The content of this article is based on the RMI Au1200 experimental platform, and the default synchronization and hard disk mode driver file name is not changed, so this method is not guaranteed to apply to all platforms.

Before proceeding to our article, we also need to confirm that we have added the features of the two modes when making NK. Bin.

If the platform meets the two conditions mentioned above, it is only one step away from success, and the rest is very simple (of course we haven't seen much complicated before ).

The supervisor automatically loads the USB driver after startup. in other words, if the registry is changed after the system is started successfully, No matter what mode is changed, the USB cable is connected to the previous mode. therefore, if you need the settings to take effect, restart the machine after the settings are complete.

Let's take a look at the pattern setting code: CREG reg;
Reg. Create (HKEY_LOCAL_MACHINE, text ("Drivers/USB/functiondrivers "));

Tchar szdisp [max_path] = {0 };
Reg. getvaluesz (text ("defaultclientdriver"), szdisp, max_path );
MessageBox (null, szdisp, text ("the current value"), mb_ OK );

// Synchronization mode
// Reg. setsz (text ("defaultclientdriver"), text ("serial_class "));

// Hard disk Mode
// Reg. setsz (text ("defaultclientdriver"), text ("mass_storage_class "));

Reg. Reset ();

 
Everything is so simple, just a few words of code, you can complete the conversion of the two modes. if you are bored and connect the USB cable without doing anything, you only need to give "defaultclientdriver" A value different from the above strings.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.