25.03.2007 matthiasm <[EMAIL PROTECTED]> wrote:

> 
> On Mar 25, 2007, at 9:16 PM, Milan wrote:
> 
> > void MainWindow::someFunc(void *b) { // "b" is "browser"
> >     Window *group = ((Browser *)storage)->window();
> >     usinged long tmp = ((MainWindow *) group)->intVar;
> >     // ...
> > }
> >
> > then value of "intVar" is always "561" no matter what actual value  
> > is in
> > it!!?
> 
> Assuming that 'b' is correct to begin with, and the other type nemas  
> are right, this code seems OK. You seem to have a bug here somewhere.  
> It always helps be to print out the actual value of the pointeers  
> using either the debugger or printf("0x%08x... and verify the  
> pointers. It all could get a little bit rough if you use multiple  
> inheritance. In that case, you should enable RTTI and use  
> dynamic_cast<type>(variable) and friends to get better results.

Thanks for indication, there's no multiple inheritance but anyway I've
lost too much time on trying to figure out what's wrong with this approach.
I've solved this by passing the pointer to the MainWindow, and then I use it
to access "browser" variable.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to