republican 发表于 2010-8-6 08:37:05

Au3自身是什么对象(CreateThread)?

以下代码14行处究竟应该怎么填?
好像官网也没有Me对象的说明, Au3自身创建的对象究竟是什么?#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 519, 133, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 272, 32, 75, 25)
$Label1 = GUICtrlCreateLabel("Label1", 32, 40, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$TestThread=ObjCreate("MT32.Thread")
;~ MsgBox(0,"",ObjName($TestThread))
$TestThread.CreateThread($TestThread,"_Test","")


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

Func _Test()
        $i=0
        Do
                $i += 1
                GUICtrlSetData($Label1,$i)
                Sleep(500)
        Until $i >=1000
EndFunc附说明:
CreateThread
功能:    创建线程
参数: ThreadObject 拥有线程函数的对象
    ThreadProc 线程函数名称
    Params 线程函数的参数
    ReturnObject 线程函数返回的是否为对象类型
    Suspending 线程创建后是否挂起
返回:    线程句柄

guland 老说Au3在没有被证明是无法多线程之前,是肯定可以多线程的,但对于以下的表述,Au3应该是不能做出来的:
$TestThread.ThreadObject.Label1.Text=1

所以,至少在VB层面上是不可能的。

78391493 发表于 2010-8-6 09:06:54

没用的 createthread要求提供一个对象,VB6的Me是指当前窗体对象

republican 发表于 2010-8-6 09:37:10

me不是指窗体对象,me既可以是窗体也可以是类。

lxd510213 发表于 2010-8-8 15:22:26

$Ret = DllCall('kernel32.dll', 'dword', 'ResumeThread', 'ptr', $hThread)

republican 发表于 2010-8-8 17:11:40

很感谢4楼,只是这样子任然无法创建,$Ret的意义我还是不太明白。
页: [1]
查看完整版本: Au3自身是什么对象(CreateThread)?