[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: RE: Stupid DCOP question
From: Jesper Pedersen <jep () systematic ! dk>
Date: 2000-09-12 9:46:34
[Download RAW message or body]
> -----Original Message-----
> From: David Faure [mailto:david@mandrakesoft.com]
> Sent: 12. september 2000 11:36
> To: kde-devel@max.tat.physik.uni-tuebingen.de
> Subject: Re: Stupid DCOP question
>
>
> On Tue, 12 Sep 2000, Jesper Pedersen wrote :
> >Hi.
> >
> >I have a small problem with DCOP:
> >
> >---------------- SERVER SIDE ---------------------------
> >//MyClass.h
> >class MyClass : virtual public DCOPObject {
> > K_DCOP
> >
> >k_dcop:
> > virtual void addString( QString s ) = 0;
> >}
> >
> >//MyClassImpl.h
> >class MyClassImpl : public KTMainWindow, virtual public MyClass {
> > Q_OBJECT
> >
> >public:
> > void addString( QString s );
> >}
> >
> >//MyClassImpl.cpp
> >void MyClassImpl::addString( QString s ) {
> > printf( "%s\n", s.latin1() );
> >}
> >
> >
> >---------------- CLIENT SIDE ---------------------------
> > QString* text = new QString( "TestData" );
> > printf("%s\n", text->latin1());
> >
> > QCString srv( server );
> > QCString obj( "MyClassImpl" );
> >
> > QByteArray params1;
> > QCString fun1( "addString(QString)" );
> >
> > QDataStream data(params1, IO_WriteOnly);
> > data << text->latin1();
>
> Replace with
> data << text;
>
Thanks David ! (I must remember to rest ... but it is so
fun to code KDE applications)
> You want to send a QString, not a char *.
>
> --
> David FAURE, david@mandrakesoft.com, faure@kde.org
> http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
> KDE, Making The Future of Computing Available Today
> See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2
>
>
> >> Visit
> http://master.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic