Click here to Skip to main content
15,913,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: using BitBlt for preview DC Pin
Code-o-mat21-Jan-09 1:41
Code-o-mat21-Jan-09 1:41 
GeneralRe: using BitBlt for preview DC Pin
_T("No name")21-Jan-09 1:51
_T("No name")21-Jan-09 1:51 
GeneralRe: using BitBlt for preview DC Pin
Code-o-mat21-Jan-09 1:55
Code-o-mat21-Jan-09 1:55 
GeneralRe: using BitBlt for preview DC Pin
_T("No name")21-Jan-09 2:02
_T("No name")21-Jan-09 2:02 
AnswerRe: using BitBlt for preview DC Pin
Nishad S20-Jan-09 21:58
Nishad S20-Jan-09 21:58 
GeneralRe: using BitBlt for preview DC Pin
_T("No name")20-Jan-09 23:27
_T("No name")20-Jan-09 23:27 
QuestionHow to handle smart ptrs and multiple inheritance? Pin
Member 260377220-Jan-09 18:27
Member 260377220-Jan-09 18:27 
AnswerRe: How to handle smart ptrs and multiple inheritance? Pin
Stuart Dootson20-Jan-09 23:23
professionalStuart Dootson20-Jan-09 23:23 
If you use Boost shared_ptrs[^], the reference count is held on the object rather than the interface you're using - consider this code:

#include <boost/shared_ptr.hpp>
#include <iostream>

class A
{
public:
   ~A() { std::cout << "A::~A()\n"; }
};

class B
{
public:
   ~B() { std::cout << "B::~B()\n"; }
};

class C : public A, public B
{
public:
   ~C() { std::cout << "C::~C()\n"; }
};

int main(int argc, char** argv)
{
   {
      std::cout << "Enter pC\n";
      boost::shared_ptr<C> pC(new C);
      {
         std::cout << "Enter pB\n";
         boost::shared_ptr<B> pB (pC);
         std::cout << "Exit pB\n";
      }
      {
         std::cout << "Enter pA\n";
         boost::shared_ptr<A> pA (pC);
         std::cout << "Exit pA\n";
      }
      std::cout << "Exit pC\n";
   }
}


The output is

Enter pC
Enter pB
Exit pB
Enter pA
Exit pA
Exit pC
C::~C()
B::~B()
A::~A()


so, the object is only destructed once, when pC goes out of scope.
GeneralRe: How to handle smart ptrs and multiple inheritance? Pin
Member 260377221-Jan-09 15:36
Member 260377221-Jan-09 15:36 
GeneralRe: How to handle smart ptrs and multiple inheritance? Pin
Stuart Dootson21-Jan-09 21:01
professionalStuart Dootson21-Jan-09 21:01 
GeneralRe: How to handle smart ptrs and multiple inheritance? Pin
Member 260377222-Jan-09 4:22
Member 260377222-Jan-09 4:22 
QuestionConvert CString to Binary and Binary to CString Pin
NewVC++20-Jan-09 18:21
NewVC++20-Jan-09 18:21 
QuestionRe: Convert CString to Binary and Binary to CString Pin
CPallini20-Jan-09 21:46
mveCPallini20-Jan-09 21:46 
QuestionRe: Convert CString to Binary and Binary to CString Pin
SandipG 21-Jan-09 1:34
SandipG 21-Jan-09 1:34 
AnswerRe: Convert CString to Binary and Binary to CString Pin
KarstenK21-Jan-09 1:57
mveKarstenK21-Jan-09 1:57 
GeneralRe: Convert CString to Binary and Binary to CString Pin
toxcct21-Jan-09 2:15
toxcct21-Jan-09 2:15 
QuestionDockablePanes - Splitters are not seen Pin
Taruni20-Jan-09 17:37
Taruni20-Jan-09 17:37 
QuestionEncrypt and Dcrypt String(Urgent) Pin
newhivc20-Jan-09 17:28
newhivc20-Jan-09 17:28 
AnswerRe: Encrypt and Dcrypt String(Urgent) Pin
Hamid_RT20-Jan-09 19:03
Hamid_RT20-Jan-09 19:03 
AnswerRe: Encrypt and Dcrypt String(Urgent) Pin
CPallini20-Jan-09 22:04
mveCPallini20-Jan-09 22:04 
QuestionHow to get ip from computer name? Pin
MANISH RASTOGI20-Jan-09 17:16
MANISH RASTOGI20-Jan-09 17:16 
AnswerRe: How to get ip from computer name? Pin
Stuart Dootson20-Jan-09 23:52
professionalStuart Dootson20-Jan-09 23:52 
GeneralRe: How to get ip from computer name? Pin
MANISH RASTOGI21-Jan-09 18:33
MANISH RASTOGI21-Jan-09 18:33 
AnswerRe: How to get ip from computer name? Pin
David Crow21-Jan-09 3:29
David Crow21-Jan-09 3:29 
QuestionHelp Pin
Deepu Antony20-Jan-09 17:16
Deepu Antony20-Jan-09 17:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.