Kaydet (Commit) 3481ba93 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS jl129

2009-07-08 09:24:14 +0200 jl  r273817 : #i103275# catching DisposedException when calling XDesktop.terminate, the test librariesversion_3_0_0.dll, ..3_0_1.dll, .. 3.1.dll have been recreated and checked in
2009-07-08 09:20:29 +0200 jl  r273816 : #
2009-07-07 10:51:52 +0200 jl  r273784 : #103378# allow to pass Nothing in Basic for uno null reference
2009-07-07 10:30:48 +0200 jl  r273781 : #103242# VS 2008 changes
2009-07-07 10:21:23 +0200 jl  r273778 : #103242
2009-07-07 10:12:20 +0200 jl  r273777 : #103242 adapting to VS 2008
2009-07-03 09:47:21 +0200 jl  r273679 : #i10324# fix build errors
2009-07-03 09:12:08 +0200 jl  r273677 : #i10324# fix build errors
2009-07-02 15:26:07 +0200 jl  r273657 : #i103242 make it build again
2009-07-02 14:39:34 +0200 jl  r273652 : #i103242 make it build again
2009-07-02 14:18:45 +0200 jl  r273650 : #i103242 remove warnings
2009-07-02 14:11:48 +0200 jl  r273648 : #i103242
2009-07-02 12:41:23 +0200 jl  r273637 : #i103242
2009-07-02 12:25:09 +0200 jl  r273636 : #i103242 upgraded to VS2008
2009-07-02 12:00:07 +0200 jl  r273632 : #i103242 upgraded to VS2008
2009-07-02 11:30:55 +0200 jl  r273630 : #i103242 test does not build anymore
2009-07-02 11:14:21 +0200 jl  r273629 : #i103242 test does not build anymore
2009-07-02 10:59:56 +0200 jl  r273628 : #i103242 test does not build anymore
2009-07-02 10:17:43 +0200 jl  r273622 : #i103242 run test prints out the InnerException in case there was an exception. The InnerException is usually the one thrown in OOo
2009-07-01 17:06:24 +0200 jl  r273604 : #i103242 test does not build anymore
üst a7b1047c
...@@ -1684,7 +1684,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& ...@@ -1684,7 +1684,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type&
Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& aType= Type()) Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& aType= Type())
#endif #endif
{ {
if (pVar->vt != VT_UNKNOWN && pVar->vt != VT_DISPATCH) //To allow passing "Nothing" in VS 2008 we need to accept VT_EMPTY
if (pVar->vt != VT_UNKNOWN && pVar->vt != VT_DISPATCH && pVar->vt != VT_EMPTY)
throw IllegalArgumentException( throw IllegalArgumentException(
OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n"
"The VARIANT does not contain an object type! "), 0, -1); "The VARIANT does not contain an object type! "), 0, -1);
...@@ -1719,13 +1720,23 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& ...@@ -1719,13 +1720,23 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type&
Any ret; Any ret;
//If no Type is provided and pVar contains IUnknown then we return a XInterface. //If no Type is provided and pVar contains IUnknown then we return a XInterface.
//If pVar contains an IDispatch then we return a XInvocation. //If pVar contains an IDispatch then we return a XInvocation.
Type desiredType; Type desiredType = aType;
if (aType == VOID_TYPE && pVar->vt == VT_UNKNOWN)
desiredType = getCppuType((Reference<XInterface>*) 0); if (aType == VOID_TYPE)
else if (aType == VOID_TYPE && pVar->vt == VT_DISPATCH) {
desiredType = getCppuType((Reference<XInvocation>*) 0); switch (pVar->vt)
else {
desiredType = aType; case VT_EMPTY:
case VT_UNKNOWN:
desiredType = getCppuType((Reference<XInterface>*) 0);
break;
case VT_DISPATCH:
desiredType = getCppuType((Reference<XInvocation>*) 0);
break;
default:
desiredType = aType;
}
}
// COM pointer are NULL, no wrapper required // COM pointer are NULL, no wrapper required
if (spUnknown == NULL) if (spUnknown == NULL)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LIBRARY "AxTestComponents.DLL" LIBRARY "AxTestComponents.DLL"
EXPORTS EXPORTS
DllCanUnloadNow @1 PRIVATE DllCanUnloadNow PRIVATE
DllGetClassObject @2 PRIVATE DllGetClassObject PRIVATE
DllRegisterServer @3 PRIVATE DllRegisterServer PRIVATE
DllUnregisterServer @4 PRIVATE DllUnregisterServer PRIVATE
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 10.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AxTestComponents", "AxTestComponents.vcproj", "{CF6DC513-B04E-420A-A0F9-6D1F4046D098}" # Visual Studio 2008
ProjectSection(ProjectDependencies) = postProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AxTestComponents", "AxTestComponents.vcproj", "{CF6DC513-B04E-420A-A0F9-6D1F4046D098}"
EndProjectSection EndProject
EndProject Global
Global GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfiguration) = preSolution Debug|Win32 = Debug|Win32
Debug = Debug Release MinDependency|Win32 = Release MinDependency|Win32
Release MinDependency = Release MinDependency Release MinSize|Win32 = Release MinSize|Win32
Release MinSize = Release MinSize Unicode Debug|Win32 = Unicode Debug|Win32
Unicode Debug = Unicode Debug Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32
Unicode Release MinDependency = Unicode Release MinDependency Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32
Unicode Release MinSize = Unicode Release MinSize EndGlobalSection
EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution
GlobalSection(ProjectConfiguration) = postSolution {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug|Win32.ActiveCfg = Debug|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug.ActiveCfg = Debug|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug|Win32.Build.0 = Debug|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug.Build.0 = Debug|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency.ActiveCfg = Release MinDependency|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency.Build.0 = Release MinDependency|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize.ActiveCfg = Release MinSize|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize|Win32.Build.0 = Release MinSize|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize.Build.0 = Release MinSize|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug.Build.0 = Unicode Debug|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency.ActiveCfg = Unicode Release MinDependency|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency.Build.0 = Unicode Release MinDependency|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize.ActiveCfg = Unicode Release MinSize|Win32 {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32
{CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize.Build.0 = Unicode Release MinSize|Win32 EndGlobalSection
EndGlobalSection GlobalSection(SolutionProperties) = preSolution
GlobalSection(ExtensibilityGlobals) = postSolution HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution EndGlobal
EndGlobalSection
EndGlobal
Visual Basic client that instantiates a Windows Script Component Visual Basic client that instantiates a Windows Script Component
,dcomtest.writerdemo.wsc. That component is located in ,dcomtest.writerdemo.wsc. That component is located in
extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc. extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc. Don't forget to
Don't forget to register that component (right-click,select register). register that component (right-click,select register).
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LIBRARY "EventListener.DLL" LIBRARY "EventListener.DLL"
EXPORTS EXPORTS
DllCanUnloadNow @1 PRIVATE DllCanUnloadNow PRIVATE
DllGetClassObject @2 PRIVATE DllGetClassObject PRIVATE
DllRegisterServer @3 PRIVATE DllRegisterServer PRIVATE
DllUnregisterServer @4 PRIVATE DllUnregisterServer PRIVATE
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "EventListener"=.\EventListener.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventListener", "EventListener.vcproj", "{055137B6-A402-4913-AC11-9A096E866F5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release MinDependency|Win32 = Release MinDependency|Win32
Release MinSize|Win32 = Release MinSize|Win32
Unicode Debug|Win32 = Unicode Debug|Win32
Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32
Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.ActiveCfg = Debug|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.Build.0 = Debug|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.Build.0 = Release MinSize|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32
{055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<HTML> <HTML>
<HEAD> <HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio"> <META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Document Title</TITLE> <TITLE>Document Title</TITLE>
</HEAD> </HEAD>
<BODY id=theBody> <BODY id=theBody>
<script language="JScript"> <script language="JScript">
function Main( id) function Main( id)
{ {
var objServiceManager= new ActiveXObject("com.sun.star.ServiceManager"); var objServiceManager= new ActiveXObject("com.sun.star.ServiceManager");
var objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop"); var objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop");
var args= new Array(); var args= new Array();
var objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args); var objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args);
var listener; var listener;
if( id == 0) if( id == 0)
listener= new XEventListener_Impl(); listener= new XEventListener_Impl();
else if(id == 1) else if(id == 1)
listener= new ActiveXObject("EventListener.EvtListener"); listener= new ActiveXObject("EventListener.EvtListener");
objDocument.addEventListener( listener); objDocument.addEventListener( listener);
} }
function XEventListener_Impl() function XEventListener_Impl()
{ {
this._environment= "JScript"; this._environment= "JScript";
this._implementedInterfaces= new Array( "com.sun.star.lang.XEventListener"); this._implementedInterfaces= new Array( "com.sun.star.lang.XEventListener");
//XEventListener //XEventListener
this.disposing= XEventListener_disposing; this.disposing= XEventListener_disposing;
} }
function XEventListener_disposing( source) function XEventListener_disposing( source)
{ {
alert("JScript Event Listener \n The document was closed"); alert("JScript Event Listener \n The document was closed");
} }
</script> </script>
<script language="VBScript"> <script language="VBScript">
SUB MainVB( id) SUB MainVB( id)
Set objServiceManager= CreateObject("com.sun.star.ServiceManager") Set objServiceManager= CreateObject("com.sun.star.ServiceManager")
Set objCoreReflection= objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") Set objCoreReflection= objServiceManager.createInstance("com.sun.star.reflection.CoreReflection")
Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop") Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop")
'Open a new empty writer document 'Open a new empty writer document
Dim args() Dim args()
Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args) Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args)
Dim eventListener Dim eventListener
select case id select case id
case 0 case 0
Set eventListener= CreateObject("EventListener.EvtListener") Set eventListener= CreateObject("EventListener.EvtListener")
case 1 case 1
Set eventListener= CreateObject("VBasicEventListener.VBEventListener") Set eventListener= CreateObject("VBasicEventListener.VBEventListener")
end select end select
objDocument.addEventListener eventlistener objDocument.addEventListener eventlistener
END SUB END SUB
</script> </script>
<p> <p>
The script on this page creates a new StarOffice document and connects an event listener The script on this page creates a new StarOffice document and connects an event listener
to it. When the document is closed then the XEventListener::disposing method is called on the to it. When the document is closed then the XEventListener::disposing method is called on the
listener object. How the listener is set up depends on the button being clicked. listener object. How the listener is set up depends on the button being clicked.
</p> </p>
<p> <p>
The button will run JScript code that and adds an JScript event listener to the document. The button will run JScript code that and adds an JScript event listener to the document.
The listener is also implemented in JScript an is on this page.. The listener is also implemented in JScript an is on this page..
</p> </p>
<button onclick='Main(0)'>JScript go</Button> <button onclick='Main(0)'>JScript go</Button>
<p> <p>
The button runs JScript code that creates the ActiveX component EventListener.EvtListener that The button runs JScript code that creates the ActiveX component EventListener.EvtListener that
is written in C++ and housed in a dll. Then the event listener is added to the document. is written in C++ and housed in a dll. Then the event listener is added to the document.
</p> </p>
<button onclick='Main( 1)'>JScript go</Button> <button onclick='Main( 1)'>JScript go</Button>
<p> <p>
The button runs VBScript code that creates the components EventListener.EvtListener and adds it The button runs VBScript code that creates the components EventListener.EvtListener and adds it
to the document. to the document.
</p> </p>
<button onclick='MainVB(0)'>VBScript</Button> <button onclick='MainVB(0)'>VBScript</Button>
<p> <p>
Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was
written with VB written with VB
</p> </p>
<button onclick='MainVB(1)'>VBScript</Button> <button onclick='MainVB(1)'>VBScript</Button>
</body> </body>
</html> </html>
EventListener EventListener
________________________________________________________ ========================================
The folder EventListener contains an MSDEV project that builds a dll that contains The folder EventListener contains an MSDEV project that builds a dll that
the EventListener.EvtListener ActiveX component. The component implements the XEventListener contains the EventListener.EvtListener ActiveX component. The component
interface according to the rules of the OleBridge. The component will be used from the implements the XEventListener interface according to the rules of the
HTML page events.htm. OleBridge. The component will be used from the HTML page events.htm.
VBEventListener:
_________________________________________________________ VBEventListener:
Contains a Visual Basic project that builds an ActiveX component that implements ========================================
com.sun.star.lang.XEventListener. Its ProgId is VBasicEventListener.VBEventListener
The dll should also be checked in. VB needs its TLB, so it uses the same CLSIDs on Contains a Visual Basic project that builds an ActiveX component that implements
the next build. The component will create a message box when its disposing function com.sun.star.lang.XEventListener. Its ProgId is
has been called. VBasicEventListener.VBEventListener The dll should also be checked in. VB needs
its TLB, so it uses the same CLSIDs on the next build. The component will create
The project also contains a client that builds a Project1.exe (in the same folder) a message box when its disposing function has been called.
that creates VBEventListener and adds it to a StarOffice document
The project also contains a client that builds a Project1.exe (in the same
folder) that creates VBEventListener and adds it to a StarOffice document
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LIBRARY "MFCCONTROL.OCX" LIBRARY "MFCCONTROL.OCX"
EXPORTS EXPORTS
DllCanUnloadNow @1 PRIVATE DllCanUnloadNow PRIVATE
DllGetClassObject @2 PRIVATE DllGetClassObject PRIVATE
DllRegisterServer @3 PRIVATE DllRegisterServer PRIVATE
DllUnregisterServer @4 PRIVATE DllUnregisterServer PRIVATE
...@@ -84,7 +84,7 @@ END ...@@ -84,7 +84,7 @@ END
// Bitmap // Bitmap
// //
IDB_MFCCONTROL BITMAP DISCARDABLE "MfcControlCtl.bmp" //IDB_MFCCONTROL BITMAP DISCARDABLE "MfcControlCtl.bmp"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
......
Microsoft Visual Studio Solution File, Format Version 7.00 Microsoft Visual Studio Solution File, Format Version 10.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcControl", "MfcControl.vcproj", "{07D59661-3519-4F10-AE9F-22DB0479E25A}" # Visual Studio 2008
EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcControl", "MfcControl.vcproj", "{07D59661-3519-4F10-AE9F-22DB0479E25A}"
Global EndProject
GlobalSection(SolutionConfiguration) = preSolution Global
ConfigName.0 = Debug GlobalSection(SolutionConfigurationPlatforms) = preSolution
ConfigName.1 = Release Debug|Win32 = Debug|Win32
ConfigName.2 = Unicode Debug Release|Win32 = Release|Win32
ConfigName.3 = Unicode Release Unicode Debug|Win32 = Unicode Debug|Win32
EndGlobalSection Unicode Release|Win32 = Unicode Release|Win32
GlobalSection(ProjectDependencies) = postSolution EndGlobalSection
EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution
GlobalSection(ProjectConfiguration) = postSolution {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug|Win32.ActiveCfg = Debug|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug.ActiveCfg = Debug|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug|Win32.Build.0 = Debug|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug.Build.0 = Debug|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release|Win32.ActiveCfg = Release|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Release.ActiveCfg = Release|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release|Win32.Build.0 = Release|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Release.Build.0 = Release|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug.Build.0 = Unicode Debug|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release.ActiveCfg = Unicode Release|Win32 {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
{07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release.Build.0 = Unicode Release|Win32 EndGlobalSection
EndGlobalSection GlobalSection(SolutionProperties) = preSolution
GlobalSection(ExtensibilityGlobals) = postSolution HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution EndGlobal
EndGlobalSection
EndGlobal
...@@ -46,7 +46,7 @@ HostWin::~HostWin() ...@@ -46,7 +46,7 @@ HostWin::~HostWin()
} }
LRESULT HostWin::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) LRESULT HostWin::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{ {
CAxWindow wnd(m_hWnd); CAxWindow wnd(m_hWnd);
......
...@@ -86,7 +86,7 @@ void printResultVariantArray( VARIANT & var); ...@@ -86,7 +86,7 @@ void printResultVariantArray( VARIANT & var);
void printVariant( VARIANT & var); void printVariant( VARIANT & var);
void printSequence( Sequence<Any>& val); void printSequence( Sequence<Any>& val);
extern "C" int __cdecl main( int argc, char * argv[] ) extern "C" int __cdecl main( int , char **)
{ {
HRESULT hr; HRESULT hr;
if( FAILED( hr=CoInitialize(NULL))) if( FAILED( hr=CoInitialize(NULL)))
...@@ -381,7 +381,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) ...@@ -381,7 +381,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv)
Any inrefVariant, outrefVariant; Any inrefVariant, outrefVariant;
Any inrefDecimal, outrefDecimal; Any inrefDecimal, outrefDecimal;
Any inParamsLong, outParamsLong; Any inParamsLong, outParamsLong;
Reference<XInterface> xintUnknown = getComObject(L"AxTestComponents.Foo"); Reference<XInterface> xintUnknown(getComObject(L"AxTestComponents.Foo"));
inBool <<= (sal_Bool) sal_True; inBool <<= (sal_Bool) sal_True;
inv->setValue(OUString(L"prpBool"), inBool); inv->setValue(OUString(L"prpBool"), inBool);
...@@ -391,7 +391,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) ...@@ -391,7 +391,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv)
inv->setValue(OUString(L"prpByte"), inByte); inv->setValue(OUString(L"prpByte"), inByte);
outByte = inv->getValue(OUString(L"prpByte")); outByte = inv->getValue(OUString(L"prpByte"));
inShort <<= ( sal_Int16) 0xffff; inShort <<= static_cast<sal_Int16>( -1);
inv->setValue(OUString(L"prpShort"), inShort); inv->setValue(OUString(L"prpShort"), inShort);
outShort = inv->getValue(OUString(L"prpShort")); outShort = inv->getValue(OUString(L"prpShort"));
...@@ -659,7 +659,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) ...@@ -659,7 +659,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv)
Any inrefVariant, outrefVariant; Any inrefVariant, outrefVariant;
Any inrefDecimal, outrefDecimal; Any inrefDecimal, outrefDecimal;
Reference<XInterface> xIntFoo = getComObject(L"AxTestComponents.Foo"); Reference<XInterface> xIntFoo(getComObject(L"AxTestComponents.Foo"));
//################################################################################### //###################################################################################
// in and out parameter // in and out parameter
//################################################################################### //###################################################################################
...@@ -678,7 +678,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) ...@@ -678,7 +678,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv)
inv->invoke(OUString(L"outByte"), Sequence< Any > ( & outByte, 1), seqIndices, seqOut); inv->invoke(OUString(L"outByte"), Sequence< Any > ( & outByte, 1), seqIndices, seqOut);
outByte <<= seqOut[0]; outByte <<= seqOut[0];
inShort <<= ( sal_Int16) 0xffff; inShort <<= static_cast<sal_Int16>(-1);
inv->invoke(OUString(L"inShort"), Sequence< Any > ( & inShort, 1), seqIndices, seqOut); inv->invoke(OUString(L"inShort"), Sequence< Any > ( & inShort, 1), seqIndices, seqOut);
seqIndices.realloc( 0); seqIndices.realloc( 0);
seqOut.realloc(0); seqOut.realloc(0);
...@@ -1221,7 +1221,7 @@ HRESULT doTest() ...@@ -1221,7 +1221,7 @@ HRESULT doTest()
// invMfc->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); // invMfc->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
if ( ! invMfc.is()) if ( ! invMfc.is())
return hr; return hr;
aAny <<= ( sal_Int16) 0xffff; aAny <<= static_cast<sal_Int16>(-1);
aAny= invMfc->invoke( OUString(L"inShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); aAny= invMfc->invoke( OUString(L"inShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
// //
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "com/sun/star/uno/TypeClass.hpp" #include "com/sun/star/uno/TypeClass.hpp"
#include "com/sun/star/script/XInvocation.hpp" #include "com/sun/star/script/XInvocation.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
#include <com/sun/star/bridge/oleautomation/NamedArgument.hpp> #include <com/sun/star/bridge/oleautomation/NamedArgument.hpp>
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
...@@ -276,6 +277,7 @@ bool equalSequences(const Any& orig, const Any& returned) ...@@ -276,6 +277,7 @@ bool equalSequences(const Any& orig, const Any& returned)
default: default:
return false; return false;
} }
return false;
} }
template< class T > template< class T >
...@@ -292,6 +294,7 @@ bool equalSequences(const Sequence<T>& seqIn, const Sequence<Any> & seqOut) ...@@ -292,6 +294,7 @@ bool equalSequences(const Sequence<T>& seqIn, const Sequence<Any> & seqOut)
if (anyIn != anyOut) if (anyIn != anyOut)
return false; return false;
} }
return true; return true;
} }
......
The program tests the OleObjectFactory service which enables to use COM components The program tests the OleObjectFactory service which enables to use COM components
through XInvocation. through XInvocation.
Requirements: Requirements:
types.rdb and services.rdb and OleClient.ini have to be next to the executable. types.rdb and services.rdb and OleClient.ini have to be next to the executable.
COM component: XCallback_Impl.Simple ( extensions/test/ole/unotocomcalls/XCallback_Impl ) COM component: XCallback_Impl.Simple ( extensions/test/ole/unotocomcalls/XCallback_Impl )
ActiveX controls: AxTestComponent.Basic ( extensions/test/ole/AxTestComponents) ActiveX controls: AxTestComponent.Basic ( extensions/test/ole/AxTestComponents)
MFCCONTROL.MfcControlCtrl.1 (extensions/test/ole/MfcControl) MFCCONTROL.MfcControlCtrl.1 (extensions/test/ole/MfcControl)
//The project cannot be build in our environment therefore it must be an MSDEV project.
//Reason: ATL uses min and max macros defined in windef.h. Our stl header undef min and max.
//To generate the uno header use the make file. Then Set the include path directories to
//the inc directory in the build tree.
Now with Visual Studio .NET 2002 it seems to work
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_extensions.hxx" #include "precompiled_extensions.hxx"
#pragma warning (disable: 4917)
#include <windows.h> #include <windows.h>
#include <comdef.h> #include <comdef.h>
#include <tchar.h> #include <tchar.h>
......
The program test the Service com.sun.star.bridge.OleBridgeSupplierVar1. Currently broken!!
While running in debug mode it writes infos to the debug - output.
The program test the Service com.sun.star.bridge.OleBridgeSupplierVar1.
The executable needs a applicat.rdb present with the registered services While running in debug mode it writes infos to the debug - output.
com.sun.star.bridge.OleBridgeSupplierVar1, oletest.OleTest. The OleTest
component resides in extensions/test/ole/cpnt. The build creates an The executable needs a services.rdb present with the registered services
oletest.rdb file that must be merged with the applicat.rdb and OleTest com.sun.star.bridge.OleBridgeSupplierVar1, oletest.OleTest. The OleTest
must be registered to the applicat.rdb. component resides in extensions/test/ole/cpnt. The build creates an
\ No newline at end of file oletest.rdb file that must be merged with the types.rdb and OleTest
must be registered to the services.rdb.
...@@ -350,10 +350,11 @@ inLong = 0 ...@@ -350,10 +350,11 @@ inLong = 0
inFloat = 0 inFloat = 0
inVariant = 0 inVariant = 0
inVariant2 = 0 inVariant2 = 0
'defaults are: 1, 2. , 3, 4 'defaults are: 1, 2, 4
'The third parameter is a VARIANT with a default value of 4. COM gives it the type BSTR
obj.defaultvalue1() obj.defaultvalue1()
obj.defaultvalue2(inLong, inFloat, inVariant) obj.defaultvalue2(inLong, inFloat, inVariant)
If inLong <> 1 Or inFloat <> 2 Or inVariant <> 3 Then If inLong <> 1 Or inFloat <> 2 Or inVariant <> "4" Then
runtest = -1 runtest = -1
Exit Function Exit Function
End If End If
...@@ -365,7 +366,7 @@ inVariant = 0 ...@@ -365,7 +366,7 @@ inVariant = 0
inVariant = 0 inVariant = 0
obj.defaultvalue1(inLong, inFloat) obj.defaultvalue1(inLong, inFloat)
obj.defaultvalue2(inLong, inFloat, inVariant) obj.defaultvalue2(inLong, inFloat, inVariant)
If inLong <> inLong2 Or inFloat <> inFloat2 Or inVariant <> 3 Then If inLong <> inLong2 Or inFloat <> inFloat2 Or inVariant <> "4" Then
runtest = -1 runtest = -1
Exit Function Exit Function
End If End If
......
oleclient.bas is a StarBasic script that uses the oleclient.bas is a StarBasic script that uses the
"com.sun.star.bridge.OleObjectFactory" service to instantiate "com.sun.star.bridge.OleObjectFactory" service to instantiate
the ActiveX component "AxTestComponents.Basic" and calls the ActiveX component "AxTestComponents.Basic" and calls
functions on it. functions on it.
------------------------------------------------------------ ------------------------------------------------------------
Requirements: Requirements:
ActiveX component: AxTestComponent.Basic must be registered. ActiveX component: AxTestComponent.Basic must be registered.
It is contained in extensions/test/ole/AxTestComponents It is contained in extensions/test/ole/AxTestComponents
\ No newline at end of file
Imports System.Reflection
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' TODO: Review the values of the assembly attributes
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("StarOffice")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>
' Version information for an assembly consists of the following four values:
' Major version
' Minor Version
' Build Number
' Revision
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
<Assembly: AssemblyVersion("1.0.*")>
This diff is collapsed.
This diff is collapsed.

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Project1", "Project1.vbproj", "{F62D440E-8976-4A6D-91A8-89F09701074F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F62D440E-8976-4A6D-91A8-89F09701074F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F62D440E-8976-4A6D-91A8-89F09701074F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F62D440E-8976-4A6D-91A8-89F09701074F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F62D440E-8976-4A6D-91A8-89F09701074F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINXP\System32\Stdole2.tlb#OLE Automation
Module=Module1; Module1.bas
Startup="Sub Main"
HelpFile=""
ExeName32="Project1.exe"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="StarOffice"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<MyType>WindowsFormsWithCustomSubMain</MyType>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F62D440E-8976-4A6D-91A8-89F09701074F}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyName>Project1</AssemblyName>
<OutputType>WinExe</OutputType>
<StartupObject>Project1.Module1</StartupObject>
<AssemblyMajorVersion>1</AssemblyMajorVersion>
<AssemblyMinorVersion>0</AssemblyMinorVersion>
<AssemblyRevisionNumber>0</AssemblyRevisionNumber>
<GenerateRevisionNumber>False</GenerateRevisionNumber>
<AssemblyCompanyName>StarOffice</AssemblyCompanyName>
<RootNamespace>Project1</RootNamespace>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>.\bin\</OutputPath>
<DocumentationFile>Project1.xml</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<DefineDebug>True</DefineDebug>
<DefineTrace>True</DefineTrace>
<DefineConstants>Win32=True</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>.\bin\</OutputPath>
<DocumentationFile>Project1.xml</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<DefineDebug>False</DefineDebug>
<DefineTrace>True</DefineTrace>
<DefineConstants>Win32=True</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic.Compatibility">
<Name>Microsoft.VisualBasic.Compatibility</Name>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.XML">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="Microsoft.VisualBasic.Compatibility" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.vb" />
<Compile Include="Module1.vb">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="My Project\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
Runs a test written in VisualBasic. If no error message appears then the test was ok. Runs a test written in VisualBasic. If no error message appears then the test was ok.
Requirements: Requirements:
Installed office Installed office
Component oletest.Oletest (extensions/test/ole/cpnt) Component oletest.Oletest (extensions/test/ole/cpnt)
Component VBasicEventListener.VBEventListener (extensions/test/ole/EventListenerSample/VBEventListener Component VBasicEventListener.VBEventListener (extensions/test/ole/EventListenerSample/VBEventListener
OleTest is a UNO component. It needs to be registered with the office rdb. Also there are additional OleTest is a UNO component. It needs to be registered with the office rdb. Also there are additional
types (oletest.rdb in wntmsci7/bin/) which must be merged with the rdb. types (oletest.rdb in wntmsci7/bin/) which must be merged with the rdb.
VBEventListener is an ActiveX component. The directory contains a Visual Basic Project and also VBEventListener is an ActiveX component. The directory contains a Visual Basic Project and also
the binary VBasicEventListener.dll. This is necessary because the dll contains the type library the binary VBasicEventListener.dll. This is necessary because the dll contains the type library
which is needed by VB. Otherwise VB would generate a new CLSID on a new build. which is needed by VB. Otherwise VB would generate a new CLSID on a new build.
The dll must be registered on the system. This is done by The dll must be registered on the system. This is done by
regsvr32 VBasicEventListener.dll regsvr32 VBasicEventListener.dll
or or
by a rebuild of the project. by a rebuild of the project.
cpnt.cxx contains a uno component that is uses to test the olebridge cpnt.cxx contains a uno component that is uses to test the olebridge within a
within a JavaScript context. JavaScript context. In particular it has functions using out, in/out and
In particular it has functions using out, in/out and sequence parameter sequence parameter that have to be specifically treated in JScript because they
that have to be specifically treated in JScript because they are represented are represented by IDispatch objects. Other clients, such as VBScript, VB and
by IDispatch objects. C++ applications can also use this component for testing.
The service name is oletest.OleTest.
The uno types are also build in this folder. The idl file is in ..\idl. The
types rdb is in wntmscixx.pro\bin\oletest.rdb
The test is run by JavaScript contained in OleTest.htm and JScriptNewStyle.htm. The service is used by:
OleTest.htm
JScriptNewStyle.htm
ScriptTest.html
Prerequisites: Prerequisites:
The oletest.dll ( build in this directory) must reside in the <Office Dir>/program
directory and it must have been registered with regcomp.exe.
The types in wntmsci/bin/oletest.rdb must be merged with the applicat.rdb. oletest.rdb The oletest.dll must be registered, for example in the services.rdb, using
is automatically build in this directory. However the idl file is in test/ole/idl. regcomp. Then the uno types contained in oletest.rdb (wntmscixx/bin) must be merged
\ No newline at end of file for example in the offapi.rdb. This is done with regmerge.
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: StdAfx.cpp,v $
* $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// stdafx.cpp : source file that includes just the standard includes
// cpptest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "cpptest"=.\cpptest.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment