Thread overview | |||||
---|---|---|---|---|---|
|
October 10, 2020 Win32Api GetDlgItemText How make buffer with no fixed size? | ||||
---|---|---|---|---|
| ||||
wchar[100] buffer; // I don't want fixed size :( GetDlgItemText(hwn, widget, buffer.ptr, buffer.sizeof); |
October 10, 2020 Re: Win32Api GetDlgItemText How make buffer with no fixed size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcone | On Saturday, 10 October 2020 at 10:15:03 UTC, Marcone wrote:
> wchar[100] buffer; // I don't want fixed size :(
wchar[] buffer; // no fixed size
buffer.length = GetWindowTextLength(hwn); // set it to the text length of the window
// now get the text
GetDlgItemText(hwn, widget, buffer.ptr, buffer.length);
Use buffer.length instead of buffer.sizeof in D.
|
October 12, 2020 Re: Win32Api GetDlgItemText How make buffer with no fixed size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Saturday, 10 October 2020 at 12:31:14 UTC, Adam D. Ruppe wrote:
> On Saturday, 10 October 2020 at 10:15:03 UTC, Marcone wrote:
>> wchar[100] buffer; // I don't want fixed size :(
>
> wchar[] buffer; // no fixed size
>
> buffer.length = GetWindowTextLength(hwn); // set it to the text length of the window
>
> // now get the text
> GetDlgItemText(hwn, widget, buffer.ptr, buffer.length);
>
>
>
> Use buffer.length instead of buffer.sizeof in D.
Very good! working fine. Thank you.
|
Copyright © 1999-2021 by the D Language Foundation