Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
May be you have missed to malloc first before insert into MyArray.MyDataStructure* pNewStruct;pNewStruct =(MyDataStructure* )malloc(sizeof(MyDataStructure));MyArray.Add(pNewStruct);Hope this will work.
This work for me and i get value after thread exit. Compare your code with me , you can understand your problem. Another thing CreateThread can not call a member function, so you must need a static function for this.,#include "stdafx.h"#include #include #include #include class...
6 Oct 2012Michael Haephrati 7 alternatives
I would appreciate it if someone can provide me with a code sample for using CAtlArray as a member variable inside a class, where the array should hold a custom data structure.I have defined the data structure:typedef struct{ int Status; CTime StatusDate;}...
9 Oct 2012Michael Haephrati
How can I get notified, to the main even loop when this thread completes?
8 Oct 2012Michael Haephrati
Something like// testproject.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #include typedef struct{ CString FullPath; CTime StatusDate;} Item;class MyClass{public: MyClass(); ~MyClass(); void...
6 Oct 2012Michael Haephrati
[ bappycse05] is correct but I also used a Thread which is a member function of a class and wanted it to access the class's member variables, but the moment the thread ends, any changes it makes in any member variables are erased.
Use this ---dwRet = WaitForSingleObject(HANDLE,TIME);see the example .. http://www.installsetupconfig.com/win32programming/threadprocesssynchronizationapis11_13.html[^]when thread will be completed, use postmessage method to inform UI :D
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.