"James Kanze" <> wrote in message
news:bcbca8c1-5bc4-41e0-937c-...
> On Jan 26, 10:15 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>> "James Kanze" <james.ka...@gmail.com> wrote in message
>
>> news:657bc0a5-8454-4d89-9141-...
>
>> > On Jan 26, 1:49 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>> >> "James Kanze" <james.ka...@gmail.com> wrote in message
>
>> > [...]
>> >> >> C++ is not a portable programming language and any, non
>> >> >> trivial, program will only work on the system is was
>> >> >> designed to work on.
>
>> >> > That's not been my experience. I've moved several large (500
>> >> > KLoc or more) applications from Windows or Solaris to Linux,
>> >> > with no real problems. Given the way the language has evolved,
>> >> > it's often been more work to move to a more recent version of
>> >> > the compiler than to move from Windows to Unix.
>
>> >> Even a very basic windows winmain function and messsage loop cannot be
>> >> ported, your lucky if it runs on your version of windows nvm Linux.
>
>> > What's a windows winmain function? I've never seen one.
>
>> Standard entry point function for a windows process.
>
> It's certainly not standard, and I've never seen it used.
>
> [...]
>> I can't think of any programs that requires no user input
>
> User input is often, if not always, from a file.
>
>> and are neither
>> sub processes or a service that has some OS specific entry point
>> function.
>
> A lot of Windows "applications" are plugins (e.g. to Excel). In
> which case, there isn't really any entry point; they're DLL's,
> which require some sort of registration (not just system
> dependent, but application dependent) with the hosting
> application.
>
> Interestingly enough, you can port such programs to another
> system, provided you can find an application which can host it.
>
Windows DLL's still have entry point functions namely DLLMain.
They may be similar across OS's, but the loading/registration process and
function signatures all create a different program structure that cannot be
ported.
Here is a *very* simple winodws DLL program (at bottom of page). Please tell
me how it is possible to make this code portable.
http://msdn.microsoft.com/en-us/library/ms682583.aspx
Since it's necessarry to include windows.h I'd say this is a good indication
it's not going to be portable.
>> Only thing I can think of is some kind of console application that takes
>> command line arguments, but I don't think I've seen anything like that
>> since
>> win95.
>
>> Maybe it is an exageration so say "alot" of programs do not interact with
>> the OS?
>
> They all ultimately interact with the OS. But not in the layers
> you write: you call into a library (the C++ standard library,
> Boost, whatever), and the library interacts with the OS. If
> you're writing a GUI , then you need some sort of GUI library.
> But as I've said, hand written GUI's are rather out of date
> today---the current trend is to simply output HTML, and let
> a browser be your GUI. (I'm not sure that this is a good trend,
> but it does seem to be prevalent.)
>
The C++ iostream libs are simply convenience libs. In reality you aren't
going to put text to the screen using cout, It's going to be in a message
box or part of a window or something. Its a good idea to have language
extensions that provide convenience utilities like this but the problem is
that C++ is trying to incorporate all this into being part of the language
so it can be defined by the C++ standard. Back in the days of Borland
turboC++ when we all used getch() and stuff was fun to see the arguments
with people saying "what is getch()?, thats not C++". C++ seems so confused
at the moment it's trying to expand in all directions with no clear
direction at all.
If C++ wants a share of the app programming out there its not going to
happen unless the wide variety of implementations are embraced.
By this I mean C++ needs to acknowledge imp-specific stuff and embrace it
perhaps as a language extension or utility library. But the general attitude
in the C++ community seems to be that all this stuff is not covered by the
standards therefore irrellevant and nothing to do with C++, this is not good
for C++.
You need to go OT and imp-specific to deal with networking or telephony or
video cards or GPS devices or whatever specific programming task you are
taking on.