Win32 Api: How create Open/"Save as" Dialog?

Adam D. Ruppe destructionator at gmail.com
Sat Jan 11 14:21:25 UTC 2020


On Saturday, 11 January 2020 at 12:22:25 UTC, Marcone wrote:
>     wchar[1024] szFileName = 0;
>     ofn.lpstrFile = cast(LPWSTR) szFileName;

You shouldn't cast there, just use `szFileName.ptr` instead.

>     ofn.nMaxFile = MAX_PATH;

and this should be the length of the array. It may require a case

nMaxFile = cast(DWORD) szFileName.length;


More information about the Digitalmars-d-learn mailing list