Hi all,
I am having problems building some code. What I do not understand is the steps
needed for the code to give a program : when to link the program, what is the
rdb file used for, when to compile and with which options and dependencies ?
I would like to create a main() program. This program would call an object
"MyObject". This Object would encapsulate all the code related to the
OpenOffice API. A sample of what the code looks like is given below.
The problem is that I do not really know how things must be done, and thus
getting the program to compile is really difficult. Is there any
documentation about this ? Because, in the doc, it explains it for doing
components, but not how to use it from outside !
Thanks,
Pierre-André
- main.cxx
#include "my_object.h"
int
main()
{
my_object u;
std::string s = "Yop";
u.myfunc( s );
return 0;
}
- my_object.h
class MyObject
{
public :
// Constructor. Connects itself to an OpenOffice's instance.
MyObject();
// Does something
void myfunc( const std::string &s );
};
- my_object.cpp
// Some includes
#include <cppuhelper/bootstrap.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
using namespace rtl;
using namespace cppu;
using namespace std;
// Constructor.
MyObject::MyObject()
{
// connect to OpenOffice instance using UNO API.
// some code.
Reference< XComponentContext > xContext( ::cppu::bootstrap() );
...
}
void MyObject::myfunc( const std::string &s )
{
cout << "s = " << s << endl;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]