Hi Shanadas,
the dialog displays the string correctly, but it its truncated when it is written back into the OPENFILENAME struct, because the default length OPENFILENAME::nMaxFile is 260 characters. The knowledge base article
http://support.microsoft.com/kb/131462/en-us shows how to evaluate the amount of memory needed to hold the string and (if it is larger than the default length) reallocs the correct amount of memory for it. I debugged the code and found that the function
CommDlg_OpenSave_GetSpec(GetParent(hwnd), NULL, 0); always returns zero because
GetParent(hwnd) is always zero on Windows7.
The result is, that the memory is never reallocated. When the function that calls the dialog then reads OPENFILENAME::lpstrFile it gets the truncated string.
Regards,
Bernd