Made IEBrowser handle externals
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
#include "DeleteListener.h"
|
#include "DeleteListener.h"
|
||||||
#include "CameraButtonListener.h"
|
#include "CameraButtonListener.h"
|
||||||
#include "RotateButtonListener.h"
|
#include "RotateButtonListener.h"
|
||||||
//#define LEGACY_LOAD_G3DFUN_LEVEL
|
#define LEGACY_LOAD_G3DFUN_LEVEL
|
||||||
Ray testRay;
|
Ray testRay;
|
||||||
static int cursorid = 0;
|
static int cursorid = 0;
|
||||||
static int cursorOvrid = 0;
|
static int cursorOvrid = 0;
|
||||||
@@ -113,7 +113,7 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
|||||||
Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer);
|
Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer);
|
||||||
ShowWindow(_hwndRenderer, SW_SHOW);
|
ShowWindow(_hwndRenderer, SW_SHOW);
|
||||||
ShowWindow(_hWndMain, SW_SHOW);
|
ShowWindow(_hWndMain, SW_SHOW);
|
||||||
|
|
||||||
quit=false;
|
quit=false;
|
||||||
rightButtonHolding=false;
|
rightButtonHolding=false;
|
||||||
mouseOnScreen=false;
|
mouseOnScreen=false;
|
||||||
@@ -135,6 +135,8 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
|||||||
SetWindowLongPtr(_hwndRenderer,GWL_USERDATA,(LONG)this);
|
SetWindowLongPtr(_hwndRenderer,GWL_USERDATA,(LONG)this);
|
||||||
_propWindow = new PropertyWindow(0, 0, 200, 640, hThisInstance);
|
_propWindow = new PropertyWindow(0, 0, 200, 640, hThisInstance);
|
||||||
webBrowser = new IEBrowser(_hwndToolbox);
|
webBrowser = new IEBrowser(_hwndToolbox);
|
||||||
|
|
||||||
|
SetWindowLongPtr(_hwndToolbox,GWL_USERDATA+1,(LONG)webBrowser);
|
||||||
//webBrowser->navigateSyncURL(L"http://androdome.com/res/ClientToolbox.php");
|
//webBrowser->navigateSyncURL(L"http://androdome.com/res/ClientToolbox.php");
|
||||||
navigateToolbox(GetFileInPath("/content/page/controller.html"));
|
navigateToolbox(GetFileInPath("/content/page/controller.html"));
|
||||||
|
|
||||||
@@ -342,7 +344,7 @@ void eject(PartInstance * colliding, PartInstance * collider)
|
|||||||
if(colliding == collider || !colliding->canCollide || !collider->canCollide)
|
if(colliding == collider || !colliding->canCollide || !collider->canCollide)
|
||||||
return;
|
return;
|
||||||
if(G3D::CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(collider->getBox(), colliding->getBox()))
|
if(G3D::CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(collider->getBox(), colliding->getBox()))
|
||||||
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3);
|
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3F);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,54 @@
|
|||||||
|
|
||||||
#include "IEBrowser.h"
|
#include "IEBrowser.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
#pragma once
|
||||||
#include "ax.h"
|
#include "ax.h"
|
||||||
|
|
||||||
void IEBrowser::Boop(char* test)
|
HRESULT IEBrowser::doExternal(std::wstring funcName,
|
||||||
|
DISPID dispIdMember,
|
||||||
|
REFIID riid,
|
||||||
|
LCID lcid,
|
||||||
|
WORD wFlags,
|
||||||
|
DISPPARAMS FAR* pDispParams,
|
||||||
|
VARIANT FAR* pVarResult,
|
||||||
|
EXCEPINFO FAR* pExcepInfo,
|
||||||
|
unsigned int FAR* puArgErr)
|
||||||
{
|
{
|
||||||
// External functions may end up here in the future
|
if (funcName==L"Insert")
|
||||||
|
{
|
||||||
|
|
||||||
|
MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
else if (funcName==L"Boop")
|
||||||
|
{
|
||||||
|
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
|
||||||
|
}
|
||||||
|
else if (funcName==L"SetController")
|
||||||
|
{
|
||||||
|
bool ding = false;
|
||||||
|
//int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1;
|
||||||
|
//char * args = new char[len];
|
||||||
|
//WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE);
|
||||||
|
if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7)
|
||||||
|
return S_OK;
|
||||||
|
Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal;
|
||||||
|
for(size_t i = 0; i < g_selectedInstances.size(); i++)
|
||||||
|
{
|
||||||
|
if(PVInstance* part = dynamic_cast<PVInstance*>(g_selectedInstances.at(i)))
|
||||||
|
{
|
||||||
|
ding = true;
|
||||||
|
part->controller = cont;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ding)
|
||||||
|
AudioPlayer::playSound(dingSound);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEBrowser::IEBrowser(HWND attachHWnd) {
|
IEBrowser::IEBrowser(HWND attachHWnd) {
|
||||||
@@ -39,7 +82,7 @@ IEBrowser::~IEBrowser(void) {
|
|||||||
|
|
||||||
bool IEBrowser::navigateSyncURL(wchar_t* url)
|
bool IEBrowser::navigateSyncURL(wchar_t* url)
|
||||||
{
|
{
|
||||||
MSG messages;
|
//MSG messages;
|
||||||
if (webBrowser)
|
if (webBrowser)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
13
IEBrowser.h
13
IEBrowser.h
@@ -1,16 +1,27 @@
|
|||||||
//#include "WindowFunctions.h"
|
//#include "WindowFunctions.h"
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "Globals.h"
|
||||||
|
#pragma once
|
||||||
#include <mshtml.h>
|
#include <mshtml.h>
|
||||||
#include <exdisp.h>
|
#include <exdisp.h>
|
||||||
#include <Mshtmhst.h>
|
#include <Mshtmhst.h>
|
||||||
#include "IEDispatcher.h"
|
#include "IEDispatcher.h"
|
||||||
|
#include "AudioPlayer.h"
|
||||||
|
|
||||||
class IEBrowser {
|
class IEBrowser {
|
||||||
public:
|
public:
|
||||||
IEBrowser(HWND attachHWnd);
|
IEBrowser(HWND attachHWnd);
|
||||||
~IEBrowser(void);
|
~IEBrowser(void);
|
||||||
bool navigateSyncURL(wchar_t* url);
|
bool navigateSyncURL(wchar_t* url);
|
||||||
void Boop(char* test);
|
HRESULT doExternal(std::wstring funcName,
|
||||||
|
DISPID dispIdMember,
|
||||||
|
REFIID riid,
|
||||||
|
LCID lcid,
|
||||||
|
WORD wFlags,
|
||||||
|
DISPPARAMS FAR* pDispParams,
|
||||||
|
VARIANT FAR* pVarResult,
|
||||||
|
EXCEPINFO FAR* pExcepInfo,
|
||||||
|
unsigned int FAR* puArgErr);
|
||||||
private:
|
private:
|
||||||
IWebBrowser2* webBrowser;
|
IWebBrowser2* webBrowser;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|||||||
41
ax.cpp
41
ax.cpp
@@ -505,43 +505,10 @@ HRESULT _stdcall AXClientSite :: Invoke(
|
|||||||
EXCEPINFO FAR* pExcepInfo,
|
EXCEPINFO FAR* pExcepInfo,
|
||||||
unsigned int FAR* puArgErr)
|
unsigned int FAR* puArgErr)
|
||||||
{
|
{
|
||||||
|
IEBrowser * browser = (IEBrowser *)GetWindowLongPtr(Window,GWL_USERDATA+1);
|
||||||
if (m_lastExternalName==L"Insert")
|
return browser->doExternal(m_lastExternalName,dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||||
{
|
|
||||||
|
//return S_OK;
|
||||||
MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
else if (m_lastExternalName==L"Boop")
|
|
||||||
{
|
|
||||||
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
|
|
||||||
}
|
|
||||||
else if (m_lastExternalName==L"SetController")
|
|
||||||
{
|
|
||||||
bool ding = false;
|
|
||||||
//int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1;
|
|
||||||
//char * args = new char[len];
|
|
||||||
//WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE);
|
|
||||||
if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7)
|
|
||||||
return S_OK;
|
|
||||||
Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal;
|
|
||||||
for(size_t i = 0; i < g_selectedInstances.size(); i++)
|
|
||||||
{
|
|
||||||
if(PVInstance* part = dynamic_cast<PVInstance*>(g_selectedInstances.at(i)))
|
|
||||||
{
|
|
||||||
ding = true;
|
|
||||||
part->controller = cont;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(ding)
|
|
||||||
AudioPlayer::playSound(dingSound);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3
ax.h
3
ax.h
@@ -3,6 +3,8 @@
|
|||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include <mshtmhst.h>
|
#include <mshtmhst.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#pragma once
|
||||||
|
#include "IEBrowser.h"
|
||||||
|
|
||||||
// messages
|
// messages
|
||||||
#define AX_QUERYINTERFACE (WM_USER + 1)
|
#define AX_QUERYINTERFACE (WM_USER + 1)
|
||||||
@@ -40,7 +42,6 @@ class AXClientSite :
|
|||||||
bool CalledCanInPlace;
|
bool CalledCanInPlace;
|
||||||
|
|
||||||
class AX* ax;
|
class AX* ax;
|
||||||
|
|
||||||
// MyClientSite Methods
|
// MyClientSite Methods
|
||||||
AXClientSite();
|
AXClientSite();
|
||||||
virtual ~AXClientSite();
|
virtual ~AXClientSite();
|
||||||
|
|||||||
Binary file not shown.
1
main.cpp
1
main.cpp
@@ -176,7 +176,6 @@ int main(int argc, char** argv) {
|
|||||||
try{
|
try{
|
||||||
hresult = OleInitialize(NULL);
|
hresult = OleInitialize(NULL);
|
||||||
|
|
||||||
HRESULT hr;
|
|
||||||
/* IInternetSecurityManager *pSecurityMgr;
|
/* IInternetSecurityManager *pSecurityMgr;
|
||||||
IInternetZoneManager *pZoneMgr;
|
IInternetZoneManager *pZoneMgr;
|
||||||
LPCWSTR site1 = SysAllocString(L"http://www.androdome.com");
|
LPCWSTR site1 = SysAllocString(L"http://www.androdome.com");
|
||||||
|
|||||||
Reference in New Issue
Block a user