Click here to Skip to main content
15,891,316 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

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