?
Solved

is not a pointer-to-object type

Posted on 2006-06-23
10
Medium Priority
?
2,258 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

801 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