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

2020-01-12 Thread Marcone via Digitalmars-d-learn
On Saturday, 11 January 2020 at 14:21:25 UTC, Adam D. Ruppe wrote: 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 =

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

2020-01-11 Thread Adam D. Ruppe via Digitalmars-d-learn
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

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

2020-01-11 Thread Marcone via Digitalmars-d-learn
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. Solution: import std; import core.sys.windows.windows; pragma(lib, "comdlg32"); // Function

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

2020-01-11 Thread John Chapman via Digitalmars-d-learn
On Saturday, 11 January 2020 at 10:34:34 UTC, Marcone wrote: This code works, but I can't get file Path. Someone can help me? import std; import core.sys.windows.windows; pragma(lib, "comdlg32"); void main(){ OPENFILENAME ofn; wchar* szFileName; You need to supply a buffer, not a

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

2020-01-11 Thread Marcone via Digitalmars-d-learn
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. This code works, but I can't get file Path. Someone can help me? import std; import

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

2020-01-11 Thread Marcone via Digitalmars-d-learn
On Saturday, 11 January 2020 at 00:12:03 UTC, René Heldmaier wrote: On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. Have a look at this website:

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

2020-01-11 Thread Marcone via Digitalmars-d-learn
On Friday, 10 January 2020 at 15:44:53 UTC, Mike Parker wrote: On Friday, 10 January 2020 at 15:06:07 UTC, Marcone wrote: Very complicated. Can you send me the simple clear code? https://docs.microsoft.com/en-us/windows/win32/dlgbox/using-common-dialog-boxes Not compile in Dlang.

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

2020-01-10 Thread René Heldmaier via Digitalmars-d-learn
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. Have a look at this website: http://www.winprog.org/tutorial/app_two.html It helped me a lot

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

2020-01-10 Thread Mike Parker via Digitalmars-d-learn
On Friday, 10 January 2020 at 15:06:07 UTC, Marcone wrote: Very complicated. Can you send me the simple clear code? https://docs.microsoft.com/en-us/windows/win32/dlgbox/using-common-dialog-boxes

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

2020-01-10 Thread Marcone via Digitalmars-d-learn
On Friday, 10 January 2020 at 14:52:36 UTC, Adam D. Ruppe wrote: On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. You just call GetOpenFileName or

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

2020-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote: How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much. You just call GetOpenFileName or GetSaveFileName. here it is in my minigui.d

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

2020-01-10 Thread Marcone via Digitalmars-d-learn
How create "Open" and "Save as" Dialog using "Win32 Api" and Dlang? Please send me a simple example code in Dlang. Thank you very much.