最简单的方法,用任何c++编译器写一个dll
如果一定要用vb生成线程……没试过
如果一定要用vb生成线程……没试过
解决方案 »
- 请教达人,为什么VB编译的ActiveX EXE文件,已经在机器上注册了,却无法使用?
- 奇怪的问题 关于自制控件点击速度的问题
- 客户程序怎么能对本地,局域网,internet中的数据库进行操作!在线等!
- 用vb如何获得windows任务栏的高度大小
- 超级简单问题
- 如何用sql语句中,显示一列,这列是一个顺序的数字。也就是1,2,3。。。
- 请各位老大帮忙,~~菜鸟暴头中.~!!!! > <看下这段代码哪错了~!!!
- 我的贴子已经贴了四次怎么没人回答!
- 动态数组的赋值。。。急
- 请问在VB中如何知道MODEM是否在线?
- 用Vb开发桌面数据库(不包含服务/客户模式),使用什么样的技术最好???
- 关于串行通讯的问题!紧急求救!
有多线程下载的程序。具体位置不记得了,你可以以Thread为关键字查找
Public Function CreateNewThread(ByVal iDownloader As Long, ByVal cFunction As Long, Optional ByVal cPriority As Long = 0, Optional ByVal cEnabled As Boolean = True) As Long
Dim mHandle As Long
Dim CreationFlags As Long
Dim lpThreadId As Long
'CreationFlags = CREATE_SUSPENDED
CreationFlags = 0
mHandle = CreateThread(ByVal 0&, ByVal 0&, cFunction, ByVal 0&, CreationFlags, lpThreadId)
CreateNewThread = mHandle
If mHandle = 0 Then 'Failed creating the thread
Debug.Print "InitializeThread Function in clsThreading failed creating a new thread"
End If
End Function
Function test0() As Long
Form1.List1.AddItem "test0"
End Function
Function test1() As Long
Form1.List1.AddItem "test1"
End Function
Function test2() As Long
Form1.List1.AddItem "test2"
End Function
Function test3() As Long
Form1.List1.AddItem "test3"
End Function
Function test4() As Long
Form1.List1.AddItem "test4"
End Function
'form
Dim h1, h2, h3, h4, h5 As Long
Private Sub Command2_Click()
h1 = CreateNewThread(0, AddressOf test0, 0, True)
h2 = CreateNewThread(1, AddressOf test1, 0, True)
h3 = CreateNewThread(2, AddressOf test2, 0, True)
h4 = CreateNewThread(3, AddressOf test3, 0, True)
h5 = CreateNewThread(4, AddressOf test4, 0, True)
End Sub