Jump to content

Recent beta problem


MadBoy
 Share

Recommended Posts

In non-beta autoit this line works fine:

Global Const $WM_NOTIFY = 0x004E

In beta it doesn't. I guess the $WM_NOTIFY is used somewhere else in include. I still need that WM_NOTIFY to be able to catch things in a ListView. Anyway to prevent that WARNING?

C:\Projects\Project.AU3\Pro-S_Hardware_Professional\pro-s_hardware_installer_2.0.0.11.au3(35,33) : ERROR: $WM_NOTIFY previously declared as a 'Const'

Global Const $WM_NOTIFY = 0x004E

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Projects\Project.AU3\Pro-S_Hardware_Professional\pro-s_hardware_installer_2.0.0.11.au3 - 1 error(s), 0 warning(s)

MadBoy

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Hi, you answered your own problem.. lol

Global Const $WM_NOTIFY = 0x004E is in the WindowsConstants.au3..

WindowsConstants.au3 is called by Constants.au3 and ListviewContants.au3 calls Constants.au3 and GuiContants.au3 calls ListviewContants.au3..

So if your using #include<GuiConstants.au3> then $WM_NOTIFY is already declared so no need to declare it again...

Link to comment
Share on other sites

Hi, you answered your own problem.. lol

Global Const $WM_NOTIFY = 0x004E is in the WindowsConstants.au3..

WindowsConstants.au3 is called by Constants.au3 and ListviewContants.au3 calls Constants.au3 and GuiContants.au3 calls ListviewContants.au3..

So if your using #include<GuiConstants.au3> then $WM_NOTIFY is already declared so no need to declare it again...

Ye i know, but when i remove it it doesn't show error however the code below doesn't work anymore. It does work in non-beta. I'm checking now some examples in newest beta to see what to modify to get this to work <_< Thanks anyway.

GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")

Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    #forceref $hWndGUI, $MsgID, $wParam
    ;ListView Events
    Local Const $NM_FIRST = 0
    Local Const $NM_CLICK = ($NM_FIRST - 2)
    Local Const $NM_DBLCLK = ($NM_FIRST - 3)
    Local $tagNMHDR, $event, $hwndFrom, $code
    $tagNMHDR = DllStructCreate("int;int;int", $lParam) ;NMHDR (hwndFrom, idFrom, code)
    If @error Then Return
    $event = DllStructGetData($tagNMHDR, 3)
    Select
        Case $wParam = $gui_builds_view
            Select
                Case $event = $NM_CLICK
                    ListView_Click()
                Case $event = $NM_DBLCLK
                    ListView_DoubleClick()
            EndSelect
    EndSelect
    $tagNMHDR = 0
    $event = 0
    ;$lParam = 0
EndFunc   ;==>WM_Notify_Events

Func _BuildChoice($id_number)
    Local $full_build_information
    $full_build_information = _HashF_Get ($id_number, $build_information)
    If $full_build_information <> "" Then
        $full_build_information = StringSplit($full_build_information, "|", 1)
        $ghost_file = $full_build_information[3] & "\" & $full_build_information[2]
        _AddLineBox("Image File Path - " & $ghost_file)
    EndIf
EndFunc   ;==>_BuildChoice
Func ListView_Click()
    Local $temporary_value = StringSplit(_GUICtrlListView_GetItemTextString($gui_builds_view, _GUICtrlListView_GetSelectedIndices($gui_builds_view)), "|", 1)
    _BuildChoice($temporary_value[1])
EndFunc   ;==>ListView_Click
Func ListView_DoubleClick()
    ;MsgBox(0, "Double Clicked", _GUICtrlListViewGetItemText($devicelist, _GUICtrlListViewGetSelectedIndices($devicelist)))
EndFunc   ;==>ListView_DoubleClick

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Test it before setting it with IsDeclared(), and do this OUTSIDE of a function, near the top of the script:

If IsDeclared("WM_NOTIFY") = 0 Then Global CONST $WM_NOTIFY = 0x0048

In an environment where it is not already declared, you may get an error message about possibly using $WM_NOTIFY before it was declared, this is normal because the declaration is conditional, and can be safely ignored.

<_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Test it before setting it with IsDeclared(), and do this OUTSIDE of a function, near the top of the script:

If IsDeclared("WM_NOTIFY") = 0 Then Global CONST $WM_NOTIFY = 0x0048

In an environment where it is not already declared, you may get an error message about possibly using $WM_NOTIFY before it was declared, this is normal because the declaration is conditional, and can be safely ignored.

<_<

Thanks PsaltyDS,

The problem is a bit more complicated since i can see that const in <GuiConstants.au3> so i don't need to define it anymore. The problem now is because wheter i will use your suggestion or not the ListView gui controlling stopped working in beta.

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Thanks PsaltyDS,

The problem is a bit more complicated since i can see that const in <GuiConstants.au3> so i don't need to define it anymore. The problem now is because wheter i will use your suggestion or not the ListView gui controlling stopped working in beta.

Turns out in newest beta _GUICtrlListView_GetSelectedIndices($gui_builds_view) isn't needed anymore. Thanks anyway <_<

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...