Hi!!!
I have a problem with my client/server application (C, C++ and Qt). When I compile it, this is the error:
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x36001fe
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x36001ff
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600200
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600201
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600202
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600203
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600204
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600205
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600206
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600207
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600208
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600209
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360020a
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360020b
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600212
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600214
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600215
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600216
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600217
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600218
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600219
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360021a
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360021b
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360021c
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360021d
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360021e
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360021f
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600220
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600221
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600224
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600225
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600226
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600227
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600228
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600229
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360022a
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360022b
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360022c
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x360022e
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x360022f
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600230
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600231
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600232
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600233
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600235
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600236
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Extension: 153 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x3600237
Xlib: unexpected async reply (sequence 0x266b)!
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 1 (X_CreateWindow)
Resource id: 0x3600222
Xlib: sequence lost (0x116ea > 0x16ea) in reply type 0x0!
X Error: BadImplementation (server does not implement operation) 17
Major opcode: 20 (X_GetProperty)
Resource id: 0x0
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
Major opcode: 53 (X_CreatePixmap)
Resource id: 0x3600238
This is the code that generates the error:
What's the meaning of Error: BadIDChoice .....???Qt Code:
//principal.cpp #include client.h ... ... void principal:: startProcess(){ int pid= fork(); if (pid<0){ printf("fork fail"); exit(1); } if(pid==0){ // Child int portConnect; char name[32]; int portWait = 30000; waitForChat(portWait, name, &portConnect); //When waitForChat finish, means that other client request for Chat, so the application must show the new window chat. windowChat = new Chat; windowChat -> show(); } } //client.c ... ... void waitForChat(int PtWait,char *c, int *PtConnect){ int skt; int bnd; int lsn; int client; struct sockaddr_in dirclient; struct sockaddr_in dirserv; char buffer[1024]; if ((skt = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("Clientv:waitForchat: socket"); exit(1); } dirserv.sin_family = AF_INET; dirserv.sin_port =htons(PtWait); dirserv.sin_addr.s_addr =INADDR_ANY; if ((bnd= bind(skt, (struct sockaddr *)&dirserv, sizeof(dirserv) )) < 0) { perror("Clientv:waitForchat:: bind"); exit(1); } if ( (lsn=listen(skt, 100)) < 0) { perror("Clientv:waitForchat:: listen"); exit(1); } if ((client = accept(skt,NULL,0)) < 0){ perror("Clientv:waitForchat: accept"); exit(1); } if (recv(client,buffer,1024,0) < 0){ perror("Clientv:waitForchat: recv"); exit(1); } sscanf(buffer,"%d %s",PtConnect,c); close(client); }To copy to clipboard, switch view to plain text mode
How can I fix it???
Thanks!!!
Bookmarks