Reputation: 333
I want to use the GetLongPathName
function exactly the same way I'm using the GetShortPathName
:
NULL
as output param for getting the size to allocate.GetShortPathName MSDN page says:
Passing NULL
for lpszShortPath
and zero for cchBuffer
will always return the required buffer size for a specified lpszLongPath
.
That note is not exists in GetLongPathName
function so I'm afraid to use the function that way.
So, what is the proper use for that function?
Upvotes: 2
Views: 991
Reputation: 14868
You can call GetLongPathName
with either an empty or a NULL
buffer and it will answer with the required buffer length.
In other words, you can pass NULL
for the lpszLongPath
argument and 0
for cchBuffer
.
Upvotes: 3