BOOL Dial(CString szURL)
{
	GUID guid;
	HANDLE iConnectionHandle = ConnMgrApiReadyEvent();
	HRESULT hresult = ConnMgrMapURL((LPCTSTR)szURL,&guid,NULL);
	if (FAILED(hresult))
	{
		MessageBox(L"映射地址不成功",L"错误",MB_OKCANCEL);
		return FALSE;
	}
	// Get a connection.
	CONNMGR_CONNECTIONINFO cinfo;
	memset(&cinfo,0,sizeof(cinfo));
	cinfo.cbSize = sizeof(cinfo);
	cinfo.bDisabled = FALSE;
	cinfo.bExclusive = FALSE;
	cinfo.guidDestNet = guid;
	cinfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
	cinfo.dwFlags = CONNMGR_FLAG_PROXY_HTTP;
	cinfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;
	DWORD status;
	hresult = ConnMgrEstablishConnectionSync				(&cinfo,&iConnectionHandle,15000,&status);
	if (FAILED(hresult))
	{
		MessageBox(L"拨号不成功",L"错误",MB_OKCANCEL);
		return FALSE;
	}
	return TRUE;
}

相关文章:

  • 2021-12-22
  • 2021-08-07
  • 2021-10-31
  • 2021-05-20
  • 2021-12-22
  • 2022-01-23
  • 2021-12-04
猜你喜欢
  • 2021-11-14
  • 2021-12-07
  • 2021-09-30
  • 2021-08-30
  • 2021-10-27
  • 2021-06-05
  • 2021-09-25
相关资源
相似解决方案