Re: how load html page from memory in ShowHTMLDialog function



"ragi" <ragi@xxxxxxxx> wrote in message
news:eyhwlfeeFHA.2420@xxxxxxxxxxxxxxxxxxxx
> I have now two QueryInterface method (one if from IUnknown):
>
>
> HRESULT STDMETHODCALLTYPE CHTMLMoniker::QueryInterface( REFIID riid,
> void __RPC_FAR *__RPC_FAR *ppvObject)
> {
> return E_NOTIMPL;
> }

Remove this one

> HRESULT STDMETHODCALLTYPE CHTMLMoniker::QueryInterface(REFIID riid,
> void *ppvObject)

The last parameter should be void** (two stars, not one). I've
copied'n'pasted your method signature and did not notice this error,
sorry.

> {
> if (!ppvObject)
> {
> return E_POINTER;
> }
> ppvObject = 0;

*ppvObject = 0;

> if (riid == IID_IUnknown || riid == IID_IPersist || riid ==
> IID_IPersistStream || riid == IID_IMoniker)
> {
> AddRef();
> ppvObject = static_cast<IMoniker*>(this);

*ppvObject = static_cast<IMoniker*>(this);

> return S_OK;
> }
> return E_NOINTERFACE;
> }
>
> I'm not sure if first QueryInterface should return E_NOTIMPL.
>
> -----------------------------------------
>
> This is my main method once again:
>
>
> int CHtmlDialog::DoModal()
> {
> HRESULT hr;
> //Now create a URL Moniker
> CHTMLMoniker* pUrlMoniker = new CHTMLMoniker;

Add pUrlMoniker->AddRef(), or alternatively set m_refCount to 1 in
CHTMLMoniker's constructor.

> CreateURLMoniker(NULL, bstrURL, (LPMONIKER*)&pUrlMoniker);

Remove this already. You do _not_ need a standard URL moniker. You
should _not_ call CreateURLMoniker. You overwrite your pUrlMoniker
variable that points to an instance of CHTMLMoniker class, with a
pointer to completely unrelated object.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: how load html page from memory in ShowHTMLDialog function
    ... HRESULT STDMETHODCALLTYPE CHTMLMoniker::QueryInterface(REFIID riid, void *ppvObject) ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • BHO
    ... STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) ... HRESULT STDMETHODCALLTYPE CreateInstance(LPUNKNOWN pUnk, REFIID riid, void** ... HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int FAR* pctinfo); ... HRESULT STDMETHODCALLTYPE GetTypeInfo(unsigned int iTInfo, LCID lcid, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: how load html page from memory in ShowHTMLDialog function
    ... HRESULT STDMETHODCALLTYPE CHTMLMoniker::QueryInterface( ... REFIID riid, void *ppvObject) ... ULONG STDMETHODCALLTYPE CHTMLMoniker::Release ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How to implement INSSBuffer?
    ... class TINSSBuffer: public INSSBuffer ... REFIID riid, ... HRESULT STDMETHODCALLTYPE TINSSBuffer::SetLength( ...
    (microsoft.public.windowsmedia.sdk)