Modify

Opened 16 years ago

Closed 16 years ago

#1582 closed Bug (Fixed)

_GUICtrlListView_GetHeader returns no handle

Reported by: funkey Owned by: J-Paul Mesnage
Milestone: 3.3.7.0 Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

#include <GuiListView.au3>

Local $hGui = GUICreate("Bug-Test")
Local $hLV = GUICtrlCreateListView("Test", 0, 0)
Local $hHeader1 = _GUICtrlListView_GetHeader($hLV)
Local $hHeader2 = HWnd(_GUICtrlListView_GetHeader($hLV))
Local $aPos1 = ControlGetPos($hGui, "", $hHeader1)
Local $aPos2 = ControlGetPos($hGui, "", $hHeader2)

If Not IsArray($aPos1) Then MsgBox(16, "Error", "$hHeader1 is no handle!")
If Not IsArray($aPos2) Then MsgBox(16, "Error", "$hHeader2 is no handle!")
ConsoleWrite($hHeader1 & @CR)
ConsoleWrite($hHeader2 & @CR)

Attachments (0)

Change History (5)

comment:1 by J-Paul Mesnage, 16 years ago

I assume you are in the same problem of mixing GUICtrlCreate...() builtin functions and _GUICtrl...() UDF functions.
Try to use _GUICtrlListview_Create() instead of GUICtrlCreateListview()
Some UDF works but not all in the mixing mode ...
Such mixing mode must be avoid.
I know that some _GUICtrl...() doc examples are using this mixed mode but that too good. They are so may example to check that perhaps some day I will check them ;)

comment:2 by funkey, 16 years ago

That has nothing to do with mixing function. Sorry, but I would not post this problem when I did not have a look on to that.

#include <GuiListView.au3>

Local $hGui = GUICreate("Bug-Test")
Local $hLV = _GUICtrlListView_Create($hGui, "Test", 0, 0)
Local $hHeader1 = _GUICtrlListView_GetHeader($hLV)
Local $hHeader2 = HWnd(_GUICtrlListView_GetHeader($hLV))
Local $aPos1 = ControlGetPos($hGui, "", $hHeader1)
Local $aPos2 = ControlGetPos($hGui, "", $hHeader2)

If Not IsArray($aPos1) Then MsgBox(16, "Error", "$hHeader1 is no handle!")
If Not IsArray($aPos2) Then MsgBox(16, "Error", "$hHeader2 is no handle!")
ConsoleWrite($hHeader1 & @CR)
ConsoleWrite($hHeader2 & @CR)

comment:3 by doudou, 16 years ago

Both variants work in AutoIt v. 3.3.4.0 - 3.3.6.1
But you have to use:

_GUICtrlListView_GetHeader(GuiCtrlGetHandle($hLV))

comment:4 by J-Paul Mesnage, 16 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

comment:5 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Resolution: Fixed
Status: assignedclosed

Fixed by revision [5787] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.