It is rather simple. Instead of f->Read (version, sizeof (TBXVersion)); you need to do like in the fread case and give it a buffer to write into, which in your case becomes f->Read (reinterpret_cast<char*>(&version), sizeof (TBXVersion));
-Marten Quoting michael kapelko <[EMAIL PROTECTED]>: > i need to rewrite this in VFS: > > FILE *f; > f = fopen (filename, "rb"); > if (f == NULL) > return false; > fread (&version, sizeof (TBXVersion), 1, f); > > so i tried this: > > csRef<iVFS> vfs; > vfs = csQueryRegistry<iVFS> (obj_reg); > csRef<iFile> f = vfs->Open (filename, VFS_FILE_READ); > f->Read (version, sizeof (TBXVersion)); > > but i get errors: > > tbx.cpp: In member function `bool TBXFile::Open(char*)': > tbx.cpp:14: error: no matching function for call to > `iFile::Read(TBXVersion&, > unsigned int)' > /usr/local/include/crystalspace/iutil/vfs.h:134: error: candidates are: > virtual > size_t iFile::Read(char*, unsigned int) > make: *** [obj/tbx.o] Error 1 > > so how to read structures? > > thanks. > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Crystal-main mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crystal-main > Unsubscribe: > mailto:[EMAIL PROTECTED] > Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[EMAIL PROTECTED]
