GUID guid;
LPCTSTR url = L"http://www.msn.com";
HRESULT hresult = ConnMgrMapURL((LPCTSTR)url,&guid,NULL);
if (!SUCCEEDED(hresult))
{
delete [] url;
return NULL;
}
// 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);
timer->start(5000);
if (!SUCCEEDED(iConnectionHandle))
{
QMessageBox::information(0, tr
("N"), tr
("Connection opened"));
emit connectionFound();
bIsConnectionEnabled = true;
return true;
}
QMessageBox::information(0, tr
("N"), tr
("Connection closed"));
emit connectionLost();
return false;
GUID guid;
LPCTSTR url = L"http://www.msn.com";
HRESULT hresult = ConnMgrMapURL((LPCTSTR)url,&guid,NULL);
if (!SUCCEEDED(hresult))
{
delete [] url;
return NULL;
}
// 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);
timer->start(5000);
if (!SUCCEEDED(iConnectionHandle))
{
QMessageBox::information(0, tr("N"), tr("Connection opened"));
emit connectionFound();
bIsConnectionEnabled = true;
return true;
}
QMessageBox::information(0, tr("N"), tr("Connection closed"));
emit connectionLost();
return false;
To copy to clipboard, switch view to plain text mode
Bookmarks