Win32api: How to send a Struct in DialogBox?

starcanopy starcanopy at protonmail.com
Wed Oct 14 00:20:15 UTC 2020


On Wednesday, 14 October 2020 at 00:07:10 UTC, Marcone wrote:
> Solved:
>
> Teste * params = cast(Teste*) lParam;
>
> writeln(params.nome);
> writeln(params.idade);
>
>
> But here, how can send struct?
>
> DialogBoxParam(null, MAKEINTRESOURCE(IDD_DIALOG1), null, 
> &DlgMain, cast(int) &test); // Error, need "int" but I am 
> sending Test*

Sorry, I was going to create an example for you, but something 
came up. Thankfully, it looks like you've solved it in your own 
way (You might want to cast &test to LPARAM instead of int.), but 
if you have any more D/WinApi questions, you might want to check 
here: https://github.com/AndrejMitrovic/DWinProgramming.


More information about the Digitalmars-d-learn mailing list