Click here to Skip to main content
16,016,394 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to get CMemFile object by path? Pin
hanlei000000000931-Oct-06 14:28
hanlei000000000931-Oct-06 14:28 
GeneralRe: how to get CMemFile object by path? Pin
David Crow1-Nov-06 2:45
David Crow1-Nov-06 2:45 
QuestionHow to create transparent gif file? Pin
includeh1030-Oct-06 21:11
includeh1030-Oct-06 21:11 
AnswerRe: How to create transparent gif file? Pin
toxcct30-Oct-06 21:40
toxcct30-Oct-06 21:40 
QuestionTransition Pin
messages30-Oct-06 20:39
messages30-Oct-06 20:39 
AnswerRe: Transition Pin
Waldermort31-Oct-06 0:07
Waldermort31-Oct-06 0:07 
QuestionObligate single son Pin
Julia130-Oct-06 20:36
Julia130-Oct-06 20:36 
AnswerRe: Obligate single son Pin
benjymous31-Oct-06 0:51
benjymous31-Oct-06 0:51 
Make the constructor in your interface private, declare the implementation class as a friend to your interface, and use "public virtual" inheritance of your interface from the implementation class - that'll prevent any other class inheriting, as it won't be able to see the constructor.

See here:

http://www.research.att.com/~bs/bs_faq2.html#no-derivation[^]

The only problem is that the person doing the implementation would be free to change
class Usable : public virtual Usable_lock {

to
class Usable : public Usable_lock {

which would allow somebody to derive from Usable

If you've got control of setting up the instantiation of Usable, then all should be fine, but in the end of the day, there'll always be loopholes if the person doing the development is determined to do things they shouldn't (That's what code reviews are for!)

--
Help me! I'm turning into a grapefruit!
Buzzwords!

GeneralRe: Obligate single son Pin
Julia131-Oct-06 3:16
Julia131-Oct-06 3:16 
QuestionOutputting variables in a MessageBox Pin
AbhishekBK30-Oct-06 20:35
AbhishekBK30-Oct-06 20:35 
AnswerRe: Outputting variables in a MessageBox Pin
Michael Dunn30-Oct-06 20:41
sitebuilderMichael Dunn30-Oct-06 20:41 
GeneralRe: Outputting variables in a MessageBox Pin
AbhishekBK30-Oct-06 21:56
AbhishekBK30-Oct-06 21:56 
AnswerRe: Outputting variables in a MessageBox Pin
David Crow31-Oct-06 3:16
David Crow31-Oct-06 3:16 
AnswerRe: Outputting variables in a MessageBox Pin
Maximilien31-Oct-06 3:26
Maximilien31-Oct-06 3:26 
Questionalgorithm equal_range Pin
clint198230-Oct-06 20:26
clint198230-Oct-06 20:26 
QuestionHow to add application specific metada ta into wmv file Pin
Hemant kulkarni30-Oct-06 20:25
Hemant kulkarni30-Oct-06 20:25 
AnswerRe: How to add application specific metada ta into wmv file Pin
Mark Salsbery30-Oct-06 20:39
Mark Salsbery30-Oct-06 20:39 
GeneralRe: How to add application specific metada ta into wmv file Pin
Hemant kulkarni30-Oct-06 22:08
Hemant kulkarni30-Oct-06 22:08 
GeneralRe: How to add application specific metada ta into wmv file Pin
Mark Salsbery31-Oct-06 5:41
Mark Salsbery31-Oct-06 5:41 
GeneralRe: How to add application specific metada ta into wmv file Pin
Hemant kulkarni31-Oct-06 17:21
Hemant kulkarni31-Oct-06 17:21 
Questionerror PRJ0019: A tool returned an error code from "Register OPC Server" Pin
mpk197930-Oct-06 20:01
mpk197930-Oct-06 20:01 
QuestionHow to incept the Keyboard press in console app? Pin
jethao30-Oct-06 19:52
jethao30-Oct-06 19:52 
QuestionHit testing the NC area Pin
Waldermort30-Oct-06 19:39
Waldermort30-Oct-06 19:39 
AnswerRe: Hit testing the NC area Pin
Mark Salsbery30-Oct-06 20:21
Mark Salsbery30-Oct-06 20:21 
GeneralRe: Hit testing the NC area Pin
Waldermort30-Oct-06 20:36
Waldermort30-Oct-06 20:36 

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.