本文整理汇总了C++中IOleCommandTarget_Release函数的典型用法代码示例。如果您正苦于以下问题:C++ IOleCommandTarget_Release函数的具体用法?C++ IOleCommandTarget_Release怎么用?C++ IOleCommandTarget_Release使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IOleCommandTarget_Release函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: update_title
void update_title(HTMLDocumentObj *This)
{
IOleCommandTarget *olecmd;
HRESULT hres;
if(!(This->update & UPDATE_TITLE))
return;
This->update &= ~UPDATE_TITLE;
if(!This->client)
return;
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT title;
WCHAR empty[] = {0};
V_VT(&title) = VT_BSTR;
V_BSTR(&title) = SysAllocString(empty);
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER,
&title, NULL);
SysFreeString(V_BSTR(&title));
IOleCommandTarget_Release(olecmd);
}
}
开发者ID:pstrealer,项目名称:wine,代码行数:27,代码来源:view.c
示例2: on_timer
static LRESULT on_timer(HTMLDocumentObj *This)
{
TRACE("(%p) %x\n", This, This->update);
KillTimer(This->hwnd, TIMER_ID);
if(!This->update)
return 0;
if(This->update & UPDATE_UI) {
if(This->hostui)
IDocHostUIHandler_UpdateUI(This->hostui);
if(This->client) {
IOleCommandTarget *cmdtrg;
HRESULT hres;
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_UPDATECOMMANDS,
OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
IOleCommandTarget_Release(cmdtrg);
}
}
}
update_title(This);
This->update = 0;
return 0;
}
开发者ID:pstrealer,项目名称:wine,代码行数:31,代码来源:view.c
示例3: WebBrowser_ExecWB
static HRESULT WINAPI WebBrowser_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
IOleCommandTarget *target = NULL;
HRESULT hres;
TRACE("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt, debugstr_variant(pvaIn), pvaOut);
if(This->container)
{
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (LPVOID*)&target);
if(FAILED(hres))
target = NULL;
}
if(!target && This->doc_host.document)
{
hres = IUnknown_QueryInterface(This->doc_host.document, &IID_IOleCommandTarget, (LPVOID*)&target);
if(FAILED(hres))
target = NULL;
}
if(!target)
return E_UNEXPECTED;
hres = IOleCommandTarget_Exec(target, NULL, cmdID, cmdexecopt, pvaIn, pvaOut);
IOleCommandTarget_Release(target);
return hres;
}
开发者ID:DusteDdk,项目名称:wine-multimedia,代码行数:30,代码来源:webbrowser.c
示例4: DocHostContainer_exec
static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
VARIANT *out)
{
WebBrowser *This = impl_from_DocHost(doc_host);
IOleCommandTarget *cmdtrg = NULL;
HRESULT hres;
if(This->client) {
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(FAILED(hres))
cmdtrg = NULL;
}
if(!cmdtrg && This->container) {
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(FAILED(hres))
cmdtrg = NULL;
}
if(!cmdtrg)
return E_NOTIMPL;
hres = IOleCommandTarget_Exec(cmdtrg, cmd_group, cmdid, execopt, in, out);
IOleCommandTarget_Release(cmdtrg);
if(SUCCEEDED(hres))
TRACE("Exec returned %08x %s\n", hres, debugstr_variant(out));
else
FIXME("Exec failed\n");
return hres;
}
开发者ID:DusteDdk,项目名称:wine-multimedia,代码行数:31,代码来源:webbrowser.c
示例5: ITrayBandSiteImpl_AddBand
static HRESULT STDMETHODCALLTYPE
ITrayBandSiteImpl_AddBand(IN OUT IBandSite *iface,
IN IUnknown *punk)
{
ITrayBandSiteImpl *This = ITrayBandSiteImpl_from_IBandSite(iface);
IOleCommandTarget *pOct;
HRESULT hRet;
hRet = IUnknown_QueryInterface(punk,
&IID_IOleCommandTarget,
(PVOID*)&pOct);
if (SUCCEEDED(hRet))
{
/* Send the DBID_DELAYINIT command to initialize the band to be added */
/* FIXME: Should be delayed */
IOleCommandTarget_Exec(pOct,
&IID_IDeskBand,
DBID_DELAYINIT,
0,
NULL,
NULL);
IOleCommandTarget_Release(pOct);
}
return IBandSite_AddBand(This->BandSite,
punk);
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:28,代码来源:tbsite.c
示例6: notify_travellog_update
static void notify_travellog_update(HTMLDocumentObj *doc)
{
IOleCommandTarget *cmdtrg;
HRESULT hres;
if(!doc->is_webbrowser)
return;
/* Don't notify if we were in about: page */
if(doc->basedoc.window->uri) {
DWORD scheme;
hres = IUri_GetScheme(doc->basedoc.window->uri, &scheme);
if(SUCCEEDED(hres) && scheme == URL_SCHEME_ABOUT)
return;
}
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT vin;
V_VT(&vin) = VT_I4;
V_I4(&vin) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_Explorer, CMDID_EXPLORER_UPDATEHISTORY, 0, &vin, NULL);
IOleCommandTarget_Release(cmdtrg);
}
}
开发者ID:fabriceleal,项目名称:wine,代码行数:28,代码来源:persist.c
示例7: handle_docobj_load
static void handle_docobj_load(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd = NULL;
HRESULT hres;
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
if(doc->download_state) {
VARIANT state, progress;
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS,
OLECMDEXECOPT_DONTPROMPTUSER, &progress, NULL);
V_VT(&state) = VT_I4;
V_I4(&state) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
OLECMDEXECOPT_DONTPROMPTUSER, &state, NULL);
}
IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 103, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
IOleCommandTarget_Release(olecmd);
}
doc->download_state = 0;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:32,代码来源:nsevents.c
示例8: prepare_for_binding
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
{
HRESULT hres;
if(This->doc_obj->client) {
VARIANT silent, offline;
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
WARN("silent = %s\n", debugstr_variant(&silent));
else if(V_BOOL(&silent))
FIXME("silent == true\n");
}
hres = get_client_disp_property(This->doc_obj->client,
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
if(SUCCEEDED(hres)) {
if(V_VT(&offline) != VT_BOOL)
WARN("offline = %s\n", debugstr_variant(&offline));
else if(V_BOOL(&offline))
FIXME("offline == true\n");
}
}
if(This->window->mon) {
update_doc(This, UPDATE_TITLE|UPDATE_UI);
}else {
update_doc(This, UPDATE_TITLE);
set_current_mon(This->window, mon, flags);
}
if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg = NULL;
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT var, out;
if(flags & BINDING_NAVIGATED) {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
V_VT(&out) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
if(SUCCEEDED(hres))
VariantClear(&out);
}else if(!(flags & BINDING_FROMHIST)) {
V_VT(&var) = VT_I4;
V_I4(&var) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}
IOleCommandTarget_Release(cmdtrg);
}
}
}
开发者ID:GeonHun,项目名称:wine,代码行数:57,代码来源:persist.c
示例9: PersistHistory_LoadHistory
static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
{
HTMLDocument *This = impl_from_IPersistHistory(iface);
ULONG str_len, read;
WCHAR *uri_str;
IUri *uri;
HRESULT hres;
TRACE("(%p)->(%p %p)\n", This, pStream, pbc);
if(!This->window) {
FIXME("No current window\n");
return E_UNEXPECTED;
}
if(pbc)
FIXME("pbc not supported\n");
if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg = NULL;
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 138, 0, NULL, NULL);
IOleCommandTarget_Release(cmdtrg);
}
}
hres = IStream_Read(pStream, &str_len, sizeof(str_len), &read);
if(FAILED(hres))
return hres;
if(read != sizeof(str_len))
return E_FAIL;
uri_str = heap_alloc((str_len+1)*sizeof(WCHAR));
if(!uri_str)
return E_OUTOFMEMORY;
hres = IStream_Read(pStream, uri_str, str_len*sizeof(WCHAR), &read);
if(SUCCEEDED(hres) && read != str_len*sizeof(WCHAR))
hres = E_FAIL;
if(SUCCEEDED(hres)) {
uri_str[str_len] = 0;
hres = create_uri(uri_str, 0, &uri);
}
heap_free(uri_str);
if(FAILED(hres))
return hres;
hres = load_uri(This->window, uri, BINDING_FROMHIST);
IUri_Release(uri);
return hres;
}
开发者ID:GeonHun,项目名称:wine,代码行数:54,代码来源:persist.c
示例10: set_downloading_proc
static void set_downloading_proc(task_t *_task)
{
download_proc_task_t *task = (download_proc_task_t*)_task;
HTMLDocumentObj *doc = task->doc;
IOleCommandTarget *olecmd;
HRESULT hres;
TRACE("(%p)\n", doc);
set_statustext(doc, IDS_STATUS_DOWNLOADINGFROM, task->url);
CoTaskMemFree(task->url);
if(!doc->client)
return;
if(task->set_download) {
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT var;
V_VT(&var) = VT_I4;
V_I4(&var) = 1;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
IOleCommandTarget_Release(olecmd);
}
doc->download_state = 1;
}
if(doc->view_sink)
IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1);
if(doc->hostui) {
IDropTarget *drop_target = NULL;
hres = IDocHostUIHandler_GetDropTarget(doc->hostui, NULL /* FIXME */, &drop_target);
if(drop_target) {
FIXME("Use IDropTarget\n");
IDropTarget_Release(drop_target);
}
}
}
开发者ID:dvdhoo,项目名称:wine,代码行数:44,代码来源:persist.c
示例11: notify_travellog_update
static void notify_travellog_update(HTMLDocumentObj *doc)
{
IOleCommandTarget *cmdtrg;
HRESULT hres;
if(!doc->webbrowser)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT vin;
V_VT(&vin) = VT_I4;
V_I4(&vin) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_Explorer, CMDID_EXPLORER_UPDATEHISTORY, 0, &vin, NULL);
IOleCommandTarget_Release(cmdtrg);
}
}
开发者ID:GeonHun,项目名称:wine,代码行数:19,代码来源:persist.c
示例12: call_docview_84
/* Calls undocumented 84 cmd of CGID_ShellDocView */
void call_docview_84(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
VARIANT var;
HRESULT hres;
if(!doc->client)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(FAILED(hres))
return;
VariantInit(&var);
hres = IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 84, 0, NULL, &var);
IOleCommandTarget_Release(olecmd);
if(SUCCEEDED(hres) && V_VT(&var) != VT_NULL)
FIXME("handle result\n");
}
开发者ID:Dietr1ch,项目名称:wine,代码行数:20,代码来源:oleobj.c
示例13: WebBrowser_QueryStatusWB
static HRESULT WINAPI WebBrowser_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
IOleCommandTarget *target = NULL;
OLECMD ole_command[1];
HRESULT hres;
TRACE("(%p)->(%d %p)\n", This, cmdID, pcmdf);
if (!pcmdf)
return E_POINTER;
ole_command[0].cmdID = cmdID;
ole_command[0].cmdf = *pcmdf;
if (This->container)
{
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (LPVOID*)&target);
if(FAILED(hres))
target = NULL;
}
if (!target && This->doc_host.document)
{
hres = IUnknown_QueryInterface(This->doc_host.document, &IID_IOleCommandTarget, (LPVOID*)&target);
if(FAILED(hres))
target = NULL;
}
if (!target)
return E_UNEXPECTED;
hres = IOleCommandTarget_QueryStatus(target, NULL, 1, ole_command, NULL);
if (SUCCEEDED(hres))
*pcmdf = ole_command[0].cmdf;
if (hres == OLECMDERR_E_NOTSUPPORTED)
{
*pcmdf = 0;
hres = S_OK;
}
IOleCommandTarget_Release(target);
return hres;
}
开发者ID:DusteDdk,项目名称:wine-multimedia,代码行数:42,代码来源:webbrowser.c
示例14: handle_docobj_load
static void handle_docobj_load(HTMLDocumentObj *doc)
{
HRESULT hres;
if(doc->nscontainer->editor_controller) {
nsIController_Release(doc->nscontainer->editor_controller);
doc->nscontainer->editor_controller = NULL;
}
if(doc->usermode == EDITMODE)
handle_edit_load(&doc->basedoc);
if(doc->client) {
IOleCommandTarget *olecmd = NULL;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
if(doc->download_state) {
VARIANT state, progress;
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS,
OLECMDEXECOPT_DONTPROMPTUSER, &progress, NULL);
V_VT(&state) = VT_I4;
V_I4(&state) = 0;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
OLECMDEXECOPT_DONTPROMPTUSER, &state, NULL);
}
IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 103, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
IOleCommandTarget_Release(olecmd);
}
}
doc->download_state = 0;
}
开发者ID:dvdhoo,项目名称:wine,代码行数:41,代码来源:nsevents.c
示例15: set_download_state
void set_download_state(HTMLDocumentObj *doc, int state)
{
if(doc->client) {
IOleCommandTarget *olecmd;
HRESULT hres;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
VARIANT var;
V_VT(&var) = VT_I4;
V_I4(&var) = state;
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
IOleCommandTarget_Release(olecmd);
}
}
doc->download_state = state;
}
开发者ID:GeonHun,项目名称:wine,代码行数:21,代码来源:persist.c
示例16: set_progress_proc
static void set_progress_proc(task_t *_task)
{
docobj_task_t *task = (docobj_task_t*)_task;
IOleCommandTarget *olecmd = NULL;
HTMLDocumentObj *doc = task->doc;
HRESULT hres;
TRACE("(%p)\n", doc);
if(doc->client)
IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT progress_max, progress;
V_VT(&progress_max) = VT_I4;
V_I4(&progress_max) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
&progress_max, NULL);
V_VT(&progress) = VT_I4;
V_I4(&progress) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
IOleCommandTarget_Release(olecmd);
}
if(doc->usermode == EDITMODE && doc->hostui) {
DOCHOSTUIINFO hostinfo;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
}
}
开发者ID:GeonHun,项目名称:wine,代码行数:40,代码来源:persist.c
示例17: ITrayBandSiteImpl_Update
static HRESULT
ITrayBandSiteImpl_Update(IN OUT ITrayBandSiteImpl *This)
{
IOleCommandTarget *pOct;
HRESULT hRet;
hRet = IUnknown_QueryInterface(This->punkInner,
&IID_IOleCommandTarget,
(PVOID*)&pOct);
if (SUCCEEDED(hRet))
{
/* Send the DBID_BANDINFOCHANGED command to update the band site */
hRet = IOleCommandTarget_Exec(pOct,
&IID_IDeskBand,
DBID_BANDINFOCHANGED,
0,
NULL,
NULL);
IOleCommandTarget_Release(pOct);
}
return hRet;
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:24,代码来源:tbsite.c
示例18: ITrayBandSiteImpl_BroadcastOleCommandExec
static VOID
ITrayBandSiteImpl_BroadcastOleCommandExec(IN OUT ITrayBandSiteImpl *This,
const GUID *pguidCmdGroup,
DWORD nCmdID,
DWORD nCmdExecOpt,
VARIANTARG *pvaIn,
VARIANTARG *pvaOut)
{
IOleCommandTarget *pOct;
DWORD dwBandID;
UINT uBand = 0;
/* Enumerate all bands */
while (SUCCEEDED(IBandSite_EnumBands(This->BandSite,
uBand,
&dwBandID)))
{
if (SUCCEEDED(IBandSite_GetBandObject(This->BandSite,
dwBandID,
&IID_IOleCommandTarget,
(PVOID*)&pOct)))
{
/* Execute the command */
IOleCommandTarget_Exec(pOct,
pguidCmdGroup,
nCmdID,
nCmdExecOpt,
pvaIn,
pvaOut);
IOleCommandTarget_Release(pOct);
}
uBand++;
}
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:36,代码来源:tbsite.c
示例19: activate_plugin
static void activate_plugin(PluginHost *host)
{
IClientSecurity *client_security;
IQuickActivate *quick_activate;
IOleObject *ole_obj = NULL;
IOleCommandTarget *cmdtrg;
IViewObjectEx *view_obj;
IDispatchEx *dispex;
IDispatch *disp;
RECT rect;
HRESULT hres;
if(!host->plugin_unk)
return;
/* Note native calls QI on plugin for an undocumented IID and CLSID_HTMLDocument */
/* FIXME: call FreezeEvents(TRUE) */
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IClientSecurity, (void**)&client_security);
if(SUCCEEDED(hres)) {
FIXME("Handle IClientSecurity\n");
IClientSecurity_Release(client_security);
return;
}
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IQuickActivate, (void**)&quick_activate);
if(SUCCEEDED(hres)) {
QACONTAINER container = {sizeof(container)};
QACONTROL control = {sizeof(control)};
TRACE("Using IQuickActivate\n");
container.pClientSite = &host->IOleClientSite_iface;
container.dwAmbientFlags = QACONTAINER_SUPPORTSMNEMONICS|QACONTAINER_MESSAGEREFLECT|QACONTAINER_USERMODE;
container.pAdviseSink = &host->IAdviseSinkEx_iface;
container.pPropertyNotifySink = &host->IPropertyNotifySink_iface;
hres = IQuickActivate_QuickActivate(quick_activate, &container, &control);
IQuickActivate_Release(quick_activate);
if(FAILED(hres))
FIXME("QuickActivate failed: %08x\n", hres);
}else {
DWORD status = 0;
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IOleObject, (void**)&ole_obj);
if(SUCCEEDED(hres)) {
hres = IOleObject_GetMiscStatus(ole_obj, DVASPECT_CONTENT, &status);
TRACE("GetMiscStatus returned %08x %x\n", hres, status);
hres = IOleObject_SetClientSite(ole_obj, &host->IOleClientSite_iface);
IOleObject_Release(ole_obj);
if(FAILED(hres)) {
FIXME("SetClientSite failed: %08x\n", hres);
return;
}
}else {
TRACE("Plugin does not support IOleObject\n");
}
}
load_plugin(host);
if(ole_obj) {
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IViewObjectEx, (void**)&view_obj);
if(SUCCEEDED(hres)) {
DWORD view_status = 0;
hres = IViewObjectEx_SetAdvise(view_obj, DVASPECT_CONTENT, 0, (IAdviseSink*)&host->IAdviseSinkEx_iface);
if(FAILED(hres))
WARN("SetAdvise failed: %08x\n", hres);
hres = IViewObjectEx_GetViewStatus(view_obj, &view_status);
IViewObjectEx_Release(view_obj);
TRACE("GetViewStatus returned %08x %x\n", hres, view_status);
}
}
update_readystate(host);
/* NOTE: Native QIs for IActiveScript, an undocumented IID, IOleControl and IRunnableObject */
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) {
FIXME("Use IDispatchEx\n");
host->disp = (IDispatch*)dispex;
}else {
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IDispatch, (void**)&disp);
if(SUCCEEDED(hres))
host->disp = disp;
else
TRACE("no IDispatch iface\n");
}
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(SUCCEEDED(hres)) {
FIXME("Use IOleCommandTarget\n");
IOleCommandTarget_Release(cmdtrg);
}
//.........这里部分代码省略.........
开发者ID:miurahr,项目名称:wine,代码行数:101,代码来源:pluginhost.c
示例20: OleObject_SetClientSite
//.........这里部分代码省略.........
LPOLESTR key_path = NULL, override_key_path = NULL;
IDocHostUIHandler2 *pDocHostUIHandler2;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo);
if(SUCCEEDED(hres)) {
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
update_hostinfo(This->doc_obj, &hostinfo);
This->doc_obj->hostinfo = hostinfo;
}
if(!hostui_setup) {
hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
if(hres == S_OK && key_path) {
if(key_path[0]) {
/* FIXME: use key_path */
TRACE("key_path = %s\n", debugstr_w(key_path));
}
CoTaskMemFree(key_path);
}
hres = IDocHostUIHandler_QueryInterface(pDocHostUIHandler, &IID_IDocHostUIHandler2,
(void**)&pDocHostUIHandler2);
if(SUCCEEDED(hres)) {
hres = IDocHostUIHandler2_GetOverrideKeyPath(pDocHostUIHandler2, &override_key_path, 0);
if(hres == S_OK && override_key_path && override_key_path[0]) {
if(override_key_path[0]) {
/*FIXME: use override_key_path */
TRACE("override_key_path = %s\n", debugstr_w(override_key_path));
}
CoTaskMemFree(override_key_path);
}
IDocHostUIHandler2_Release(pDocHostUIHandler2);
}
This->doc_obj->hostui_setup = TRUE;
}
}
/* Native calls here GetWindow. What is it for?
* We don't have anything to do with it here (yet). */
if(pClientSite) {
IOleWindow *pOleWindow = NULL;
HWND hwnd;
hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleWindow, (void**)&pOleWindow);
if(SUCCEEDED(hres)) {
IOleWindow_GetWindow(pOleWindow, &hwnd);
IOleWindow_Release(pOleWindow);
}
}
hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT var;
OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
if(!hostui_setup) {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)HTMLWINDOW2(This->window);
IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
}
IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);
V_VT(&var) = VT_I4;
V_I4(&var) = 0;
IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX,
OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS,
OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
IOleCommandTarget_Release(cmdtrg);
}
IOleClientSite_AddRef(pClientSite);
This->doc_obj->client = pClientSite;
This->doc_obj->hostui = pDocHostUIHandler;
if(This->doc_obj->usermode == UNKNOWN_USERMODE)
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
WARN("V_VT(silent) = %d\n", V_VT(&silent));
else if(V_BOOL(&silent))
FIXME("silent == true\n");
}
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_PALETTE);
return S_OK;
}
开发者ID:bilboed,项目名称:wine,代码行数:101,代码来源:oleobj.c
注:本文中的IOleCommandTarget_Release函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论