IEBrowser gets the external object. Nothing else.
This commit is contained in:
@@ -2,11 +2,13 @@
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "IEBrowser.h"
|
#include "IEBrowser.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "ax.h"
|
#include "ax.h"
|
||||||
|
//#include "IEDispatcher.h"
|
||||||
|
|
||||||
void IEBrowser::Boop(char* test)
|
void IEBrowser::Boop(char* test)
|
||||||
{
|
{
|
||||||
@@ -36,6 +38,12 @@ IEBrowser::~IEBrowser(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Something goes here
|
||||||
|
int IEBrowser::setExternal(IDispatch** ext)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
bool IEBrowser::navigateSyncURL(wchar_t* url)
|
bool IEBrowser::navigateSyncURL(wchar_t* url)
|
||||||
{
|
{
|
||||||
MSG messages;
|
MSG messages;
|
||||||
@@ -52,10 +60,39 @@ bool IEBrowser::navigateSyncURL(wchar_t* url)
|
|||||||
DispatchMessage(&messages);
|
DispatchMessage(&messages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep(30);
|
Sleep(30);
|
||||||
|
|
||||||
HRESULT hresult = webBrowser->get_Document(&spDocument);
|
HRESULT hresult = webBrowser->get_Document(&spDocument);
|
||||||
if (&spDocument!=0)
|
if (SUCCEEDED(hresult) && (spDocument != 0))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
IOleObject* spOleObject;
|
||||||
|
if (SUCCEEDED(spDocument->QueryInterface(IID_IOleObject,(void**)&spOleObject)))
|
||||||
|
{
|
||||||
|
IOleClientSite* spClientSite;
|
||||||
|
hresult = spOleObject->GetClientSite(&spClientSite);
|
||||||
|
if (SUCCEEDED(hresult) && spClientSite)
|
||||||
|
{
|
||||||
|
m_spDefaultDocHostUIHandler = spClientSite;
|
||||||
|
ICustomDoc* spCustomDoc;
|
||||||
|
|
||||||
|
//IEDispatcher* spIEDispatcher;
|
||||||
|
if (SUCCEEDED(m_spDefaultDocHostUIHandler->QueryInterface(IID_IDocHostUIHandler,(void**)&m_spHandler)))
|
||||||
|
{
|
||||||
|
if (SUCCEEDED(spDocument->QueryInterface(IID_ICustomDoc,(void**)&spCustomDoc)))
|
||||||
|
{
|
||||||
|
spCustomDoc->SetUIHandler(m_spHandler);
|
||||||
|
|
||||||
|
m_spHandler->GetExternal(&m_spExternal);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,4 +102,4 @@ bool IEBrowser::navigateSyncURL(wchar_t* url)
|
|||||||
MessageBox(NULL,"Cannot read IWebBrowser2...",(Globals::PlaceholderName+" Crash").c_str(),MB_OK);
|
MessageBox(NULL,"Cannot read IWebBrowser2...",(Globals::PlaceholderName+" Crash").c_str(),MB_OK);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <mshtml.h>
|
#include <mshtml.h>
|
||||||
#include <exdisp.h>
|
#include <exdisp.h>
|
||||||
//#include <Mshtmhst.h>
|
#include <Mshtmhst.h>
|
||||||
|
|
||||||
class IEBrowser {
|
class IEBrowser {
|
||||||
public:
|
public:
|
||||||
@@ -14,4 +14,10 @@ class IEBrowser {
|
|||||||
IWebBrowser2* webBrowser;
|
IWebBrowser2* webBrowser;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
IDispatch* spDocument;
|
IDispatch* spDocument;
|
||||||
|
IHTMLDocument* spDocument2;
|
||||||
|
IDocHostUIHandler* m_spHandler;
|
||||||
|
IDispatch* m_spExternal;
|
||||||
|
IDispatch* m_newExternal;
|
||||||
|
IOleClientSite* m_spDefaultDocHostUIHandler;
|
||||||
|
int setExternal(IDispatch** ext);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ HRESULT STDMETHODCALLTYPE IEDispatcher::GetIDsOfNames(const IID &, LPOLESTR *, U
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
|
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
|
||||||
|
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "oaidl.h"
|
#include "oaidl.h"
|
||||||
|
//DEFINE_GUID(CLSID_G3d, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6F);
|
||||||
|
|
||||||
|
/*
|
||||||
class IEDispatcher : public IDispatch
|
class IEDispatcher : public IDispatch
|
||||||
{
|
{
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN_C const IID IID_IDispatch;
|
||||||
|
|
||||||
|
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||||
|
|
||||||
|
MIDL_INTERFACE("B323F8E0-2E68-11D0-90EA-00AA0060F86F")
|
||||||
|
IEDispatcher : public IDispatch
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
IEDispatcher(void);
|
IEDispatcher(void);
|
||||||
~IEDispatcher(void);
|
~IEDispatcher(void);
|
||||||
@@ -15,3 +26,5 @@ public:
|
|||||||
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
|
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
13
main.cpp
13
main.cpp
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
// TODO: Move toolbar buttons with resized window.
|
// TODO: Move toolbar buttons with resized window.
|
||||||
|
|
||||||
|
|
||||||
#define _WIN32_WINNT 0x0400
|
#define _WIN32_WINNT 0x0400
|
||||||
|
|
||||||
#include <G3DAll.h>
|
#include <G3DAll.h>
|
||||||
@@ -46,8 +47,6 @@
|
|||||||
#endif
|
#endif
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
||||||
|
|
||||||
DEFINE_GUID(CLSID_G3d, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6F);
|
|
||||||
HRESULT hresult;
|
HRESULT hresult;
|
||||||
OLECHAR dat = ((OLECHAR)"SayHello");
|
OLECHAR dat = ((OLECHAR)"SayHello");
|
||||||
OLECHAR * szMember = &dat;
|
OLECHAR * szMember = &dat;
|
||||||
@@ -1321,16 +1320,6 @@ void Demo::onKeyPressed(int key)
|
|||||||
dataModel->getOpen();
|
dataModel->getOpen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG
|
|
||||||
if (key==VK_ADD)
|
|
||||||
{
|
|
||||||
dataModel->modXMLLevel(1);
|
|
||||||
}
|
|
||||||
if (key==VK_SUBTRACT)
|
|
||||||
{
|
|
||||||
dataModel->modXMLLevel(-1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
void Demo::onKeyUp(int key)
|
void Demo::onKeyUp(int key)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user