|
-
September 27th, 1999, 01:37 PM
#1
[HELP] using class member data in worker Thread??
Hi:
I declare a class..
class CMyClass
{
void function_name();
data_type member_name;
...
}
//and its implementation
CMyClass::function_name()
{ ...
AfxBeginThread(ThreadFunc,this);
...
}
UINT ThreadFunc(LPVOID pParam)
{
CMyClass* my_class=(CMyClass*)pParam;
my_class->mamber_name->func();
// I found problems when using the member data of CMyClass
// for example: if the member data is IWebBrowser2* m_Web;
// and when I call IWebBrowser2->QueryInterface(IID_IHTMLDocuement2,(void**) &pDoc) in the thread function,
// it must be failed!!
}
I dont know how to use this kind of member data when using worker thread
especially the functions provided by these member data of declared class object.
if there any good method to make it?
any response will be great appreciated!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|