Re: AfxGetApp() returns NULL



Hi David,

I think that the style of formatting code is as subjective as anything can get in our business. I've worked with people that absolutely believe that God intended us to use the format:

if (...)
{
}
else
{
}

And I go to the church of more real estate and use:

if (...) {
}
else {
}

I also do this a lot:

if (...)
// One line of code
else
// One other line of code

I would put the else on the same line as the closing brace for the previous if, but that is *too* difficult to read. The thing I like the least is when people use this format:

if (...)
{
}
else
{
}

But, like I said, everyone has their preferences. Kind of makes you with K&R had imposed a format from the beginning. I've found that a good way to get to know code that I inherit is to reformat it. It makes me go through each line and think about all the blocks.

Tom

"David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:juT9j.11$pA7.5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message news:8evfm31u85r82m6gr6du6bh2fvb29jhkgq@xxxxxxxxxx
I have always known it is there. I set it when I first install VS. I thought you were
referring to some new option that would do something intelligent, instead of the current
poor model.

Whatever. I thought you would understand what "Indent braces" means.


What is unreadable? And I disable the use of tabs; I always replace tabs with spaces,
since that is universal. I don't see a problem with indentation, because even when I use
VS to edit my code, it gets the identation right, following my indentation style.

What is non-standard is to use standard 4 spaces for levels of indentation but only indent 1 space after a brace. And using spaces instead of tabs is hardly universal. That's why every programmer's text editor has an OPTION of whether to use spaces or tabs.


I expect an editor to HELP me create code. This means that it has to be fully usable from
the keyboard without requiring function keys, arrow keys, or the mouse. This is one of
the most critical criteria. VS editor is not really usable in this fashion. It has to
get indentation right. It has to automate all the same things that my current editor
automates for me, which are considerable. Automatic flow and justification of comment
text, automated change log handling, ability to insert multiple characters quickly (if I
want to put 77 asterisks in, it is Ctrl+U 77 *), automating the block comments I use.

The capabilities of automating the VS editor are so poor that I can't even do the simplest
of my automation; worse still, the creators of VS think that there is no reason to allow
me to add automation to every possible keystroke, including printable characters; the key
bindings are limited to control keys, alt keys, and function keys, making it relatively
useless to me.

The failure is that MS thinks that editors are technologies. Editors are not
technologies, they are religions.

Yeah, we've been through this before too. I think we should stop because obviously you did not hear me the first (or second or third) time that you can write a VSTO plug-in that does have access to every possible keystroke. I think your goal is not to share pragmatic, time-saving solutions to existing solutions, it is to lecture on why the current solutions don't fit your idea of nirvana, no matter whether that nirvana is so far from normal as to be irrelevant to the rest of us.

-- David



.



Relevant Pages

  • Re: AfxGetApp() returns NULL
    ... God intended us to use the format: ... the keyboard without requiring function keys, arrow keys, or the mouse. ... VS editor is not really usable in this ... of my automation; worse still, the creators of VS think that there is no ...
    (microsoft.public.vc.mfc)
  • Re: AfxGetApp() returns NULL
    ... I've been using the same indentation style for about 30 years, ... fighting a third-rate editor when I have a first-rate editor already. ... the keyboard without requiring function keys, arrow keys, or the mouse. ... The capabilities of automating the VS editor are so poor that I can't even do the simplest ...
    (microsoft.public.vc.mfc)
  • Re: Automation
    ... >automating everything, ... If you have the data in a standard format in a file that the program ... If the name changes but the format is tabular then you could use the VBA ... VBA code to read characters from the file and process them. ...
    (microsoft.public.access.forms)
  • Re: Changing ComputerName
    ... If you can manually run regedit.exe you can 'load a hive' file to ... good for experimenting before automating. ... A Previous post from Andy Allredincluded: ... >> You could use a script to alter the ComputerName & Hostname keys such as ...
    (microsoft.public.windowsxp.embedded)
  • Automating a computation process
    ... Could you please help me automating a process in EXCEL for the following ... I have data arranged in the following format: ... In Cells C13 to C14, I want to get the results of the counts if the ...
    (microsoft.public.excel.worksheet.functions)