sg

Salı, Ocak 10, 2006

[Google-Desktop-Developer] IGoogleDesktopDisplaySite::CloseDetailsView returns E_INVALIDARG


Hi, I am using ActiveX controls to create the plug-in and the details
view. ActiveX control A was used as the plug-in, and when user clicks
on buttons on it, it will create instance of another ActiveX control B
and calls IGoogleDesktopDisplaySite::ShowDetailsView to show control B
as detail window.

The problem: when the detail window (control B) is opened, and user
tries to remove the pane from the sidebar, it looks that the GDS
doesn't release the control immedietly which causes DllCanUnloadNow
returns S_FALSE because reference count is not zero, and the DLL is
till in memory of GDS process. If the detail window is not opened when
user tries to remove the pane, then everything is fine and DLL can be
unloaded successfully.

To solve this problem, I want to handle the WM_DESTROY message in the
plug-in window and call IGoogleDesktopDisplaySite::CloseDetailsView to
close the detail window explicitly. But that function retruns
E_INVALIDARG. Does anybody have idea about this?

Sample code:

LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
{
if(m_spClientSite)
{
CComPtr<IGoogleDesktopDisplaySite> spSite;
HRESULT hr =
m_spClientSite->QueryInterface(__uuidof(IGoogleDesktopDisplaySite),
(void**)&spSite);
if(SUCCEEDED(hr))
{
hr = spSite->CloseDetailsView();
// hr returns E_INVALIDARG here
}
}
return 0;
}

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık