Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Just a matter of style.. Pin
led mike4-Oct-07 9:42
led mike4-Oct-07 9:42 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 9:47
Mark Salsbery4-Oct-07 9:47 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 10:11
bigdenny2004-Oct-07 10:11 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 10:22
Mark Salsbery4-Oct-07 10:22 
GeneralRe: Just a matter of style.. [modified] Pin
bigdenny2004-Oct-07 10:39
bigdenny2004-Oct-07 10:39 
GeneralRe: Just a matter of style.. Pin
El Corazon4-Oct-07 10:51
El Corazon4-Oct-07 10:51 
GeneralRe: Just a matter of style.. Pin
Mark Salsbery4-Oct-07 11:00
Mark Salsbery4-Oct-07 11:00 
GeneralRe: Just a matter of style.. Pin
El Corazon4-Oct-07 13:34
El Corazon4-Oct-07 13:34 
Mark Salsbery wrote:
Thoughts, examples, advice?


If each object is interdependant upon the creation of the later object then I have no other way of writing it. You are using the naturally stacked architecture of the compiler to build and release objects. Given I am self-taught, others may offer better solutons. Assuming no additional processing needs to be applied you simply write in the form of

setup()
{
  create object1
  if (success)
  {
     create object2
     if (success)
     {
         .... (final statements evaluates total success)
      }
      cleanup object2
   }
   cleanup object1
   return evaluaton of total success
}


the clincher is when the algorithm requires post processing before cleanup. evaluatng if/else for every single object is bulky and time-consuming, and looks too busy to follow. But I have a few of those monsters I am not proud of. I will admit it. Others I have stopped and said, "can I define this differently? can I redefine it sideways/backwards or however?" redefining the problem sometimes helps. Sorry, I can't help you there.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

AnswerRe: Just a matter of style.. Pin
David Crow4-Oct-07 9:21
David Crow4-Oct-07 9:21 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 9:31
bigdenny2004-Oct-07 9:31 
GeneralRe: Just a matter of style.. Pin
David Crow4-Oct-07 9:46
David Crow4-Oct-07 9:46 
AnswerRe: Just a matter of style.. Pin
Michael Dunn4-Oct-07 11:03
sitebuilderMichael Dunn4-Oct-07 11:03 
GeneralRe: Just a matter of style.. Pin
bigdenny2004-Oct-07 11:06
bigdenny2004-Oct-07 11:06 
AnswerRe: Just a matter of style.. Pin
John R. Shaw4-Oct-07 11:28
John R. Shaw4-Oct-07 11:28 
AnswerRe: Just a matter of style.. Pin
DQNOK15-Oct-07 11:27
professionalDQNOK15-Oct-07 11:27 
QuestionGetting the handle of active window in other thread Pin
dudedotnet4-Oct-07 8:07
dudedotnet4-Oct-07 8:07 
AnswerRe: Getting the handle of active window in other thread Pin
Mark Salsbery4-Oct-07 8:47
Mark Salsbery4-Oct-07 8:47 
GeneralRe: Getting the handle of active window in other thread Pin
dudedotnet8-Oct-07 1:38
dudedotnet8-Oct-07 1:38 
QuestionRe: Getting the handle of active window in other thread Pin
Mark Salsbery8-Oct-07 6:47
Mark Salsbery8-Oct-07 6:47 
AnswerRe: Getting the handle of active window in other thread Pin
dudedotnet9-Oct-07 1:38
dudedotnet9-Oct-07 1:38 
GeneralRe: Getting the handle of active window in other thread Pin
Mark Salsbery9-Oct-07 5:52
Mark Salsbery9-Oct-07 5:52 
GeneralRe: Getting the handle of active window in other thread Pin
dudedotnet9-Oct-07 23:55
dudedotnet9-Oct-07 23:55 
QuestionInserting an ActiveX control based TreeView into a CAD program Pin
larsgregersen4-Oct-07 6:03
larsgregersen4-Oct-07 6:03 
QuestionIs there a way to switch focus?? Pin
Kiran Satish4-Oct-07 5:42
Kiran Satish4-Oct-07 5:42 
AnswerRe: Is there a way to switch focus?? Pin
Mark Salsbery4-Oct-07 5:51
Mark Salsbery4-Oct-07 5:51 

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.