Home > Back-end >  CreateThread create a thread can convey a smart pointer to the created thread?
CreateThread create a thread can convey a smart pointer to the created thread?

Time:09-25

From & lt; MyClass> PMyClass (new myClass ());

CreateThread (NULL, 0, & amp; MainController: : MobileLoginPopupWnd, pMyClass 0, & amp; DwThreadID);


The pMyClass can pass?
How should if you can pass?

CodePudding user response:

No one reply? My top one

CodePudding user response:

CB programmers that some people won't use CreateThread this WINFDOWS SDK functions to manage threads, CB class libraries have a class called TThread, directly BOOST Shared pointer as you TThread subclasses of members and from the constructor,

You this way of directly using the SDK to manage threads error prone, and difficult to manage, development efficiency is also poor, learn the use of TThread advice,

CodePudding user response:

Know learning thank you

CodePudding user response:

CreateThread requires a void * parameters, so as long as you can into a void *, can be passed
  • Related