Click here to Skip to main content

ATL / WTL / STL

 
AnswerRe: 64 bit MFC application failed to create mdb and mdw files ? PinmvpRichard MacCutchan12-Feb-13 5:57 
GeneralATL how get the name of the target class inside of a template? PinmemberFrank Coder12-Feb-13 4:16 
GeneralRe: ATL how get the name of the target class inside of a template? PinmvpRichard MacCutchan12-Feb-13 5:55 
GeneralRe: ATL how get the name of the target class inside of a template? PinmemberFrank Coder15-Feb-13 20:51 
Questionadd sys dsn failed on windows 7 64 Pinmemberkhaliloenit11-Feb-13 6:59 
QuestionSQL Server Compact Edition PinmemberHaakon S.11-Feb-13 5:23 
AnswerRe: SQL Server Compact Edition PinmvpRichard MacCutchan11-Feb-13 5:42 
GeneralRe: SQL Server Compact Edition PinmemberHaakon S.11-Feb-13 6:37 
GeneralRe: SQL Server Compact Edition PinmvpRichard MacCutchan11-Feb-13 6:58 
Questionerror while trying to uplaod the file in current directory using c language Pinmemberraghvendrapanda30-Jan-13 20:34 
AnswerRe: error while trying to uplaod the file in current directory using c language PinmvpRichard MacCutchan30-Jan-13 23:03 
AnswerRe: error while trying to uplaod the file in current directory using c language Pinmember«_Superman_»1-Feb-13 21:34 
QuestionTCP/IP CAsyncSocket and pointers to same Pinmemberbkelly1324-Jan-13 16:16 
Answerclasses don't call upwards Pinmemberbkelly1326-Jan-13 9:55 
After writing the OP I outlined the process with all the steps then began to implement.
 
I have started using a common directory for re-usable code. In order for the Manager to call a method in its creator it must know the name of the owner's class.   To do that I added a forward declaration in the Manager.
 
However, this means that when the class is re-used, and the owner has a different name, the Manager must be changed.  
 
There is another indicator this is a bad practice.   After the forward declaration in the dot H file, the dot CPP file needs to reference the dot H file of the owner. The common code resides in another directory and it cannot find the central code of the main project unless it is specifically spelled out.   Then, if the project is moved or re-name, the common code must change.
 
There may be a way to do this automatically using directive and path names within Visual Studio.   But I now think that even if that can be done it would be miss-guided.
 
Conclusion:
A utility class can call "down" the heiarchy to objects it creates, but should not call up to its owner.   While the concept of it calling up may make the owner code neater, it represents an inversion of authority. (Regardless of how the methods are name, a call up in an inversion.)
 
Problems remain:
The main application uses pointers into the lower level objects to accomplish its tasks.   How does it become aware that the lower level needs to exit, or maybe even has already exited.
 
Controlled exits:
When the TCP sending function detects that the client has closed the connection it does not exit right away.   It waits until the upper level code calls the method to send the data.   Then the lower level returns an error code stating that the data has not been sent and that the object is exiting.
 
Uncontrolled exits:
I generally do not like exceptions, but this appears to be a time when an exception is warranted.   When the lower level must terminate unexpectedly, then an exception could work its way back to the upper level and the exception handler can NULL the pointer.
 
Thanks for your time
QuestionATL and exceptions Pinmemberimagiro14-Jan-13 9:10 
AnswerRe: ATL and exceptions PinmemberJonathan Davies18-Jan-13 10:39 
AnswerRe: ATL and exceptions Pinmemberbkelly1324-Jan-13 16:24 
GeneralRe: ATL and exceptions PinmemberJonathan Davies6-Feb-13 8:23 
GeneralRe: ATL and exceptions PinmemberAlbert Holguin11-Feb-13 6:12 
Questionunicode and non-unicode Pinmemberbkelly1314-Jan-13 4:45 
AnswerRe: unicode and non-unicode PinmvpRichard MacCutchan14-Jan-13 7:24 
GeneralRe: unicode and non-unicode [modified] Pinmemberbkelly1314-Jan-13 9:43 
GeneralRe: unicode and non-unicode PinmvpRichard MacCutchan14-Jan-13 23:13 
GeneralRe: unicode and non-unicode PinmvpRichard MacCutchan20-Jan-13 23:08 
AnswerRe: unicode and non-unicode Pinmemberpasztorpisti20-Jan-13 2:33 
GeneralRe: unicode and non-unicode Pinmemberbkelly1320-Jan-13 9:56 
GeneralRe: unicode and non-unicode Pinmemberpasztorpisti20-Jan-13 11:45 
AnswerRe: unicode and non-unicode PinmemberAlbert Holguin11-Feb-13 6:10 
Questionsqlconfigdatasource fails on 64 bit from 64 application Pinmemberkhaliloenit11-Jan-13 0:02 
AnswerRe: sqlconfigdatasource fails on 64 bit from 64 application PinmvpRichard MacCutchan11-Jan-13 0:10 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pinmemberkhaliloenit11-Jan-13 0:14 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application PinmvpRichard MacCutchan11-Jan-13 0:32 
QuestionProblem with embedded ATL component PinmemberHungryCPPDev7-Jan-13 2:08 
Questionbooks: activeX and com, [modified] Pinmemberbkelly131-Jan-13 10:58 
AnswerRe: books: activeX and com, PinmemberJonathan Davies10-Jan-13 2:56 
QuestionWhile launching a winapp as ole server some time OnFIleNew() failed Pinmembervermaashish_mca31-Dec-12 1:27 
QuestionTCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberbkelly1321-Dec-12 7:09 
AnswerRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberpasztorpisti22-Dec-12 10:51 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberbkelly1327-Dec-12 7:16 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberpasztorpisti27-Dec-12 14:47 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API [modified] Pinmemberbkelly1328-Dec-12 4:08 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberpasztorpisti28-Dec-12 4:37 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberbkelly1327-Dec-12 9:22 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberpasztorpisti27-Dec-12 15:02 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API PinmemberSoMad27-Dec-12 15:51 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberbkelly1328-Dec-12 4:13 
GeneralRe: TCP blocking -vs- CAsyncSocket -vs- Win32 API Pinmemberpasztorpisti28-Dec-12 6:06 
Questioncalling virtual base class Pinmemberbkelly1314-Dec-12 8:36 
AnswerRe: calling virtual base class Pinmemberpasztorpisti18-Dec-12 23:39 
AnswerRe: calling virtual base class PinmemberAlbert Holguin19-Dec-12 8:22 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150224.1 | Last Updated 28 Feb 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid