Modify

Opened 6 years ago

Last modified 6 years ago

#2443 new Feature Request

Name of nested structs

Reported by: GtaSpider Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: nested structs Cc:

Description

Hello,

as mentioned in this topic, i would realy like to see the ability to name nested structs.
http://www.autoitscript.com/forum/topic/154288-betastructs-and-nested-structs/

f.e. $tagMINMAXINFO: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632605(v=vs.85).aspx consists of five POINT ($tagPOINT) structs. And these structs consits of two LONG variables. If you now could name these nested structs you could set them like on the example below. I don't know what would be better, maybe it would be smarter to set the name of the structure after the ENDSTRUCT keyword so you could use them like these

$tagMINMAXINFO = $tagPOINT&" ptReserved; "&$tagPOINT&" ptMaxSize; [...]"

And the example:

#include <StructureConstants.au3>

#cs - Example 1
	Global Const $tagMINMAXINFO = "struct ptReserved;long X;long Y;endstruct;" & _
	"struct ptMaxSize;long X;long Y;endstruct;" & _
	"struct ptMaxPosition;long X;long Y;endstruct;" & _
	"struct ptMinTrackSize;long X;long Y;endstruct;" & _
	"struct ptMaxTrackSize;long X;long Y;endstruct;"
#ce - Example 1

#region - Example 2, may the smarter option
Global Const $tagMINMAXINFO = $tagPOINT & " ptReserved;" & _
		$tagPOINT & " ptMaxSize;" & _
		$tagPOINT & " ptMaxPosition;" & _
		$tagPOINT & " ptMinTrackSize;" & _
		$tagPOINT & " ptMaxTrackSize;"
#endregion - Example 2, may the smarter option


 
$tMINMAXINFO = DllStructCreate($tagMINMAXINFO)
 
;should be
$tMINMAXINFO.ptReserved.X = 12
ConsoleWrite('$tMINMAXINFO.ptReserved.X = ' & $tMINMAXINFO.ptReserved.X & @LF);empty (error)
 
;is actually
$tMINMAXINFO.X = 12
ConsoleWrite('$tMINMAXINFO.X = ' & $tMINMAXINFO.X & @LF);returns 12, but on which X?
 
;this works (first element: ptReserved.X)
ConsoleWrite('DllStructGetData($tMINMAXINFO,1,1) = ' & DllStructGetData($tMINMAXINFO, 1) & @LF);Returns 12
 
;the other X's are untouched
ConsoleWrite('DllStructGetData($tMINMAXINFO,3) = ' & DllStructGetData($tMINMAXINFO, 3) & @LF);Returns 0
 
;this works
DllStructSetData($tMINMAXINFO, 3, 5)
ConsoleWrite('DllStructGetData($tMINMAXINFO,3) = ' & DllStructGetData($tMINMAXINFO, 3) & @LF);Returns 5

Thanks in Advance,
Sincerely,
your Spider.
p.s. thank you very much for your effort!

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by GtaSpider

Sorry, forgot to set version to blank :(

comment:2 Changed 6 years ago by TicketCleanup

  • Version 3.3.9.20 deleted

Automatic ticket cleanup.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as new The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.