20#include <com/sun/star/lang/XComponent.hpp>
21#include <com/sun/star/registry/XSimpleRegistry.hpp>
23#include <com/sun/star/system/XSystemShellExecute.hpp>
24#include <cppuhelper/servicefactory.hxx>
26#include <osl/file.hxx>
27#include <rtl/ustring.hxx>
29#include <osl/diagnose.h>
39using namespace ::
cppu ;
43using namespace com::sun::star::system;
45#define RDB_SYSPATH "D:\\Projects\\gsl\\shell\\wntmsci7\\bin\\applicat.rdb"
58int SAL_CALL
main(
int nArgc,
char* Argv[],
char* )
74 OSL_FAIL(
"Can't create RegistryServiceFactory");
78 printf(
"Creating RegistryServiceFactory successful\n");
84 Reference< XSystemShellExecute > xSysShExec(
85 g_xFactory->createInstance(
"com.sun.star.system.SystemShellExecute"), UNO_QUERY );
87 if ( !xSysShExec.is() )
89 OSL_FAIL(
"Error creating SystemShellExecute Service" );
94 OUString cmd = OUString::createFromAscii( Argv[1] );
95 OUString param = OUString::createFromAscii( Argv[2] );
99 xSysShExec->execute( cmd, param, atoi( Argv[3] ) );
101 catch( SystemShellExecuteException& )
103 OSL_FAIL(
"Error executing system command" );
105 catch( IllegalArgumentException& )
107 OSL_FAIL(
"Invalid parameter" );
115 Reference< XComponent > xComponent(
g_xFactory, UNO_QUERY );
120 OSL_FAIL(
"Error shutting down");
124 xComponent->dispose();
127 printf(
"Test successful\n");
Reference< XMultiServiceFactory > g_xFactory
int SAL_CALL main(int nArgc, char *Argv[], char *)
SAL_DLLPUBLIC_EXPORT css::uno::Reference< css::lang::XMultiServiceFactory > SAL_CALL createRegistryServiceFactory(OUString const &, OUString const &, sal_Bool, OUString const &)