A special type when creating a structure

Ask for help, how to use AHK_H, etc.
arcticir
Posts: 471
Joined: 17 Nov 2013, 11:32

A special type when creating a structure

31 Aug 2017, 04:12

How to create the following structure in the special type? Such as: CLSID clsid;

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



From here:
https://msdn.microsoft.com/en-us/librar ... 88(v=vs.85).aspx
HotKeyIt
Posts: 1549
Joined: 29 Sep 2013, 18:35
Contact:

Re: A special type when creating a structure

31 Aug 2017, 10:01

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

arcticir
Posts: 471
Joined: 17 Nov 2013, 11:32

Re: A special type when creating a structure

31 Aug 2017, 12:38

thank you very much.
arcticir
Posts: 471
Joined: 17 Nov 2013, 11:32

Re: A special type when creating a structure

07 Sep 2017, 12:31

The following script, why is the definition invalid?

Code: [Select all] [Download] GeSHi © Codebox Plus

Error:  Invalid structure definition.

Specifically: RAWINPUTDEVICE

input_event(r){
static RAWINPUTDEVICE:="struct { USHORT usUsagePage;USHORT usUsage;DWORD dwFlags;HWND hwndTarget;}"
static static:=struct("RAWINPUTDEVICE raw[2]",{raw:[{usUsagePage:1,usUsage:2,dwFlags:0x00000100,hwndTarget:A_ScriptHWND},{usUsagePage:1,usUsage:6,dwFlags:0x00000100,hwndTarget:A_ScriptHWND}]})
}
HotKeyIt
Posts: 1549
Joined: 29 Sep 2013, 18:35
Contact:

Re: A special type when creating a structure

07 Sep 2017, 15:28

Because the structure is inside the function and as far as I remember the initialization of static lines does not happen in function's scope.
So you will need to tell it where the structure definition is input_event(RAWINPUTDEVICE):

Code: [Select all] [Download] GeSHi © Codebox Plus

input_event(r){
static RAWINPUTDEVICE:="struct{USHORT usUsagePage;USHORT usUsage;DWORD dwFlags;HWND hwndTarget}"
static rid:=struct("input_event(RAWINPUTDEVICE) raw[2]",{raw:[{usUsagePage:1,usUsage:2,dwFlags:0x00000100,hwndTarget:A_ScriptHWND},{usUsagePage:1,usUsage:6,dwFlags:0x00000100,hwndTarget:A_ScriptHWND}]})
}

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 1 guest