Click here to Skip to main content
15,890,946 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPropertyView Problems Compiling Pin
Stuart Dootson2-Jun-09 21:39
professionalStuart Dootson2-Jun-09 21:39 
GeneralRe: CPropertyView Problems Compiling Pin
wdolson2-Jun-09 22:03
wdolson2-Jun-09 22:03 
QuestionHi Help me write this program (tuan1111) Pin
tuan11111-Jun-09 17:37
tuan11111-Jun-09 17:37 
QuestionCreating Threads using Class Object functions Pin
jobin0070071-Jun-09 15:38
jobin0070071-Jun-09 15:38 
AnswerRe: Creating Threads using Class Object functions Pin
David Crow1-Jun-09 17:04
David Crow1-Jun-09 17:04 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070071-Jun-09 17:30
jobin0070071-Jun-09 17:30 
GeneralRe: Creating Threads using Class Object functions Pin
David Crow2-Jun-09 2:30
David Crow2-Jun-09 2:30 
GeneralRe: Creating Threads using Class Object functions Pin
norish2-Jun-09 2:09
norish2-Jun-09 2: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 2:12
norish2-Jun-09 2:12 
AnswerRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 2:25
professionalStuart Dootson2-Jun-09 2:25 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 4:27
jobin0070072-Jun-09 4:27 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 5:13
professionalStuart Dootson2-Jun-09 5:13 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 12:17
jobin0070072-Jun-09 12:17 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 12:30
professionalStuart Dootson2-Jun-09 12:30 
GeneralRe: Creating Threads using Class Object functions Pin
jobin0070072-Jun-09 4:33
jobin0070072-Jun-09 4:33 
GeneralRe: Creating Threads using Class Object functions Pin
Stuart Dootson2-Jun-09 5:25
professionalStuart Dootson2-Jun-09 5:25 
QuestionIs it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 12:46
FocusedWolf1-Jun-09 12:46 
GeneralRe: Is it "ok" to get array length this way Pin
norish1-Jun-09 13:27
norish1-Jun-09 13:27 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 16:07
FocusedWolf1-Jun-09 16:07 
AnswerRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 14:43
professionalStuart Dootson1-Jun-09 14:43 
GeneralRe: Is it "ok" to get array length this way Pin
Chris Losinger1-Jun-09 15:35
professionalChris Losinger1-Jun-09 15:35 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf1-Jun-09 16:15
FocusedWolf1-Jun-09 16:15 
GeneralRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 20:27
professionalStuart Dootson1-Jun-09 20:27 
GeneralRe: Is it "ok" to get array length this way Pin
FocusedWolf2-Jun-09 4:27
FocusedWolf2-Jun-09 4:27 
GeneralRe: Is it "ok" to get array length this way Pin
Stuart Dootson1-Jun-09 20:32
professionalStuart Dootson1-Jun-09 20: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.