WINAPI OpenFile
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
    290

    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
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    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 Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center