Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6541

Re: ambiguous operator on Visual Studio 2010

From "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com>
Newsgroups comp.lang.c++
Subject Re: ambiguous operator on Visual Studio 2010
Date 2011-06-10 12:36 +0200
Organization A noiseless patient Spider
Message-ID <issrk6$d01$1@dont-email.me> (permalink)
References (7 earlier) <41340d05-884d-41a9-85f8-af774630bdbb@dq9g2000vbb.googlegroups.com> <isp6jg$ng7$1@dont-email.me> <c31402eb-862e-4948-9545-d0d043bc0f7d@em7g2000vbb.googlegroups.com> <isr46i$36v$1@dont-email.me> <1107c9d8-6ebe-4a17-b53d-e4ce49f86e45@e14g2000yqa.googlegroups.com>

Show all headers | View raw


* Öö Tiib, on 10.06.2011 10:58:
> On Jun 9, 9:51 pm, "Alf P. Steinbach /Usenet"<alf.p.steinbach
> +use...@gmail.com>  wrote:
>> * Tiib, on 09.06.2011 13:52:
>>
>>> If there has to be interactive GUI then i somehow prefer Qt to
>>> MS GUI and OpenGL to DirectX. Compiles and works with MSVC. Also
>>> friendly i(something) and Linux addicts are lot happier with my
>>> code. ;)
>>
>> That sort of misses the point. You still need to ask for GUI subsystem when you
>> build that app for Windows. Unless you want a console window popping up...
>
> Yes, i may want it to be there (popping up can be avoided by hiding
> it),

Ah.


> because without console the cin, cerr and cout go to god knows
> where in Windows.

Well, in addition to God, you might ask me. :-) By default they go nowhere. But 
they can be redirected, by the ordinary redirection operators.


> Actually I have seen (portable to Linux and Mac)
> code that has gone full round:
>
>   int main( int argc, char *argv[] ) {
>       Configuration::Load( argc, argv );
>   #if defined(_MSC_VER)
>       BOOL ok = ::AllocConsole();

"If the compiler is MSVC, allocate a console window". Hm. You better inform 
those folks that they're doing meaningless things.


>       // ... mess with screen buffers of console
>       // ... redirect std streams to console
>   #endif
>       return Session::run( argc, argv );
>   }
>
> "Full round" in sense that they had /subsystem:windows and they had
> int main() and now what was missing was console.

That's my preference. An ordinary GUI subsystem app, with a standard `main`. Why 
write more to get non-standard code? That's just silly. It's like writing `void 
main`, one character more, just to get a non-standard idiot's[1] version.


> Also the solution to
> their issue was not as stupid as it feels. It sort of supports your
> point, sort of argues with it and sort of misses it too. ;) The real
> reasons behind the mess are in Windows architecture, the MS compiler
> team feels to consist of decent specialists.

There's no mess wrt. this in the Windows architecture.

To wit, the MinGW g++ compiler / toolchain does not have this problem.

Technical: `main` and `wMain` and `winMain` and `wWinMain` are not supported at 
the Windows API level (disregarding the MSVC runtime as part of the API).


Cheers & hth.,

- Alf

Notes:
[1] When I'm writing "idiot's" that's just an exaggeration to put it to a point. 
For example, Bjarne used that `void main` at least once in the second edition of 
The C++ Programming Language, and I'm not calling him an idiot. :-)

-- 
blog at <url: http://alfps.wordpress.com>

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ambiguous operator on Visual Studio 2010 "Aaron Gray" <ang.usenet@gmail.com> - 2011-06-08 14:09 +0100
  Re: ambiguous operator on Visual Studio 2010 Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-08 09:26 -0400
    Re: ambiguous operator on Visual Studio 2010 "Aaron Gray" <ang.usenet@gmail.com> - 2011-06-08 14:58 +0100
      Re: ambiguous operator on Visual Studio 2010 "Aaron Gray" <ang.usenet@gmail.com> - 2011-06-08 17:22 +0100
        Re: ambiguous operator on Visual Studio 2010 "Balog Pal" <pasa@lib.hu> - 2011-06-08 18:47 +0200
          Re: ambiguous operator on Visual Studio 2010 Krice <paulkp@mbnet.fi> - 2011-06-08 11:40 -0700
          Re: ambiguous operator on Visual Studio 2010 "Bo Persson" <bop@gmb.dk> - 2011-06-08 21:29 +0200
            Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-08 21:50 +0200
              Re: ambiguous operator on Visual Studio 2010 Öö Tiib <ootiib@hot.ee> - 2011-06-08 16:06 -0700
                Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-09 03:20 +0200
                Re: ambiguous operator on Visual Studio 2010 Krice <paulkp@mbnet.fi> - 2011-06-09 03:00 -0700
                Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-09 20:46 +0200
                Re: ambiguous operator on Visual Studio 2010 Krice <paulkp@mbnet.fi> - 2011-06-09 23:08 -0700
                Re: ambiguous operator on Visual Studio 2010 Öö Tiib <ootiib@hot.ee> - 2011-06-10 02:33 -0700
                Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-10 12:26 +0200
                Re: ambiguous operator on Visual Studio 2010 Öö Tiib <ootiib@hot.ee> - 2011-06-09 04:52 -0700
                Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-09 20:51 +0200
                Re: ambiguous operator on Visual Studio 2010 Öö Tiib <ootiib@hot.ee> - 2011-06-10 01:58 -0700
                Re: ambiguous operator on Visual Studio 2010 "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-10 12:36 +0200
            Re: ambiguous operator on Visual Studio 2010 "Balog Pal" <pasa@lib.hu> - 2011-06-09 13:32 +0200
          Re: ambiguous operator on Visual Studio 2010 "Balog Pal" <pasa@lib.hu> - 2011-06-10 12:24 +0200

csiph-web