You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Christian

Beginner

  • "Christian" started this thread

Posts: 26

Location: Karlsruhe, Germany

Occupation: in training

  • Send private message

1

Tuesday, June 29th 2004, 9:29pm

DCOP Problem

Hi,

i only wanna have an application which connects to the dcop server and use a function an application offers me.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int main(int argc, char **argv)
{
 KApplication app(argc, argv, "app");
 DCOPClient *client = kapp->dcopClient();
  if(client->attach() == false) {
   qDebug("no connection");
  }
   else {
    qDebug("CONNECTED");
   }
   bool ok = client->send("kicker", "app", "restart()", QByteArray());
    if(ok) {
     qDebug("OKAY");
   }
   KMainWindow *mainWin = new simpledcop();
   app.setMainWidget( mainWin );
   mainWin->show();
  
   return app.exec();
}

My Applications echoes "Connected" and "OKAY" so there seems to be another bug...
"You shouldn't learn Qt and be a logical thinking person, but learn Qt to become such" (decoding)
"A C++ compiler is not a baby rattle." (Kevin)

f_edemar

Beginner

Posts: 14

Location: Sweden

  • Send private message

2

Wednesday, June 30th 2004, 8:39am

RE: DCOP Problem

Have you checked that kicker restarts with that directive when using kdcop?

Christian

Beginner

  • "Christian" started this thread

Posts: 26

Location: Karlsruhe, Germany

Occupation: in training

  • Send private message

3

Wednesday, June 30th 2004, 10:34am

Yeh it restarts. But i have tryed other functions from other interfaces... same result.
"You shouldn't learn Qt and be a logical thinking person, but learn Qt to become such" (decoding)
"A C++ compiler is not a baby rattle." (Kevin)

f_edemar

Beginner

Posts: 14

Location: Sweden

  • Send private message

4

Wednesday, June 30th 2004, 11:41am

I think you must call

Source code

1
client ->registerAs("myapp");

after the attach()-call.

I found this link btw:
http://perso.wanadoo.es/antlarr/tutorial/p8.html

Christian

Beginner

  • "Christian" started this thread

Posts: 26

Location: Karlsruhe, Germany

Occupation: in training

  • Send private message

5

Wednesday, June 30th 2004, 6:25pm

Hi,

thanks... but it didn't help...
"You shouldn't learn Qt and be a logical thinking person, but learn Qt to become such" (decoding)
"A C++ compiler is not a baby rattle." (Kevin)

f_edemar

Beginner

Posts: 14

Location: Sweden

  • Send private message

6

Wednesday, June 30th 2004, 8:54pm

Are you sure that you checked your calling with kdcop?

It works for me if I use

client->send("kicker", "kicker", "restart()", QByteArray());

This post has been edited 1 times, last edit by "f_edemar" (Jun 30th 2004, 8:54pm)


Christian

Beginner

  • "Christian" started this thread

Posts: 26

Location: Karlsruhe, Germany

Occupation: in training

  • Send private message

7

Thursday, July 1st 2004, 7:29am

yeh it works with kdcop... this evening i will upload the whole project. perhaps my fault is somewhere else...
"You shouldn't learn Qt and be a logical thinking person, but learn Qt to become such" (decoding)
"A C++ compiler is not a baby rattle." (Kevin)

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

8

Thursday, July 1st 2004, 12:42pm

Quoted

Originally posted by Christian
yeh it works with kdcop... this evening i will upload the whole project. perhaps my fault is somewhere else...


I think f_edemar was hinting at the second parameter of the call.
"app" is not very likely a DCOP interface of kicker, at least not here on 3.1

Cheers,
_
Qt/KDE Developer
Debian User