Modify

Opened 8 years ago

Last modified 9 months ago

#2443 assigned Feature Request

Name of nested structs

Reported by: GtaSpider Owned by: Jpm
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 (3)

comment:1 Changed 8 years ago by GtaSpider

Sorry, forgot to set version to blank :(

comment:2 Changed 8 years ago by TicketCleanup

  • Version 3.3.9.20 deleted

Automatic ticket cleanup.

comment:3 Changed 9 months ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

introduce new types tag/endtag to be use in DllStructCreate()
DllStruct*Data can be replace by $tStruct.tag.element
DllStructGetPtr by $tStruct.tag.element.Ptr()

Fiw sent to Jon

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 assigned The owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.