From 4f415cf98b3a6236d7b14394c5d3b83bf3ac0afe Mon Sep 17 00:00:00 2001 From: andreja6 Date: Mon, 9 Mar 2020 23:55:13 -0700 Subject: [PATCH] Added controllerflag selection --- Globals.h | 2 +- IEBrowser.cpp | 1 + ax.cpp | 32 ++++++++++++++++++++++++++------ ax.h | 2 ++ content/page/controller.html | 10 +++++----- main.cpp | 13 +++++++++++++ 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/Globals.h b/Globals.h index b3dba1c..e13f6dd 100644 --- a/Globals.h +++ b/Globals.h @@ -1,6 +1,6 @@ #pragma once #include "DataModelInstance.h" -#include + class Application; diff --git a/IEBrowser.cpp b/IEBrowser.cpp index d3848dd..62d3737 100644 --- a/IEBrowser.cpp +++ b/IEBrowser.cpp @@ -42,6 +42,7 @@ bool IEBrowser::navigateSyncURL(wchar_t* url) MSG messages; if (webBrowser) { + webBrowser->Navigate(url,0,0,0,0); } else diff --git a/ax.cpp b/ax.cpp index b8ce2e1..0c4b4fc 100644 --- a/ax.cpp +++ b/ax.cpp @@ -1,10 +1,7 @@ // AX.CPP -#include -#include -#include -#include #include "ax.h" - +#include "AudioPlayer.h" +#include "Enum.h" #pragma warning (disable: 4311) #pragma warning (disable: 4312) @@ -106,6 +103,8 @@ STDMETHODIMP AXClientSite :: FilterDataObject( IDataObject *pDO, IDataObject **p STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject) { *ppvObject = 0; + // if (iid == IID_IOleInPlaceSite) + // *ppvObject = (IOleInPlaceSite*)this; if (iid == IID_IOleClientSite) *ppvObject = (IOleClientSite*)this; if (iid == IID_IUnknown) @@ -114,7 +113,7 @@ STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject) *ppvObject = (IAdviseSink*)this; if (iid == IID_IDispatch) *ppvObject = (IDispatch*)this; - if (ExternalPlace == false) + //if (ExternalPlace == false) { if (iid == IID_IOleInPlaceSite) *ppvObject = (IOleInPlaceSite*)this; @@ -517,6 +516,27 @@ HRESULT _stdcall AXClientSite :: Invoke( { 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(g_selectedInstances.at(i))) + { + ding = true; + part->controller = cont; + } + } + if(ding) + AudioPlayer::playSound(dingSound); + return S_OK; + } else { return E_NOTIMPL; diff --git a/ax.h b/ax.h index 6f56add..10c1cc7 100644 --- a/ax.h +++ b/ax.h @@ -1,4 +1,6 @@ // AX.H +#pragma once +#include "Globals.h" #include #include diff --git a/content/page/controller.html b/content/page/controller.html index db7c5e8..bed95b0 100644 --- a/content/page/controller.html +++ b/content/page/controller.html @@ -12,10 +12,10 @@ } - - - - - + + + + + \ No newline at end of file diff --git a/main.cpp b/main.cpp index 6b516bf..3cf9e6c 100644 --- a/main.cpp +++ b/main.cpp @@ -175,6 +175,19 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int main(int argc, char** argv) { try{ hresult = OleInitialize(NULL); + + HRESULT hr; +/* IInternetSecurityManager *pSecurityMgr; + IInternetZoneManager *pZoneMgr; + LPCWSTR site1 = SysAllocString(L"http://www.androdome.com"); + + hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr); + + pSecurityMgr->SetZoneMapping((DWORD)2, site1, (DWORD)0); // 2 = Trusted Site, site1 is the URL to add, and 0 is to create the entry. +*/ + + + if (!AXRegister()) return 0;