CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: FILE vs CFile

Threaded View

  1. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: FILE vs CFile

    FILE* to CFile
    Code:
    FILE*  f      = fopen(path, szMode);
    int    handle = f->_file;
    HANDLE hFile  = (HANDLE) _get_osfhandle(handle);
    CFile cf(hFile);
    CFile to FILE*
    Code:
    CFile cf;
    cf.Open(...);
    HANDLE hFile  = cf;
    int    handle = _open_osfhandle((LONG)hFile, _mode);
    FILE*  f      = fdopen(handle, szMode);
    Last edited by Igor Vartanov; December 26th, 2007 at 07:39 AM.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured