WinCE 创建或者修改拨号连接,可以改APN接入点

#include <ras.h>

#define DIAL_MODIFIER_LEN 256
#define MAX_CFG_BLOB 126
#define MAX_NAME_LENGTH 8
typedef struct tagDEVMINICFG
{
 WORD wVersion;
 WORD wWaitBong; // DevCfgHdr
 DWORD dwCallSetupFailTimer; // CommConfig.ModemSettings
 DWORD dwModemOptions; // CommConfig.ModemSettings
 DWORD dwBaudRate; // DCB
 WORD fwOptions; // DevCfgHdr
 BYTE ByteSize; // DCB
 BYTE StopBits; // DCB
 BYTE Parity; // DCB
 WCHAR szDialModifier[DIAL_MODIFIER_LEN+1]; // Unique to MiniCfg
 // Dynamic devices configuration
 WCHAR wszDriverName[MAX_NAME_LENGTH+1];
 BYTE pConfigBlob[MAX_CFG_BLOB];
 HANDLE hPort;
} DEVMINICFG, *PDEVMINICFG;

DWORD CreateRasEntry() 
{
 RASENTRY EntryInfo;
 memset(&EntryInfo, 0, sizeof(RASENTRY));
 EntryInfo.dwSize=sizeof(RASENTRY);
 DWORD dwSize = sizeof(DEVMINICFG);

 DEVMINICFG *lpCfg = new DEVMINICFG;
 if(RasGetEntryProperties(NULL, TEXT("3gnet"), &EntryInfo, &EntryInfo.dwSize, (BYTE *)lpCfg, &dwSize) == ERROR_SUCCESS)
 return RasSetEntryProperties(NULL, TEXT("liulixiang"), &EntryInfo, EntryInfo.dwSize, (BYTE *)lpCfg, dwSize);
}

 

上一篇:洛谷P1352 没有上司的舞会


下一篇:android搜索框列表布局,流程及主要步骤思维导图