Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Changing to use a CComPtr rather than a raw pointer that fell out of …
Browse files Browse the repository at this point in the history
…scope. whoops
  • Loading branch information
andysterland committed May 26, 2016
1 parent aecbc4b commit d016d9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/MicrosoftEdgeLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int _tmain(int argc, _TCHAR* argv[])
}
else
{
pszUrl = L"http://www.bing.com/";
pszUrl = L"https://www.bing.com/";
}

hr = LaunchEdge(pszUrl, bKeepAlive);
Expand Down Expand Up @@ -88,13 +88,13 @@ HRESULT LaunchEdge(_In_ PCWSTR pszUrl, _In_ BOOL bKeepAlive)
return E_NOINTERFACE;
}

if (info.pDoc == nullptr)
if (info.spDoc == nullptr)
{
return E_NOINTERFACE;
}

CComPtr<IHTMLWindow2> spWindow;
hr = info.pDoc->get_parentWindow(&spWindow);
hr = info.spDoc->get_parentWindow(&spWindow);
if (!SUCCEEDED(hr))
{
ShowLastError(L"Failed to get the IHTMLWindow2");
Expand Down Expand Up @@ -273,7 +273,7 @@ HRESULT EnumerateTargets(vector<EdgeTargetInfo>& vTargets)
EdgeTargetInfo i;
i.hwnd = hwnd;
i.pid = processId;
i.pDoc = spDocument;
i.spDoc = spDocument;

hr = spDocument->get_URL(&i.url);
if (hr != S_OK)
Expand Down
2 changes: 1 addition & 1 deletion src/MicrosoftEdgeLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct EdgeTargetInfo
HWND hwnd;
BSTR url;
DWORD pid;
IHTMLDocument2 *pDoc;
CComPtr<IHTMLDocument2> spDoc;
};

HRESULT LaunchEdge(_In_ PCWSTR pszUrl, _In_ BOOL bKeepAlive);
Expand Down

0 comments on commit d016d9b

Please sign in to comment.