Using CFileDialog
class, I select multiple files placed in a directory with a long path. It's OK when I select only one or two files; but when I select three files at the same time it returns only a part of the third file path. (Looks like it's limited to 512 characters possibly) How can I resolve this?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
MFC uses a default buffer of size
_MAX_PATH
and that's why you are seeing that behavior. Look atdlgfile.cpp
for the implementation ofCFileDialog::CFileDialog
and you will seem_ofn.lpstrFile
andm_ofn.nMaxFile
being set.You can specify a larger buffer if you want to. Before calling
DoModal
you can either access theCFileDialog::m_pOFN
member to get a pointer to theOPENFILENAME
that theCFileDialog
will use and update it directly or callCFileDialog::GetOFN
to get a reference to the structure and update that.Either way you will find this helpful: http://msdn.microsoft.com/en-US/library/ms646839(v=vs.80).aspx
Assuming that your code looks something like this:
Determine the maximum number of files that you wish to support, for example:
Add this before calling
DoModal
:Add this after calling
DoModal
: