困难!
还是假的!
不如转到vb.net!

解决方案 »

  1.   

    vb6谢多县城不稳定
    请使用vb.net
      

  2.   

    http://www.dapha.net/vb/list.asp?id=1730
      

  3.   

    请注意安全再次建议使用vb.net
      

  4.   

    To use the cool multithreading in your VB app, you need some API calls (or my clsThreading.cls which is included in the .zip file) : The first and most important is the CreateThread call : Declare Function CreateThread Lib "kernel32" (ByVal lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long What it does? It creates a new thread in your app. Parameters :ByVal lpThreadAttributes As Any: The security attributes for the threads. The normal type is SECURITY_ATTRIBUTES, but you don´t need this parameter so use ByVal 0& as value. ByVal dwStackSize As Long: Tells Windows how much stack memory the thread should have. We don´t need it, use ByVal 0& for this parameter. ByVal lpStartAddress As Long: This is the most important parameter. It tells Windows which function the thread has to execute. To use this parameter, we need the AddressOf operator which can be used with public functions in public modules only. So place your threaded function in a module and for the lpStartAddress parameter use AddressOf YourFunction. ByVal dwCreationFlags As Long: The creation flags for the thread. To use this parameter, search the CREATE_* constants in the API Viewer (they are also in clsThreading.cls). One interesting flag is the CREATE_SUSPENDED flag, which allows you to create the thread disabled (not running). If you don´t need this parameter, use ByVal 0&. lpThreadID As Long: This is a ByRef parameter which represents the ID of the created thread. The return value of the CreateThread function is the handle to the created thread. A handle to a thread is like a Window handle (hWnd). It allows you to take control over the thread. If the CreateThread function returns 0, it failed to create the thread.The next important API call is SetThreadPriority :Declare Function SetThreadPriority Lib "kernel32" (ByVal hThread As Long, ByVal nPriority As Long) As LongIt sets the priority of a specified thread. Parameters :ByVal hThread As Long: The handle to the thread. You can use for example the return value of the CreateThread call. ByVal nPriority As Long: The new priority of the specified thread. The thread priority has five major values: THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL, THREAD_PRIORITY_ABOVE_NORMAL and THREAD_PRIORITY_HIGHEST which should be self-explaining. The constants for these values can be found in the API viewer (and in clsThreading.cls). To get the actual priority of a thread use the GetThreadPriority call.There are two more interesting threading calls, SuspendThread and ResumeThread :Declare Function SuspendThread Lib "kernel32" (ByVal hThread As Long) As LongDeclare Function ResumeThread Lib "kernel32" (ByVal hThread As Long) As LongSuspendThread disables a thread and ResumeThread enables a disabled thread. Parameters :ByVal hThread As Long: The handle to the thread we want to disable/enable. The last call, TerminateThread fully stops a thread. It is important that you stop all threads this way before closing your application because otherwise, it might crash.Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal dwExitCode As Long) As LongParameters :ByVal hThread As Long: We know it: The handle to the thread we want to terminate. ByVal dwExitCode As Long: An exit code (not needed). Use ByVal 0& for this parameter. 
      

  5.   

    我编过一个多线程的样例。在试运行的时候可以运行。但是一编译成为EXE文件。就不能用了~~~~~~~~~~~哎~~~~~~
      

  6.   

    ╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥
    ╠                                ╣
    ╠在VB的线程中使用DIR,NOW等函数试试 ╣
    ╠                                ╣
    ╠             肯定出错            ╣
    ╠                                ╣
    ╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨
      

  7.   

    Declare Function CreateThread Lib "kernel32" (ByVal lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
    在VB中怎么用?ByVal lpStartAddress As Long参数怎么写,比如,我的函数名为TEST!