?? vb調用createthread創建線程失敗.txt
字號:
Simply say, AddressOf doesn't behave properly in VB6. It is really lucky you didn't get a GPF when you trying to use multi-thread with CreateThread function. In other word CreateThread DOESN'T work.
You may try to use Apartment thread in vb6 that is a good or say stable way to use multi-thread in vb.
<END>
CreateThread API 定 義 為 :
Public Declare Function CreateThread Lib "kernel32" _
(lpThreadAttributes As Long, ByVal dwStackSize As Long, _
byval lpStartAddress As Long, lpParameter As Any, ByVal _
dwCreationFlags As Long, lpThreadId As Long) As Long
Public vbbl As Boolean
就 可 以 了 !
<END>
函 數 聲 明 為 :
Declare Function CreateThread Lib "kernel32" (ByVal lpSecurityAttributes As Long, _
ByVal dwStackSize As Long, _
ByVal lpStartAddress As Long, _
ByVal lpParameter As Long, _
ByVal dwCreationFlags As Long, _
lpThreadId As Long) As Long
調 用 :
hnd = CreateThread(0, 2000, AddressOf線 程 體 名 ( 函 數 名 ) ,參 數 , 0, threadid)
即 可 。
<END>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -