Click here to Skip to main content
12,300,298 members (52,865 online)

ATL / WTL / STL

 
AnswerRe: SQL Server Compact Edition Pin
Richard MacCutchan11-Feb-13 4:42
mvpRichard MacCutchan11-Feb-13 4:42 
GeneralRe: SQL Server Compact Edition Pin
Haakon S.11-Feb-13 5:37
memberHaakon S.11-Feb-13 5:37 
GeneralRe: SQL Server Compact Edition Pin
Richard MacCutchan11-Feb-13 5:58
mvpRichard MacCutchan11-Feb-13 5:58 
Questionerror while trying to uplaod the file in current directory using c language Pin
raghvendrapanda30-Jan-13 19:34
memberraghvendrapanda30-Jan-13 19:34 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
Richard MacCutchan30-Jan-13 22:03
mvpRichard MacCutchan30-Jan-13 22:03 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
«_Superman_»1-Feb-13 20:34
member«_Superman_»1-Feb-13 20:34 
QuestionTCP/IP CAsyncSocket and pointers to same Pin
bkelly1324-Jan-13 15:16
memberbkelly1324-Jan-13 15:16 
Answerclasses don't call upwards Pin
bkelly1326-Jan-13 8:55
memberbkelly1326-Jan-13 8: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 Pin
imagiro14-Jan-13 8:10
memberimagiro14-Jan-13 8:10 
AnswerRe: ATL and exceptions Pin
Jonathan Davies18-Jan-13 9:39
memberJonathan Davies18-Jan-13 9:39 
AnswerRe: ATL and exceptions Pin
bkelly1324-Jan-13 15:24
memberbkelly1324-Jan-13 15:24 
GeneralRe: ATL and exceptions Pin
Jonathan Davies6-Feb-13 7:23
memberJonathan Davies6-Feb-13 7:23 
GeneralRe: ATL and exceptions Pin
Albert Holguin11-Feb-13 5:12
memberAlbert Holguin11-Feb-13 5:12 
Questionunicode and non-unicode Pin
bkelly1314-Jan-13 3:45
memberbkelly1314-Jan-13 3:45 
AnswerRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 6:24
mvpRichard MacCutchan14-Jan-13 6:24 
GeneralRe: unicode and non-unicode Pin
bkelly1314-Jan-13 8:43
memberbkelly1314-Jan-13 8:43 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 22:13
mvpRichard MacCutchan14-Jan-13 22:13 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan20-Jan-13 22:08
mvpRichard MacCutchan20-Jan-13 22:08 
AnswerRe: unicode and non-unicode Pin
pasztorpisti20-Jan-13 1:33
memberpasztorpisti20-Jan-13 1:33 
GeneralRe: unicode and non-unicode Pin
bkelly1320-Jan-13 8:56
memberbkelly1320-Jan-13 8:56 
GeneralRe: unicode and non-unicode Pin
pasztorpisti20-Jan-13 10:45
memberpasztorpisti20-Jan-13 10:45 
AnswerRe: unicode and non-unicode Pin
Albert Holguin11-Feb-13 5:10
memberAlbert Holguin11-Feb-13 5:10 
Questionsqlconfigdatasource fails on 64 bit from 64 application Pin
khaliloenit10-Jan-13 23:02
memberkhaliloenit10-Jan-13 23:02 
AnswerRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
Richard MacCutchan10-Jan-13 23:10
mvpRichard MacCutchan10-Jan-13 23:10 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
khaliloenit10-Jan-13 23:14
memberkhaliloenit10-Jan-13 23:14 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 12 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid