Click here to Skip to main content
16,012,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Solution Pin
valikac15-Jul-02 17:11
valikac15-Jul-02 17:11 
QuestionHow do you wait until a process has finihed before you start another Pin
Desmond Mardle15-Jul-02 9:17
Desmond Mardle15-Jul-02 9:17 
AnswerRe: How do you wait until a process has finihed before you start another Pin
Joaquín M López Muñoz15-Jul-02 9:21
Joaquín M López Muñoz15-Jul-02 9:21 
GeneralRe: How do you wait until a process has finihed before you start another Pin
Desmond Mardle15-Jul-02 22:00
Desmond Mardle15-Jul-02 22:00 
AnswerRe: How do you wait until a process has finihed before you start another Pin
User 842015-Jul-02 9:28
User 842015-Jul-02 9:28 
GeneralExplorer 'like' App Pin
Frank Deo15-Jul-02 9:01
Frank Deo15-Jul-02 9:01 
GeneralThreads Pin
Frank Deo15-Jul-02 9:00
Frank Deo15-Jul-02 9:00 
GeneralRe: Threads Pin
Joaquín M López Muñoz15-Jul-02 9:12
Joaquín M López Muñoz15-Jul-02 9:12 
#1. Yes. The whole function is executed in the new thread, which exits when the function exits. For instance:
DWORD WINAPI MyThread(LPVOID arg){
  function1();
  function2();
  // whatever additional code you'd like to insert
  return 0; // the value returned does not matter ona a first approach
}
 
//inside some other function or UI handler or whatever
DWORD dwThreadId;
HANDLE hThread=CreateThread(
  NULL,
  0,
  MyThread,
  NULL, // this corresponds to the "arg" parm of MyThread
  0,
  &dwThreadId
);


#2: The code above just answer this. For production level code you'll need some more stuff (to control when the thread exists, for instance) but this piece of code should get you started.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Threads Pin
Frank Deo15-Jul-02 9:23
Frank Deo15-Jul-02 9:23 
Questioncan you disable all scrollbars in an MDI? Pin
ns15-Jul-02 8:50
ns15-Jul-02 8:50 
Generalquick SDI question Pin
ns15-Jul-02 8:46
ns15-Jul-02 8:46 
GeneralRe: quick SDI question Pin
PJ Arends15-Jul-02 15:23
professionalPJ Arends15-Jul-02 15:23 
GeneralRe: quick SDI question Pin
ns15-Jul-02 15:46
ns15-Jul-02 15:46 
GeneralRe: quick SDI question Pin
PJ Arends15-Jul-02 16:41
professionalPJ Arends15-Jul-02 16:41 
GeneralI cant thank you enough!!!! Pin
ns15-Jul-02 17:00
ns15-Jul-02 17:00 
GeneralRe: I cant thank you enough!!!! Pin
PJ Arends15-Jul-02 17:14
professionalPJ Arends15-Jul-02 17:14 
Generaltrouble with movewindow and MDI scrolling Pin
ns15-Jul-02 7:45
ns15-Jul-02 7:45 
GeneralSetting font Pin
Al_Pennyworth15-Jul-02 7:20
Al_Pennyworth15-Jul-02 7:20 
QuestionChange font of CFileDialog ? Pin
dlhson15-Jul-02 7:15
dlhson15-Jul-02 7:15 
QuestionSocket problem ? Pin
dlhson15-Jul-02 7:13
dlhson15-Jul-02 7:13 
QuestionRegion into a polygon? Pin
phruby15-Jul-02 7:13
phruby15-Jul-02 7:13 
AnswerRe: Region into a polygon? Pin
Scott H. Settlemier15-Jul-02 10:06
Scott H. Settlemier15-Jul-02 10:06 
GeneralRe: Region into a polygon? Pin
phruby15-Jul-02 10:21
phruby15-Jul-02 10:21 
GeneralPrint something graphical on a printer Pin
Qadddd15-Jul-02 7:05
Qadddd15-Jul-02 7:05 
GeneralRe: Print something graphical on a printer Pin
Mike Nordell15-Jul-02 20:11
Mike Nordell15-Jul-02 20:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.