beginthread

    2热度

    1回答

    有上_beginthreadexMSDN page此功能: unsigned __stdcall SecondThreadFunc(void* pArguments) { printf("In second thread...\n"); while (Counter < 1000000) Counter++; _endthreadex(0);

    1热度

    1回答

    我想知道是否在C++中为线程方法使用beginthread或QueueUserWorkItem。这两个API之间有什么区别,它们在哪些方面更适合? 感谢, BTW,我已经阅读了这个问题Windows threading: _beginthread vs _beginthreadex vs CreateThread C++

    0热度

    1回答

    我需要例如运行: ShellExecute(NULL, "open", "program.exe", NULL, NULL, SW_HIDE); 为新的线程,但我不知道怎么办。 我尝试这样做: HANDLE hThread = (HANDLE) _beginthread(ShellExecute(NULL, "open", "program.exe", NULL, NULL, SW_HIDE)

    5热度

    1回答

    我已经有一个几乎完成的应用程序,我想实现的下一个功能是线程化。我选择了BeginThread(),尽管我知道delphi中的TThread。我遇到的问题是BeginThread()调用的结构。通常在该会打电话我希望能够拧功能的程序。该行是 CompareFiles(form1.Edit3.Text,Form1.Edit4.Text,Form1.StringGrid2,op); op是一个整数。

    0热度

    1回答

    我是新来的线程和Winforms/C++。当我按下按钮时,我想在新线程中启动一个函数。我正在关注这个线程为tutorial。当我在单独的VC++项目中构建在该站点上给出的示例代码时,构建成功。 但是,如果我在我的C++/Winforms中执行以下操作,则生成将无法完成,我收到编译错误。 我在这里错过了什么? 帮助! 代码: void Test(void *arg); private: Syste

    0热度

    2回答

    我有一个任务来创建一个像Frogger的游戏(你知道 - 青蛙必须穿过街道的游戏)。到目前为止,我已经创建了青蛙和汽车运动背后的逻辑,但我似乎无法同时运行这些流程。我知道多线程是这样做的正确方法,但是我在通过_beginthread传递参数时遇到了一些麻烦。 这是我到目前为止有: void moveCarsLeft(int x, int y) { if (y < 0) { f

    0热度

    1回答

    #include <iostream> #include <Windows.h> #include <process.h> //#include "windowstate.cpp" //DWORD WINAPI MyThreadFunction(LPVOID lpParam); using namespace std; int Zeit; unsigned int __s

    0热度

    1回答

    我有下面的代码来启动一个新线程 int number = 10; _beginthread(ModbusReadWrite, 0, (void*)number); 功能是: ​​ 它显示了一个错误: error C2440: 'initializing' : cannot convert from 'void **' to 'int' 所以,我需要定义int类型的新参数并将其传递给Mod

    0热度

    2回答

    我在使用在Microsoft Visual Studio C++ 10所明示_beginthread一个问题: 我的代码: void __cdecl DashThread(void * Args) // function without any class refs { while(1){ MessageBox::Show("work"); Sleep(5000

    2热度

    2回答

    我想使用多线程和封装在函数foo中的所有东西来做一些事情。 filterThread = _beginthread (foo, 0,NULL) ; ,我想让foo返回值: int foo() { return iRet; } 但_beginthread _CRTIMP uintptr_t __cdecl _beginthread (_In_ void (__cdecl * _