//可能有库文件需要添加
#include <connmgr.h>
//拨号程序
void ConnectYYY()
{
HANDLE hConnMgr = ConnMgrApiReadyEvent();
BOOL bAvailbale = FALSE;
DWORD dwResult = ::WaitForSingleObject( hConnMgr, 2000 );
if ( dwResult == WAIT_OBJECT_0 )
{
bAvailbale = TRUE;
}
// 关闭
//if(hConnMgr) CloseHandle(hConnMgr);
GUID connGuid;
int nIndex = 0;
HRESULT hResult = ConnMgrMapURL ( _T("http://www.baidu.com"), &connGuid, (DWORD*)&nIndex );
if (FAILED(hResult) )
{
MessageBox(NULL,L"映射失败",L"bbb",MB_OKCANCEL);
nIndex = -1;
memset ( &connGuid, 0, sizeof(GUID) );
DWORD dwLastError = GetLastError ();
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载