main() is not Main

Oct 9, 2020 at 1:47pm
I was totally blown away when I copied / pasted some C++ COM code into a MS Visual Studio Console App project... Trying to learn COM.

When I started to trace/debug the program... the execution does not go to the main() statement as the first point. Wow! Seriously... they made main() not to be Main any longer. I think that is crzy.

rant off.
Oct 9, 2020 at 2:28pm
That's normal. I don't think "main" is ever the first function in the executable.
Oct 9, 2020 at 5:55pm
I know that in MFC Dialog programs... InitInstance is first... I just didn't know that main() was not primary/first in Console Apps.... I figured that at least those were still normal....

Oh Well....

Thanks.
Oct 9, 2020 at 7:06pm
It would not be possible. There's a lot to set up before main() can even start. As a simple example, someone has to read the environment and put the command line arguments into argc and argv.
Oct 11, 2020 at 2:44am
helios - OK... Thanks...

I learned something about COM today:

Clarification: As mentioned, I made a MS Visual Studio Console App project.... to learn COM.

It turns out that the first file / class that gets executed - is the interface.h file... So in COM terms... that does make sense.

Last edited on Oct 11, 2020 at 2:45am
Topic archived. No new replies allowed.