问个问题,谢谢了
我现在编的程序出了一个问题,希望大家指教:
这个程序分为两部分:
在ATL DLL方面,在ATL对象类DataSourse里面定义了一个成员变量:m_abc,这个变量的类型是自定议类ABC,这个类的有一个父类是
CWinThread.而在EXE方面调用ATL接口的一个方法,这个方法使用了m_abc.结果出现Assertion,在wincore,h的884行,在wincore.h上的
注释是这样的:
// Note: if either of the above asserts fire and you are
// writing a multithreaded application, it is likely that
// you have passed a C++ object from one thread to another
// and have used that object in a way that was not intended.
// (only simple inline wrapper functions should be used)
//
// In general, CWnd objects should be passed by HWND from
// one thread to another. The receiving thread can wrap
// the HWND with a CWnd object by using CWnd::FromHandle.
//
// It is dangerous to pass C++ objects from one thread to
// another, unless the objects are designed to be used in
// such a manner.
望告知怎么解决这个问题,谢谢了.