Click here to Skip to main content
15,845,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPropertyView Problems Compiling Pin
Stuart Dootson2-Jun-09 22:39
professionalStuart Dootson2-Jun-09 22:39 
GeneralRe: CPropertyView Problems Compiling Pin
wdolson2-Jun-09 23:03
wdolson2-Jun-09 23:03 
QuestionHi Help me write this program (tuan1111) Pin
tuan11111-Jun-09 18:37
tuan11111-Jun-09 18:37 
QuestionCreating Threads using Class Object functions Pin
jobin0070071-Jun-09 16:38
jobin0070071-Jun-09 16:38 
AnswerRe: Creating Threads using Class Object functions Pin
David Crow1-Jun-09 18:04
David Crow1-Jun-09 18:04 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070071-Jun-09 18:30
jobin0070071-Jun-09 18:30 
GeneralRe: Creating Threads using Class Object functions Pin
David Crow2-Jun-09 3:30
David Crow2-Jun-09 3:30 
GeneralRe: Creating Threads using Class Object functions Pin
norish2-Jun-09 3:09
norish2-Jun-09 3:09 
If you want use CreateThread() Win32 API then must write additional static function to satisfy CreateThread()'s calling convention.
Like;

#include <windows.h>
class ABC {
  HANDLE m_child;
public:
  static DWORD __stdcall DO(void* p) {
    ((ABC*)p)->DoReally();
  };
  void DoReally() {};
};
void main()
{
  ABC Object[20];
  HANDLE childHandles[20];
  DOWRD childIds[20];
  for (int i = 0; i < 20; i++) {
    childHandles[i] = CreateThread(NULL, 0, Object[i].DO, &Object[i], 0, &childIds[i]);
  }
}


But CreateThread() do not mention C runtime, so I recommend _beginthreadex() runtime function to call.

In general, if you want to make thread with some windows api, you should make some entry point matching its api function interface.
NewsRe: Creating Threads using Class Object functions Pin
norish2-Jun-09 3:12
norish2-Jun-09 3:12 
AnswerRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 3:25
professionalStuart Dootson2-Jun-09 3:25 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 5:27
jobin0070072-Jun-09 5:27 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 6:13
professionalStuart Dootson2-Jun-09 6:13 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 13:17
jobin0070072-Jun-09 13:17 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 13:30
professionalStuart Dootson2-Jun-09 13:30 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 5:33
jobin0070072-Jun-09 5:33 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 6:25
professionalStuart Dootson2-Jun-09 6:25 
QuestionIs it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 13:46
FocusedWolf1-Jun-09 13:46 
GeneralRe: Is it "ok" to get array length this way Pin
norish1-Jun-09 14:27
norish1-Jun-09 14:27 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 17:07
FocusedWolf1-Jun-09 17:07 
AnswerRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 15:43
professionalStuart Dootson1-Jun-09 15:43 
GeneralRe: Is it "ok" to get array length this way Pin
Chris Losinger1-Jun-09 16:35
professionalChris Losinger1-Jun-09 16:35 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 17:15
FocusedWolf1-Jun-09 17:15 
GeneralRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 21:27
professionalStuart Dootson1-Jun-09 21:27 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf2-Jun-09 5:27
FocusedWolf2-Jun-09 5:27 
GeneralRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 21:32
professionalStuart Dootson1-Jun-09 21:32 

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.