help in visual c++ 6.0

hey please help me resolve these errors..in file handling in visual c++..

#define TXTPATH "D:\\backup\\newdate.txt"
CFile file;
CFileException fileEx;
bool bop=file.Open(TXTPATH , CFile::Read | CFile::Write ,fileEx);

i am recieving the following errors:

1.'Open' : cannot convert parameter 2 from 'unsigned int (__thiscall CFile::*) (void *,unsigned int)' to 'unsigned int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast

2.'|' : illegal, left operand has type 'unsigned int (__thiscall CFile::*)(void *,unsigned int)'

3. '|' : illegal, right operand has type 'void (__thiscall CFile::*)(const void *,unsigned int)'


i have even tried giving spaces but even that did'nt work

please help me...
CFile::Read | CFile::Write

These two are not exists in CFile flags list.

you can use CFile::modeRead | CFile::modeWrite .
but i have chosen this from the drop down list.
You choose functions not variables check once.
These messages

2.'|' : illegal, left operand has type 'unsigned int (__thiscall CFile::*)(void *,unsigned int)'

3. '|' : illegal, right operand has type 'void (__thiscall CFile::*)(const void *,unsigned int)'

point out clear that operands of the operator | are pointers to functions.

Thus Read is a pointer to function

unsigned int (__thiscall CFile::*)(void *,unsigned int)

and Wrie is a pointer to function

(__thiscall CFile::*)(const void *,unsigned int)

That is Read and Write are member functions of class CFile.



Topic archived. No new replies allowed.