首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

CCriticalSection使用有关问题

2012-03-24 
CCriticalSection使用问题我在一个MFC DLL工程中使用CCriticalSection,包含了#include afxmt.h在一个类

CCriticalSection使用问题
我在一个MFC DLL工程中使用CCriticalSection,包含了#include <afxmt.h>
在一个类中生命变量 
private:
  ...
  CCriticalSection m_csCache ;
  ...
但编译时却出现了如下错误:
  ...
  error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject'
  ...

请问高手们帮帮忙吧!急急急!!
谢谢大家了!!

[解决办法]
Multithreading Sample List
Home | Overview | How Do I | Details | Sample

See the following sample programs that illustrate multithreaded programming: 

MTGDI


MTMDI


MTRECALC


MUTEXES 
Back to Multithreading Tasks

[解决办法]
cannot access private member declared in class 'CObject'

从这句来看,是不是因为你把CCriticalSection m_csCache 声明为私有的,然后又在非类成员中调用了它啊

改为public试试

热点排行