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

Thread: WINAPI OpenFile

  1. #1
    Join Date
    Nov 2006
    Posts
    292

    WINAPI OpenFile

    Sometimes I hate how these API's are designed. Can someone tell me what OFSTRUCT is and how to declare it? According to MSDN for OpenFile() ...

    lpReOpenBuff [out]

    A pointer to the OFSTRUCT structure that receives information about a file when it is first opened.

    The structure can be used in subsequent calls to the OpenFile function to see an open file.

    The OFSTRUCT structure contains a path string member with a length that is limited to OFS_MAXPATHNAME characters, which is 128 characters. Because of this, you cannot use the OpenFile function to open a file with a path length that exceeds 128 characters. The CreateFile function does not have this path length limitation.
    I understand the first and third parameter except this one, anyone care to enlighten me on the matter? Thanx.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: WINAPI OpenFile

    Anyhow, OpenFile is an obsolete function:
    MSDN
    Note Only use this function with 16-bit versions of Windows. For newer applications, use the CreateFile function.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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