diff --git a/direct/src/plugin_activex/P3DActiveX.vcproj b/direct/src/plugin_activex/P3DActiveX.vcproj
index 7ce52d868e..ccb33b68a5 100644
--- a/direct/src/plugin_activex/P3DActiveX.vcproj
+++ b/direct/src/plugin_activex/P3DActiveX.vcproj
@@ -1,272 +1,275 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/direct/src/plugin_activex/PPInstance.cpp b/direct/src/plugin_activex/PPInstance.cpp
index 4345cd2266..0219dfe0a2 100644
--- a/direct/src/plugin_activex/PPInstance.cpp
+++ b/direct/src/plugin_activex/PPInstance.cpp
@@ -492,7 +492,7 @@ int PPInstance::Start( const std::string& p3dFilename )
nout << "Error creating P3D instance: " << GetLastError() << "\n";
return 1;
}
- CComPtr pDispatch;
+ CComPtr pDispatch;
PPBrowserObject *pobj = new PPBrowserObject( &m_parentCtrl, pDispatch );
P3D_instance_set_browser_script_object( m_p3dInstance, pobj );
P3D_OBJECT_DECREF( pobj );
diff --git a/direct/src/plugin_activex/PPInterface.cpp b/direct/src/plugin_activex/PPInterface.cpp
index 388914d2d3..fab4f079e8 100644
--- a/direct/src/plugin_activex/PPInterface.cpp
+++ b/direct/src/plugin_activex/PPInterface.cpp
@@ -56,8 +56,19 @@ HRESULT PPInterface::Invoke(int nType, IDispatch* pDisp, CString& ptName, VARIAN
DISPPARAMS dp = { NULL, NULL, 0, 0 };
DISPID dispidNamed = DISPID_PROPERTYPUT;
DISPID dispID;
+ CComPtr pDispEx;
HRESULT hr = GetIdOfName( pDisp, ptName, &dispID );
+ if ( DISP_E_UNKNOWNNAME == hr )
+ {
+ hr = pDisp->QueryInterface( IID_IDispatchEx, ( void** )&pDispEx );
+ if ( SUCCEEDED( hr ) && pDispEx )
+ {
+ OLECHAR* pElementName = ptName.AllocSysString();
+ hr = pDispEx->GetDispID( pElementName, fdexNameEnsure, &dispID );
+ SysFreeString( pElementName );
+ }
+ }
if ( FAILED( hr ) )
{
return hr;
@@ -90,9 +101,16 @@ HRESULT PPInterface::Invoke(int nType, IDispatch* pDisp, CString& ptName, VARIAN
}
// Make the call!
- hr = pDisp->Invoke( dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT,
- nType, &dp, pvResult, NULL, NULL );
-
+ if ( pDispEx )
+ {
+ hr = pDispEx->InvokeEx(dispID, LOCALE_USER_DEFAULT,
+ nType, &dp, pvResult, NULL, NULL);
+ }
+ else
+ {
+ hr = pDisp->Invoke( dispID, IID_NULL, LOCALE_USER_DEFAULT,
+ nType, &dp, pvResult, NULL, NULL );
+ }
delete [] pArgs;
return hr;
@@ -118,6 +136,12 @@ HRESULT PPInterface::GetHtmlDocDispatch( CComPtr& pDispScript )
hr = pHtmlDoc->get_Script( &pDispScript );
ASSERT( SUCCEEDED( hr ) && pDispScript );
+ CComPtr pDispExScript;
+ hr = pDispScript->QueryInterface( IID_IDispatchEx, ( void** )&pDispExScript );
+ ASSERT( SUCCEEDED( hr ) && pDispExScript );
+
+ pDispScript = pDispExScript;
+
CComPtr pTypeInfo;
hr = pDispScript->GetTypeInfo( 0, 0, &pTypeInfo );
diff --git a/direct/src/plugin_activex/PPLogger.cpp b/direct/src/plugin_activex/PPLogger.cpp
index a45d27248e..17540707fe 100644
--- a/direct/src/plugin_activex/PPLogger.cpp
+++ b/direct/src/plugin_activex/PPLogger.cpp
@@ -16,6 +16,7 @@
#include "windows.h"
#include "PPLogger.h"
+#include "mkdir_complete.h"
std::ofstream PPLogger::m_logfile;
bool PPLogger::m_isOpen = false;
@@ -107,7 +108,7 @@ void PPLogger::Open( const std::string &rootDir )
if (log_directory.empty()) {
log_directory = rootDir + "/log";
}
- mkdir_complete(log_directory, cerr);
+ mkdir_complete(log_directory, std::cerr);
// Ensure that the log directory ends with a slash.
if (!log_directory.empty() && log_directory[log_directory.size() - 1] != '/') {
@@ -132,8 +133,8 @@ void PPLogger::Open( const std::string &rootDir )
log_pathname += ".log";
m_logfile.clear();
- m_logfile.open(log_pathname.c_str(), ios::out | ios::trunc);
- m_logfile.setf(ios::unitbuf);
+ m_logfile.open(log_pathname.c_str(), std::ios::out | std::ios::trunc);
+ m_logfile.setf(std::ios::unitbuf);
}
// If we didn't have a logfile name compiled in, we throw away log
diff --git a/direct/src/plugin_activex/stdafx.h b/direct/src/plugin_activex/stdafx.h
index 54c7e2fe84..585130917c 100644
--- a/direct/src/plugin_activex/stdafx.h
+++ b/direct/src/plugin_activex/stdafx.h
@@ -41,3 +41,5 @@
#include // MFC DAO database classes
#include
+#include
+