Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8640901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:23:26+00:00 2026-06-12T11:23:26+00:00

I have been trying to fix/find a solution for an hour or so for

  • 0

I have been trying to fix/find a solution for an hour or so for this.
Basically I have:

CCriticalSection pCS;

inside a class declaration, and then I use a CSingleLock like this:

CSingleLock pSL(&pCS);
pSL.Lock();
*Stuff happening here*
pSL.Unlock();

to lock and unlock the pCS. But initializing the CriticalSection seems to always end up in this:

c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxmt.h(82): error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'
c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(535) : see declaration of 'CObject::operator ='
c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(509) : see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CSyncObject &CSyncObject::operator =(const CSyncObject &)'

I have 4 worker threads in the program and I’m sending them the pointer to the class where the CCriticalSection is, and the threads are working on the CCriticalSection, aswell as the main thread. The threads use the pointer of the class to use the CSingleLock that uses the CCriticalSection.

For your information, the code also includes Direct2D but that shouldn’t be relevant.

Some help would be appreciated.

EDIT:

Just tried to make a new project with just:

#include <afxmt.h>

in it. It gave me exceptions. Is that normal? I’m using VC++ 2010 Professional.

SOLVED:

Had a CEvent up there aswell, so I thought I’d make it into a pointer as well, and whaddya you know. It fixed that problem. Now there’s an afxmt.h file giving me exceptions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:23:28+00:00Added an answer on June 12, 2026 at 11:23 am

    Had a CEvent up there aswell, so I thought I’d make it into a pointer as well, and whaddya you know. It fixed that problem. Now there’s an afxmt.h file giving me exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying for hours to find a solution this problem but have not
So, I have been trying to fix this for about two months. It all
I really need some help with this as I have been trying to fix
I have been trying desperately to fix this issue where my ListView items are
Ok so I have been trying to fix this for days, and I'm not
I have been trying to find out the problem to this for a day
I have been trying to fix this problem but not been able to do
I've been trying all night to find a solution to this problem and haven't
I am trying to fix a regular expression i have been using in php
I have been trying to migrate a database from Sybase to MySQL. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.