<DIV> The code above works differently Windows and Linux not because of inclusion of , but because of differences in compilers.<BR> The problem is that you overrode the GetClassName incorrectly - the correct signature should be const char* GetClassName() const and this code works as it was intended.<BR> <BR>You're right, i didn't override GetClassName correctly.<BR>But, now that it is correctly overriden, I get the GetClassNameA problem... and it works.<BR>I wondered how that was possible, and I tried this under Windows :</DIV>
<DIV> #include <vtkObjectBase.h><BR> #include <stdio.h><BR> <BR> #undef GetClassName</DIV>
<DIV><BR> class MyEmptyObject : public vtkObjectBase<BR> {<BR> public:<BR> virtual const char * GetClassName() const<BR> {<BR> return "MyEmptyObject";<BR> }<BR> <BR> };<BR> <BR> int main()<BR> {<BR> vtkObjectBase * o = new MyEmptyObject;<BR> printf( "%s\n", o->GetClassName() );<BR> }</DIV>
<DIV>Compiler error : "error C2039: 'GetClassName' : is not a member of 'vtkObjectBase'"<BR>Oh my god... does it means that ...<BR><A href="http://www.chez.com/regatbar/getclassname.png">http://www.chez.com/regatbar/getclassname.png</A><BR>Yes, all vtk classes implement GetClassNameA and not GetClassName.<BR>And this is also true for<BR> int vtkDirectory::CreateDirectoryA(char const *)<BR> class vtkObject * vtkCollectionIterator::GetObjectA(void)<BR> class vtkProp * vtkAssemblyNode::GetPropA(void)<BR> void vtkViewport::RemovePropA(class vtkProp *)<BR> void vtkAssemblyNode::SetPropA(class vtkProp *)<BR>this is just for vtkCommon.<BR>This works well because all VTK code includes <windows.h>.<BR>But, it is a potential pitfall for user code which does not include vtk everywhere.<BR>That was my case yesterday.</DIV><BR><BR>Aurélien REGAT-BARREL<p>
                <hr size=1>
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
<br><a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/mail/mail_taglines/default/*http://fr.benefits.yahoo.com/">Créez votre Yahoo! Mail</a>
<br><br>
Dialoguez en direct avec vos amis grâce à <a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com/">Yahoo! Messenger !</a>