Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ordinal not found Pin
JensB22-May-03 6:59
JensB22-May-03 6:59 
Questionkill process by name ? Pin
bob_brown_200022-May-03 4:32
bob_brown_200022-May-03 4:32 
AnswerRe: kill process by name ? Pin
valikac22-May-03 5:08
valikac22-May-03 5:08 
GeneralRe: kill process by name ? Pin
bob_brown_200022-May-03 5:39
bob_brown_200022-May-03 5:39 
Generalmember function as callback function problem Pin
yccheok22-May-03 4:31
yccheok22-May-03 4:31 
GeneralRe: member function as callback function problem Pin
AlexO22-May-03 5:00
AlexO22-May-03 5:00 
GeneralRe: member function as callback function problem Pin
csc22-May-03 5:01
csc22-May-03 5:01 
GeneralCatch WebBrowserEvents Pin
snajper22-May-03 4:18
snajper22-May-03 4:18 
Hi all,

I'm trying to catch WebBrowserEvents from within the toolband. This is basicaly the code im using, but it doesnt seem to work. Has anyone done this before and/or sees what im doing wrong.

class ATL_NO_VTABLE CToolbar :
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<ctoolbar, &clsid_toolbar="">,
public IDeskBand,
public IObjectWithSiteImpl<ctoolbar>,
public IInputObject,
public IDispatchImpl<itoolbar, &iid_itoolbar,="" &libid_guciolib="">,
public IDispEventImpl<0, CToolbar, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 0>

...

BEGIN_SINK_MAP(CToolbar)
SINK_ENTRY_EX(0, DIID_DWebBrowserEvents2, DISPID_ONFULLSCREEN,OnFullScreen)
SINK_ENTRY_EX(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, BeforeNavigate2)
END_SINK_MAP()

...
public:
STDMETHOD(OnFullScreen) (BOOL FullScreen);
STDMETHOD(BeforeNavigate2) (LPDISPATCH pDisp , VARIANT* URL,VARIANT* Flags, VARIANT* TargetFrameName,VARIANT* PostData, VARIANT* Headers, BOOL* Cancel);

...


STDMETHODIMP CToolbar::FullScreen(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
{
::MessageBox(NULL,"ONFULLSCREEN event!","IE",MB_OK);
return 0;
}
STDMETHODIMP CToolbar::BeforeNavigate2(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
{
::MessageBox(NULL,"ONBEFORENAVIGATE event!","IE",MB_OK);
return 0;
}

Greeting
snajper
GeneralRe: Catch WebBrowserEvents Pin
Joan M22-May-03 21:18
professionalJoan M22-May-03 21:18 
GeneralCustomize button in MessageBox function Pin
Piccinano22-May-03 3:29
Piccinano22-May-03 3:29 
GeneralRe: Customize button in MessageBox function Pin
AlexO22-May-03 5:09
AlexO22-May-03 5:09 
GeneralRe: Customize button in MessageBox function Pin
valikac22-May-03 5:10
valikac22-May-03 5:10 
GeneralRe: Customize button in MessageBox function Pin
David Crow22-May-03 6:54
David Crow22-May-03 6:54 
GeneralRe: Customize button in MessageBox function Pin
peterchen22-May-03 8:09
peterchen22-May-03 8:09 
QuestionConvert IP4_ADDRESS to string ? Pin
ScorpioMidget22-May-03 2:46
ScorpioMidget22-May-03 2:46 
AnswerRe: Convert IP4_ADDRESS to string ? Pin
Rage22-May-03 3:24
professionalRage22-May-03 3:24 
GeneralRe: Convert IP4_ADDRESS to string ? Pin
ScorpioMidget22-May-03 3:47
ScorpioMidget22-May-03 3:47 
AnswerRe: Convert IP4_ADDRESS to string ? Pin
David Crow22-May-03 3:26
David Crow22-May-03 3:26 
GeneralRe: Convert IP4_ADDRESS to string ? Pin
ScorpioMidget22-May-03 3:48
ScorpioMidget22-May-03 3:48 
QuestionMSComm Control exits with error? Pin
Bruce W. Brooksher22-May-03 2:45
sussBruce W. Brooksher22-May-03 2:45 
AnswerRe: MSComm Control exits with error? Pin
Trollslayer22-May-03 3:51
mentorTrollslayer22-May-03 3:51 
GeneralRe: MSComm Control exits with error? Pin
jia_wei22-May-03 19:01
jia_wei22-May-03 19:01 
GeneralEnumerating Domain Controllers Pin
Lhenno Ferrari22-May-03 2:29
Lhenno Ferrari22-May-03 2:29 
QuestionHow to hide a button? Pin
Vassili22-May-03 2:24
Vassili22-May-03 2:24 
AnswerRe: How to hide a button? Pin
David Crow22-May-03 2:33
David Crow22-May-03 2:33 

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.