IcWang
September 27th, 1999, 01:37 PM
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!!
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!!