hi all,
i am new to MFC programming, i am Creating an object of CString to store an filename opened through dialog box.... If i pass this CString object as filename to fopen() function, I am getting Unhandled exception: 0xC0000005: Access violation..... so please help me out in this.....

i.e.
CString Filename;

if( FileDlg.DoModal() == IDOK )
{
Filename = FileDlg.GetFileName();
}


And if i pass this Filename object to fopen() as
fopen(Filename, "r");

When I debug I get the violation exception at this line.....