summaryrefslogtreecommitdiff
path: root/extensions/source/activex/main
diff options
context:
space:
mode:
authorMikhail Voitenko <mav@openoffice.org>2002-08-26 06:39:11 +0000
committerMikhail Voitenko <mav@openoffice.org>2002-08-26 06:39:11 +0000
commite5b55ae7e326a89e874e8976c5b69b5af8a34092 (patch)
tree50de7ccd5653c0df56577f18208e8e2d735d720e /extensions/source/activex/main
parentaafdab9b8b2e25c926ce7bb41b96536585b6fb86 (diff)
#101937# improve registration
Diffstat (limited to 'extensions/source/activex/main')
-rw-r--r--extensions/source/activex/main/SODispatchInterceptor.cpp11
-rw-r--r--extensions/source/activex/main/SODispatchInterceptor.h6
-rw-r--r--extensions/source/activex/main/so_activex.cpp15
3 files changed, 28 insertions, 4 deletions
diff --git a/extensions/source/activex/main/SODispatchInterceptor.cpp b/extensions/source/activex/main/SODispatchInterceptor.cpp
index 048f0e606734..c3b8f5b3b4f7 100644
--- a/extensions/source/activex/main/SODispatchInterceptor.cpp
+++ b/extensions/source/activex/main/SODispatchInterceptor.cpp
@@ -47,7 +47,14 @@ STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL,
if( !strncmp( OLE2T( aTargetUrl.bstrVal ), "ftp://", 6 )
|| !strncmp( OLE2T( aTargetUrl.bstrVal ), "http://", 7 )
|| !strncmp( OLE2T( aTargetUrl.bstrVal ), "file://", 7 ) )
- *retVal = this;
+ {
+ CComQIPtr< IDispatch, &IID_IDispatch > pIDisp( this );
+ if( pIDisp )
+ {
+ this->AddRef();
+ *retVal = pIDisp;
+ }
+ }
else
{
if( !m_xSlave )
@@ -63,9 +70,11 @@ STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL,
if( !SUCCEEDED( hr ) || aResult.vt != VT_DISPATCH || aResult.pdispVal == NULL ) return E_FAIL;
*retVal = aResult.pdispVal;
+ /* following code is workaround for UNO bug
CComQIPtr< IUnknown, &IID_IUnknown > pIUnk( *retVal );
if( pIUnk )
(*retVal)->AddRef();
+ */
}
return S_OK;
diff --git a/extensions/source/activex/main/SODispatchInterceptor.h b/extensions/source/activex/main/SODispatchInterceptor.h
index 922349bd0d38..d355a653cdbb 100644
--- a/extensions/source/activex/main/SODispatchInterceptor.h
+++ b/extensions/source/activex/main/SODispatchInterceptor.h
@@ -123,7 +123,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SODISPATCHINTERCEPTOR)
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
/* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
{
- *pVal = SafeArrayCreateVector( VT_BSTR, 0, 3 );
+ *pVal = SafeArrayCreateVector( VT_BSTR, 0, 4 );
if( !*pVal )
return E_FAIL;
@@ -139,11 +139,11 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SODISPATCHINTERCEPTOR)
ix = 2;
aInterface = CComBSTR( OLESTR( "com.sun.star.frame.XDispatch" ) );
SafeArrayPutElement( *pVal, &ix, aInterface );
- /*
+
ix = 3;
aInterface = CComBSTR( OLESTR( "com.sun.star.frame.XInterceptorInfo" ) );
SafeArrayPutElement( *pVal, &ix, aInterface );
- */
+
return S_OK;
}
};
diff --git a/extensions/source/activex/main/so_activex.cpp b/extensions/source/activex/main/so_activex.cpp
index bbcd2f023e01..4e54d9f27178 100644
--- a/extensions/source/activex/main/so_activex.cpp
+++ b/extensions/source/activex/main/so_activex.cpp
@@ -83,9 +83,14 @@ const char* aMimeType[] = { "application/vnd.stardivision.chart",
const char* aClassID = "{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}";
const char* aTypeLib = "{61FA3F13-8061-4796-B055-3697ED28CB38}";
+// ISOComWindowPeer interface information
const char* aInterIDWinPeer = "{BF5D10F3-8A10-4A0B-B150-2B6AA2D7E118}";
const char* aProxyStubWinPeer = "{00020424-0000-0000-C000-000000000046}";
+// ISODispatchInterceptor interface information
+const char* aInterIDDispInt = "{9337694C-B27D-4384-95A4-9D8E0EABC9E5}";
+const char* aProxyStubDispInt = "{00020424-0000-0000-C000-000000000046}";
+
const char* aLocalPrefix = "Software\\Classes\\";
BOOL createKey( HKEY hkey,
@@ -187,6 +192,12 @@ STDAPI DllRegisterServerNative( BOOL bForAllUsers )
&& createKey( hkey2, "ProxyStubClsid32", aProxyStubWinPeer )
&& createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" )
&& ERROR_SUCCESS == RegCloseKey( hkey2 )
+ && createKey( hkey1, aInterIDDispInt, "ISODispatchInterceptor" )
+ && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDDispInt, &hkey2 )
+ && createKey( hkey2, "ProxyStubClsid", aProxyStubDispInt )
+ && createKey( hkey2, "ProxyStubClsid32", aProxyStubDispInt )
+ && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" )
+ && ERROR_SUCCESS == RegCloseKey( hkey2 )
&& ERROR_SUCCESS == RegCloseKey( hkey1 )
&& ERROR_SUCCESS == RegCloseKey( hkey ) );
}
@@ -276,6 +287,10 @@ STDAPI DllUnregisterServerNative( BOOL bForAllUsers )
if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_CLASSES_ROOT : HKEY_CURRENT_USER, aSubKey ) )
fErr = TRUE;
+ wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDDispInt );
+ if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_CLASSES_ROOT : HKEY_CURRENT_USER, aSubKey ) )
+ fErr = TRUE;
+
return !fErr;
}