📄 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 + -