Click here to Skip to main content
14,331,586 members

ATL / WTL / STL

 
SuggestionRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Richard MacCutchan14-Dec-14 3:04
protectorRichard MacCutchan14-Dec-14 3:04 
GeneralRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Member 110189677-Jan-15 23:22
memberMember 110189677-Jan-15 23:22 
GeneralRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Richard MacCutchan8-Jan-15 0:07
protectorRichard MacCutchan8-Jan-15 0:07 
Questionusing friend Pin
bkelly139-Dec-14 7:29
memberbkelly139-Dec-14 7:29 
AnswerRe: using friend Pin
Richard MacCutchan10-Dec-14 5:22
protectorRichard MacCutchan10-Dec-14 5:22 
GeneralRe: using friend Pin
bkelly1311-Dec-14 10:24
memberbkelly1311-Dec-14 10:24 
GeneralRe: using friend Pin
Richard MacCutchan11-Dec-14 23:07
protectorRichard MacCutchan11-Dec-14 23:07 
GeneralRe: using friend Pin
Aescleal11-Dec-14 23:52
memberAescleal11-Dec-14 23:52 
If all instances of C are owned by and created by an instance of M and there are no other clients of C then I can't see a lot of problem in making M a friend of C. You're essentially saying that C is a part of M you don't need all the time so you want to tear it off and discard it after some initialisation process.

Another way of doing it would be to introduce a new class, A that contains the bits of M that C needs to manipulate. M would contain an instance of A and pass a pointer to the instance to C when needed. That gives you a bit more future proofing and decoupling - both C and M don't depend on each other and just depend on A.

Yet another way would be to have a getter/setter interface on M but if C's the only thing that would want to use it then you're complicating the interface of M for no real reason.

Personally I'd go for the first and consider the second or third later if the requirements change and you need more flexibility.
GeneralRe: using friend Pin
bkelly1312-Dec-14 12:12
memberbkelly1312-Dec-14 12:12 
GeneralRe: using friend Pin
Aescleal15-Dec-14 5:18
memberAescleal15-Dec-14 5:18 
AnswerRe: using friend Pin
Theo Buys22-Dec-14 4:25
memberTheo Buys22-Dec-14 4:25 
QuestionHow to create a dll as Unbreakable in C#.Net? Pin
karthickbm7-Dec-14 20:37
memberkarthickbm7-Dec-14 20:37 
AnswerRe: How to create a dll as Unbreakable in C#.Net? Pin
Richard MacCutchan7-Dec-14 22:52
protectorRichard MacCutchan7-Dec-14 22:52 
QuestionTCP/API class basic design Pin
bkelly138-Nov-14 16:31
memberbkelly138-Nov-14 16:31 
AnswerRe: TCP/API class basic design Pin
Garth J Lancaster8-Nov-14 16:56
professionalGarth J Lancaster8-Nov-14 16:56 
GeneralRe: TCP/API class basic design Pin
bkelly139-Nov-14 2:15
memberbkelly139-Nov-14 2:15 
AnswerRe: TCP/API class basic design Pin
Garth J Lancaster8-Nov-14 17:06
professionalGarth J Lancaster8-Nov-14 17:06 
GeneralRe: TCP/API class basic design Pin
bkelly139-Nov-14 2:19
memberbkelly139-Nov-14 2:19 
AnswerRe: TCP/API class basic design Pin
Albert Holguin10-Nov-14 4:58
professionalAlbert Holguin10-Nov-14 4:58 
GeneralRe: TCP/API class basic design Pin
bkelly1310-Nov-14 12:40
memberbkelly1310-Nov-14 12:40 
AnswerRe: TCP/API class basic design Pin
Albert Holguin10-Nov-14 16:47
professionalAlbert Holguin10-Nov-14 16:47 
GeneralMultiple threads explained Pin
bkelly1311-Nov-14 6:30
memberbkelly1311-Nov-14 6:30 
GeneralRe: Multiple threads explained Pin
Albert Holguin11-Nov-14 7:01
professionalAlbert Holguin11-Nov-14 7:01 
GeneralRe: Multiple threads explained Pin
bkelly1311-Nov-14 9:58
memberbkelly1311-Nov-14 9:58 
AnswerRe: TCP/API class basic design Pin
pasztorpisti10-Jan-15 11:06
professionalpasztorpisti10-Jan-15 11:06 

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.