Solved

is not a pointer-to-object type

Posted on 2006-06-23
10
2,234 Views
Last Modified: 2013-12-03
I'm trying to compila some code with XLib call and getting the following error: void* is not a pointer-to-object type.
the lines with this erro is:

   Window win;
   unsigned long valuemask = 0;
   XGCValues values;
   unsigned int line_width = 6;
   int line_style = LineOnOffDash;
   int cap_style = CapRound;
   int join_style = JoinRound;
   int dash_offset = 0;
   static char dash_list[] = {12, 24};
   int list_length = 2;
etc..

//    Display* ToolKit::getDisplay();


      *gc = XCreateGC(toolkit->getDisplay(), win, valuemask, &values);
      XSetFont(toolkit->getDisplay(), *gc, font_info->fid);
      XSetForeground(toolkit->getDisplay(), *gc, BlackPixel(toolkit->getDisplay(),toolkit->getScreenNum()));
      XSetLineAttributes(toolkit->getDisplay(), *gc, line_width, line_style, cap_style, join_style);
      XSetDashes(toolkit->getDisplay(), *gc, dash_offset, dash_list, list_length);


Someone can help? I relay not understanting what's happen once all types appear to be corrects.
0
Comment
Question by:rubentrancoso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 16973098
And where exactly are you getting that error?
0
 

Author Comment

by:rubentrancoso
ID: 16973126
all this lines:

*gc = XCreateGC(toolkit->getDisplay(), win, valuemask, &values);
     XSetFont(toolkit->getDisplay(), *gc, font_info->fid);
     XSetForeground(toolkit->getDisplay(), *gc, BlackPixel(toolkit->getDisplay(),toolkit->getScreenNum()));
     XSetLineAttributes(toolkit->getDisplay(), *gc, line_width, line_style, cap_style, join_style);
     XSetDashes(toolkit->getDisplay(), *gc, dash_offset, dash_list, list_length);

../widgets/Frame.cpp:83: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:85: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:88: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:88: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:88: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:90: error: `void*' is not a pointer-to-object type
../widgets/Frame.cpp:92: error: `void*' is not a pointer-to-object type
0
 
LVL 86

Expert Comment

by:jkr
ID: 16973143
What type is 'toolkit'? That seems to be the cuplrit here.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rubentrancoso
ID: 16973174
yes, is what i had discovered when I replace toolkit->getDisplay() by NULL

static void* toolkit = NULL;

my doubt is that the return type for getDisplay is the type XLib function is expecting
0
 
LVL 86

Expert Comment

by:jkr
ID: 16973204
>>my doubt is that the return type for getDisplay is the type XLib function is expecting

Well, it should be, depending on your "toolkit". But, you could always

Display* pDisp = XOpenDisplay ();

GC gc = XCreateGC(pDisp, win, valuemask, &values);
     XSetFont(pDisp, gc, font_info->fid);
     XSetForeground(pDisp, gc, BlackPixel(pDisp,CorrectScreenNumHere));
     XSetLineAttributes(pDisp, gc, line_width, line_style, cap_style, join_style);
     XSetDashes(pDisp, gc, dash_offset, dash_list, list_length);
0
 

Author Comment

by:rubentrancoso
ID: 16973264
There's other calls on the same class that do it with no problem. But in this part of code neither I cast toolkit to the ToolKit class I avoid the error

getDisplay returns justa a Display*
0
 
LVL 86

Expert Comment

by:jkr
ID: 16973825
Well, what about posting your toolkit class' declaration?
0
 

Author Comment

by:rubentrancoso
ID: 16973871
I was haging problems definig ToolKit* toolkit in the ToolKit class, then I placed it as a global in the END OF ToolKit header and it works.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17258158
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question