Click here to Skip to main content
15,915,600 members
Home / Discussions / COM
   

COM

 
GeneralCHtmlView Pin
alex.barylski24-Mar-04 22:09
alex.barylski24-Mar-04 22:09 
GeneralRe: CHtmlView Pin
Rob Manderson24-Mar-04 22:32
protectorRob Manderson24-Mar-04 22:32 
GeneralRe: CHtmlView Pin
alex.barylski25-Mar-04 0:11
alex.barylski25-Mar-04 0:11 
GeneralRe: CHtmlView Pin
Rob Manderson25-Mar-04 8:40
protectorRob Manderson25-Mar-04 8:40 
GeneralRe: CHtmlView Pin
alex.barylski25-Mar-04 12:06
alex.barylski25-Mar-04 12:06 
GeneralRe: CHtmlView Pin
Rob Manderson25-Mar-04 12:27
protectorRob Manderson25-Mar-04 12:27 
GeneralRe: CHtmlView Pin
alex.barylski25-Mar-04 13:00
alex.barylski25-Mar-04 13:00 
GeneralRe: CHtmlView Pin
Rob Manderson25-Mar-04 13:14
protectorRob Manderson25-Mar-04 13:14 
Hockey wrote:
Can I not use a BEGIN_EVENTSINK_MAP approach like CHtmlView does to just wrap IWebBrowser2 events but for IHTMLEditDesign as well...?

Nope. I did it like this.

My view class has an embedded variable of type CMSHTMLDisableDragHTMLEditDesigner (see previous reply) called m_designer. In the OnDocumentComplete() handler for the view I do this.
C++
.
.
.
CHtmlEditView::OnDocumentComplete(lpszURL);
m_pDoc = (IHTMLDocument2 *) GetHtmlDocument();
m_designer.Detach();
m_designer.Attach(m_pDoc);
.
.
.

The Attach() looks like this.
C++
BOOL CMSHTMLDisableDragHTMLEditDesigner::Attach(IHTMLDocument2 *pDoc)
{
    if (m_pServices != (IHTMLEditServices *) NULL)
        m_pServices->Release();

    IServiceProvider *pTemp;

    if (pDoc == (IHTMLDocument2 *) NULL)
        return FALSE;

    pDoc->QueryInterface(IID_IServiceProvider, (void **) &pTemp);

    if (pTemp != (IServiceProvider *) NULL)
    {
        if (pTemp->QueryService(SID_SHTMLEditServices, IID_IHTMLEditServices, (void **) &m_pServices) == S_OK)
        {
            if (m_pServices != (IHTMLEditServices *) NULL)
            {
                m_pServices->AddDesigner(this);
                return TRUE;
            }
        }
    }

    return FALSE;
}

and the Detach() looks like this.
C++
void CMSHTMLDisableDragHTMLEditDesigner::Detach()
{
    if (m_pServices != (IHTMLEditServices *) NULL)
        m_pServices->RemoveDesigner(this);
}

What this does is attach your edit designer to the document. MSHTML then calls the various member functions of the edit designer at the appropriate times. No eventsink involved.

I hope this helps Smile | :)

Rob Manderson

Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
GeneralRe: CHtmlView Pin
alex.barylski25-Mar-04 15:27
alex.barylski25-Mar-04 15:27 
GeneralRe: CHtmlView Pin
Rob Manderson25-Mar-04 15:50
protectorRob Manderson25-Mar-04 15:50 
GeneralRe: CHtmlView Pin
alex.barylski25-Mar-04 16:30
alex.barylski25-Mar-04 16:30 
GeneralRe: CHtmlView Pin
alex.barylski26-Mar-04 13:40
alex.barylski26-Mar-04 13:40 
GeneralRe: CHtmlView Pin
Rob Manderson26-Mar-04 13:56
protectorRob Manderson26-Mar-04 13:56 
GeneralSafeArray freak Pin
El'Cachubrey24-Mar-04 5:46
El'Cachubrey24-Mar-04 5:46 
QuestionMake a Composite Control (COM) be an OLE container? Pin
mangellj24-Mar-04 5:30
mangellj24-Mar-04 5:30 
QuestionActiveX storing data to be picked up by another ActiveX later? Pin
SysLo23-Mar-04 0:57
SysLo23-Mar-04 0:57 
AnswerRe: ActiveX storing data to be picked up by another ActiveX later? Pin
igor196024-Mar-04 15:01
igor196024-Mar-04 15:01 
GeneralRe: ActiveX storing data to be picked up by another ActiveX later? Pin
SysLo25-Mar-04 1:49
SysLo25-Mar-04 1:49 
GeneralI am unable to retrieve Combuilder in Matlab Pin
vil_0922-Mar-04 20:08
vil_0922-Mar-04 20:08 
QuestionWhat are issues when renaming a COM component? Pin
User 21559722-Mar-04 17:42
User 21559722-Mar-04 17:42 
AnswerRe: What are issues when renaming a COM component? Pin
Steve S22-Mar-04 22:07
Steve S22-Mar-04 22:07 
GeneralRe: What are issues when renaming a COM component? Pin
User 21559723-Mar-04 0:00
User 21559723-Mar-04 0:00 
Generaluse VB COM in C++ Pin
Cuu22-Mar-04 5:18
Cuu22-Mar-04 5:18 
GeneralRe: use VB COM in C++ Pin
Nick Parker22-Mar-04 18:07
protectorNick Parker22-Mar-04 18:07 
QuestionHow to register a proxy/stub DLL on the client? Pin
pelos21-Mar-04 10:54
pelos21-Mar-04 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.