Re: Problem understanding how WebBrowser Control communicates with APP

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 04/26/04


Date: Mon, 26 Apr 2004 09:28:53 -0400


"Martin Payne" <martin@microcosm.co.uk> wrote in message
news:408cdcbe.6057109@news.eclipse.co.uk
>> Yes. That's why you register a class factory with the
>> IInternetSession, not the APP itself. The class factory should
>> manufacture new instances on demand.
>>
>> When your implementation of IClassFactory::CreateInstance is called,
>> you - surprise - create an instance.
>
> That is my problem - I do not have an implmentation of the
> IClassFactory. To be honest I do not really know how to do this. I
> based my code around the CBitmappAPP that you sent me (from my 6 Feb
> post) which calls CreateInstance for the IClassFactory but does not
> implement the CreateInstance anywhere.

It uses ATL's stock IClassFactory implementation. If you use ATL, that's
how you can get it:

IClassFactory* pCF;
HRESULT hr = YourClass::_ClassFactoryCreatorClass::CreateInstance(
    YourClass::_CreatorClass::CreateInstance,
    IID_IClassFactory,
    reinterpret_cast<void**>(&pCF));

Otherwise, write a simple COM object that implements IClassFactory
interface.

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Relevant Pages

  • Re: Problem understanding how WebBrowser Control communicates with APP
    ... That's why you register a class factory with the IInternetSession, ... post) which calls CreateInstance for the IClassFactory but does not ... Could you also let me have the IClassFactory code for this sample so I ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Why need IClassFactory?
    ... You need IClassFactory whenever you wish another component (yours or anyone ... Alexander says, It uses the CLSID or ProgId specified in the registry to ... I'm by no means the first to point out that "class factory" is a bad name, ... A google for "factory pattern" will give you a more general discussion. ...
    (microsoft.public.vc.atl)
  • Re: IXMLHTTPRequest AJAX trace
    ... You still don't list IXMLHTTPRequest in your interface map. ... What relationship do you think IClassFactory ... Does CreateInstance get called at all? ... the second object creates an instance of the first ...
    (microsoft.public.vc.atl)
  • Re: COM CreateInstance method
    ... point is beyond the wellknown CreateInstance function in IClassFactory, ... "Alex Blekhman" wrote: ... IClassFactory interface. ... which does not belongs ...
    (microsoft.public.vc.language)
  • Re: COM CreateInstance method
    ... My point is beyond the wellknown CreateInstance function ... in IClassFactory, are there any other methods, which has the exact ... mean is the onewhich have the exact function name -- ...
    (microsoft.public.vc.language)