Questions tagged [cautoptr]

5 questions
8
votes
4 answers

No copy constructor available or copy constructor is declared 'explicit'

Could somebody please explain why I'm getting a compile error here - error C2558: class 'std::auto_ptr<_Ty>' : no copy constructor available or copy constructor is declared 'explicit' #include #include #include…
Carl
  • 43,122
  • 10
  • 80
  • 104
1
vote
3 answers

Difference between ATL CAutoPtr and STL std::auto_ptr?

I'm writing some code in MFC and I want to use auto pointers. I've come across two different classes that look like they do the same thing: CAutoPtr and std::auto_ptr What are people's thoughts about the two different implementations? Further, I…
Jared
  • 5,977
  • 10
  • 38
  • 48
1
vote
2 answers

Does the CAutoPtr class implement reference counting?

Modern ATL/MFC applications now have access to a new shared pointer class called CAutoPtr, and associated containers (CAutoPtrArray, CAutoPtrList, etc.). Does the CAutoPtr class implement reference counting?
Rob
  • 76,700
  • 56
  • 158
  • 197
0
votes
1 answer

AutoPtr in C++/CLI mixed mode

I have a C++/CLI wrapper around native .lib and .h files. I use the AutoPtr class pretty extensively in the wrapper class to manage the unmanaged objects I create for wrapping. I have hit a roadblock with the copy constructor/assignment…
TomO
  • 458
  • 2
  • 9
  • 20
-2
votes
1 answer

C++ Trouble accessing CAutoPtr array

I'm working on a windows program whose's goal is to display image buttons using GDIPlus and the Windows header file. The images are attached to an global CAutoPtr array. Inside the button callback, I handle the WM_PAINT message by searching the…
Andrew
  • 307
  • 7
  • 13