_TFOPEN returns invalid Pointer to FILE?

G

Guest

Hello

I write an app (with _UNICODE triggered) and want to retrieve a pointer to a
file struct like this:


//Let's open the file in binary mode for reading.
FILE *f = _tfopen(pFilePath, _T("rb"));
if (f == NULL)
return;
....


But during runtime a memory access violation happens in some MS DLL. While
debugging I recognized that the pointer to the FILE struct is valid, but the
struct content is not somehow. This is what the debugger tells me:


- f@0x1027c898 {_ptr=0x00000000 <Bad Ptr> _cnt=0 _base=0x00000000 <Bad Ptr>
....}
f->_ptr=0x00000000 <Bad Ptr> char *
f->_cnt=0 int
f->_base=0x00000000 <Bad Ptr> char *
f->_flag=1 int
f->_file=3 int
f->_charbuf=0 int
f->_bufsiz=0 int
f->_tmpfname=0x00000000 <Bad Ptr> char *


Does anyone know how to solve this problem?

Thanks.


Wan-Hi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top