Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple Inheritance question Pin
Stuart Dootson31-Mar-09 20:23
professionalStuart Dootson31-Mar-09 20:23 
GeneralRe: Multiple Inheritance question code worked Pin
ForNow31-Mar-09 18:11
ForNow31-Mar-09 18:11 
AnswerRe: Multiple Inheritance question Pin
Joe Woodbury31-Mar-09 8:11
professionalJoe Woodbury31-Mar-09 8:11 
GeneralRe: Multiple Inheritance question Pin
Stuart Dootson31-Mar-09 12:22
professionalStuart Dootson31-Mar-09 12:22 
GeneralRe: Multiple Inheritance question Pin
ForNow31-Mar-09 15:32
ForNow31-Mar-09 15:32 
AnswerRe: Multiple Inheritance question Pin
Cedric Moonen31-Mar-09 20:19
Cedric Moonen31-Mar-09 20:19 
GeneralRe: Multiple Inheritance question Pin
ForNow1-Apr-09 2:42
ForNow1-Apr-09 2:42 
AnswerRe: Multiple Inheritance question Pin
Stuart Dootson31-Mar-09 21:44
professionalStuart Dootson31-Mar-09 21:44 
Following Cedric's response (which is quite correct) that your class shouldn't be both a lock and a sync object, here's a further suggestion that avoids both that confusion and the use of this in constructor calls.

Look at this page from Boost[^] describing the 'base-from-member' idiom.

Now, you could re-factor your code as:

struct mylock_pbase
{
   mylock_pbase() : syncObject(NULL) {}
   CSyncObject syncObject;
};

class mylock : private mylock_pbase, public CSingleLock
{
public:
   mylock(BOOL bInitialLock) : mylock_pbase(),
                               CSingleLock(&syncObject, bInitialLock)
   {
   }
   BOOL Unlock();
};


You could use the boost::base_from_member class, but it would only remove the need to declare mylock_pbase.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Multiple Inheritance question Pin
ForNow1-Apr-09 16:05
ForNow1-Apr-09 16:05 
GeneralRe: Multiple Inheritance question [modified] Pin
Stuart Dootson1-Apr-09 21:26
professionalStuart Dootson1-Apr-09 21:26 
GeneralRe: Multiple Inheritance question Pin
ForNow2-Apr-09 2:48
ForNow2-Apr-09 2:48 
QuestionVc++6.0. ADO. When I link in RELEASE mode I get Unresolved External error on ADO. Pin
Antonio292931-Mar-09 5:32
Antonio292931-Mar-09 5:32 
AnswerRe: Vc++6.0. ADO. When I link in RELEASE mode I get Unresolved External error on ADO. Pin
David Crow31-Mar-09 5:43
David Crow31-Mar-09 5:43 
GeneralRe: Vc++6.0. ADO. When I link in RELEASE mode I get Unresolved External error on ADO. Pin
Antonio292931-Mar-09 6:12
Antonio292931-Mar-09 6:12 
GeneralRe: Vc++6.0. ADO. When I link in RELEASE mode I get Unresolved External error on ADO. Pin
Stuart Dootson31-Mar-09 7:12
professionalStuart Dootson31-Mar-09 7:12 
Questionhow to set breakpoint in this way? Pin
George_George31-Mar-09 5:27
George_George31-Mar-09 5:27 
QuestionRe: how to set breakpoint in this way? Pin
David Crow31-Mar-09 5:28
David Crow31-Mar-09 5:28 
AnswerRe: how to set breakpoint in this way? Pin
Stuart Dootson31-Mar-09 7:17
professionalStuart Dootson31-Mar-09 7:17 
QuestionWM_NCCALCSIZE bug with Vista Desktop Composition Pin
sanguino.jose31-Mar-09 5:06
sanguino.jose31-Mar-09 5:06 
Questionurl filtering Pin
aks.31-Mar-09 4:58
aks.31-Mar-09 4:58 
QuestionAny Suggetions for an efficient way? Pin
FISH78631-Mar-09 4:57
FISH78631-Mar-09 4:57 
QuestionRe: Any Suggetions for an efficient way? Pin
David Crow31-Mar-09 5:06
David Crow31-Mar-09 5:06 
AnswerRe: Any Suggetions for an efficient way? Pin
FISH78631-Mar-09 5:07
FISH78631-Mar-09 5:07 
GeneralRe: Any Suggetions for an efficient way? Pin
David Crow31-Mar-09 5:27
David Crow31-Mar-09 5:27 
GeneralRe: Any Suggetions for an efficient way? Pin
Stephen Hewitt31-Mar-09 17:08
Stephen Hewitt31-Mar-09 17:08 

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.