Live data from Hacker News

Microsoft introduces Universal Windows apps

wmpoweruser.com

141–150 of 187 posts

Re: Microsoft introduces Universal Windows apps

#141

Earlier quoted context omitted.

int main(){ puts("Hello World"); } This doesn't work in Windows. The standard entry point to Windows is "int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );" C never really "ran" on Windows. C is built on top of abstractions to even run on Windows. A SegFault in standard C is supposed to be passed to a signal handler (in Linux/ OSX). A SegFault in W…

I always thought that the whole WinMain() thing was an ugly mistake. The right way to do this would be to organise the libraries and startup code so that the simplest Windows GUI program was not 50 or 100 lines of boilerplate, but was instead something like; #include void main() { WinGuiInit(); WinGuiMessageLoopRun(); } Or similar. Extra functions and parameters as required to setup custom icons, window classes, mess…

What always jumped out at me when I looked at Windows code was all the capitalized type macros/typedefs.

Re: Microsoft introduces Universal Windows apps

#142
post #102

Looking at twitter it seems like XAML is getting a ton of love from MS. Go back 2 years and many were predicting that HTML was going to win the war on Windows; what gives/what's changed? Disclosure: written more XAML than I'd care too.

What happened was that most third-party developers refused to use WinJS, and stuck with XAML:

http://www.zdnet.com/windows-8-developers-are-shunning-winjs...

Re: Microsoft introduces Universal Windows apps

#143
post #105

Earlier quoted context omitted.

What about the internals? Is it still kind of a mess under the hood? I heard they rebuilt the TCP/IP stack so it's not user land 32 bit driver anymore. Any ideas if/when they'll modernize NTFS? Right now it's a race to the bottom to who has the worse FS, HFS+ or NTFS. WinFS or ZFS on OS X would be a godsend. What about the registry? Any idea if they'll make that easier to manage for regular people? Am I still fucked…

No it's rock solid underneath. The TCP stack hasn't been a 32-bit driver since XP. NTFS has been modernised already: http://en.wikipedia.org/wiki/ReFS The registry is fine - it's people pissing around in it that break it. Win32 - haven't touched it for years. Driver model: not my problem. Mavericks is a crime compared to windows 8.1. I use both, regularly. It's virtually impossible to use efficiently with a keyboard…

Not to take away from your other excellent points, but ReFS is not exactly a modernization of NTFS, since it additionally removes quite a few features.[1]

The lack of disk quotas, deduplication, and named streams (and more) mean that it's not exactly a general-purpose filesystem, at least as far as standard Windows Domain deployments are concerned.

I suspect they'll address all of these issues eventually, and look forward to it, but as it stands you unfortunately can't just format everything as ReFS instead of NTFS and expect that everything will work. Unlike with ZFS.

[1] http://en.wikipedia.org/wiki/ReFS

Re: Microsoft introduces Universal Windows apps

#144

Earlier quoted context omitted.

int main(){ puts("Hello World"); } This doesn't work in Windows. The standard entry point to Windows is "int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );" C never really "ran" on Windows. C is built on top of abstractions to even run on Windows. A SegFault in standard C is supposed to be passed to a signal handler (in Linux/ OSX). A SegFault in W…

I always thought that the whole WinMain() thing was an ugly mistake. The right way to do this would be to organise the libraries and startup code so that the simplest Windows GUI program was not 50 or 100 lines of boilerplate, but was instead something like; #include void main() { WinGuiInit(); WinGuiMessageLoopRun(); } Or similar. Extra functions and parameters as required to setup custom icons, window classes, mess…

It's done like that in C# (for WinForms, at least).

    namespace WindowsFormsApplication1
    {
        static class Program
        {
            /// 
            /// The main entry point for the application.
            /// 
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }

Re: Microsoft introduces Universal Windows apps

#145

Earlier quoted context omitted.

int main(){ puts("Hello World"); } This doesn't work in Windows. The standard entry point to Windows is "int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );" C never really "ran" on Windows. C is built on top of abstractions to even run on Windows. A SegFault in standard C is supposed to be passed to a signal handler (in Linux/ OSX). A SegFault in W…

I always thought that the whole WinMain() thing was an ugly mistake. The right way to do this would be to organise the libraries and startup code so that the simplest Windows GUI program was not 50 or 100 lines of boilerplate, but was instead something like; #include void main() { WinGuiInit(); WinGuiMessageLoopRun(); } Or similar. Extra functions and parameters as required to setup custom icons, window classes, mess…

At least they provide the mainCRTStartup thing [1] so you can use main() in GUI executables. Regarding boilerplate, Win32 was designed as a very low level API, with MFC and other high level libraries to make things easier.

[1] http://stackoverflow.com/questions/11785157/replacing-winmai...

Re: Microsoft introduces Universal Windows apps

#146

Earlier quoted context omitted.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

Asm output from a c program that prints hello world to the screen. You can figure out the other sections I'm sure. No win main or other similar concepts here and built using vs2012. Microsoft (R) COFF/PE Dumper Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file consoleapplication6.exe File Type: EXECUTABLE IMAGE _main: 00401000: 68 48 20 40 00 push offset ??_C@_0M@KIBDPGDE@He…

I've tried to do programs with /nostdlib before, how did you implement the startup and shutdown functions that are required?

Re: Microsoft introduces Universal Windows apps

#147
post #118

Earlier quoted context omitted.

Come to think of it, I don't think I've used any platform where main() is the real entry point to the executable. On Linux the real entry point is _start, all of the bare-metal embedded stuff I've touched does a whole bunch of hardware setup in crt0 before it calls main(), etc...

main() is the entry point function in newer OS X versions. Why ship crt0 in everything when you can put it in dyld?

crt0 would still get linked into static binaries in OSX, I presume.

Re: Microsoft introduces Universal Windows apps

#148

Earlier quoted context omitted.

AFAIK they do. WinRT apps can be written in many languages including C++. And this is pure native C++ and not "managed" C++.

Yes I'm aware of that, but can universal apps be written in native code? I don't see any mention of it in their announcement.

I am 100% sure they can be written in native code but don't have any reference to give you for now.

Re: Microsoft introduces Universal Windows apps

#149
post #147

Earlier quoted context omitted.

main() is the entry point function in newer OS X versions. Why ship crt0 in everything when you can put it in dyld?

crt0 would still get linked into static binaries in OSX, I presume.

What static binaries would those be?

https://developer.apple.com/library/mac/qa/qa1118/_index.htm...

Re: Microsoft introduces Universal Windows apps

#150

Earlier quoted context omitted.

int main(){ puts("Hello World"); } This doesn't work in Windows. The standard entry point to Windows is "int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );" C never really "ran" on Windows. C is built on top of abstractions to even run on Windows. A SegFault in standard C is supposed to be passed to a signal handler (in Linux/ OSX). A SegFault in W…

I always thought that the whole WinMain() thing was an ugly mistake. The right way to do this would be to organise the libraries and startup code so that the simplest Windows GUI program was not 50 or 100 lines of boilerplate, but was instead something like; #include void main() { WinGuiInit(); WinGuiMessageLoopRun(); } Or similar. Extra functions and parameters as required to setup custom icons, window classes, mess…

If by "boilerplate" you mean creating/registering a window class before creating a window, you don't need to do that if your application's UI largely looks like dialogboxes - DialogBoxParam will create a message loop automatically and all you need to give it is the layout template and the message calback WndProc.

(I've been working with Win32 for around a decade now, it's got its warts but really isn't that bad once you get used to it. You can do a lot of interesting things with it.)

Post reply on HN