3 ms·
The C++ variants are where I really lose track and get confused. Win32 I understand. COM I understand. C++/WinRT, C++/CX, wtf is that? Is it a different languag
by native_samples 5y ago
The C++ variants are where I really lose track and get confused. Win32 I understand. COM I understand. C++/WinRT, C++/CX, wtf is that? Is it a different language like Objective-C++? I recall .NET had some C++ dialect, is it a derivative of that? At some point they had custom syntax for .NET pointers, some sort of hat operator. Can you mix C++/WinRT with normal portable C++? Can you use GCC or just MSVC?
Honestly I don't understand why anyone would write a Windows-specific app these days. Windows seems to have actually lost interest in high level languages over time. Seems like they have renewed their love affair with C++ and that's the "future" now.
- WorldMaker 5y agoC++/CX was the different language kind of like Objective-C++ with custom operators for WinRT COM controls, that in turn was similar to (but also very different from) C++/CLI which was an older language for .NET interop. The current approach C++/WinRT despite retaining the weird IBM-esque use of a slash, is mostly "just" an IDL precompiler and bundle of macros intended for use with "modern" C++ (I believe it needs C++17 support or higher). «Can you mix C++/WinRT with normal portable C++? Can you use GCC or just MSVC?» That is one of the supposed advantages of/reasons for C++/WinRT over C++/CX. I've heard offhand mentions on blogs of using clang with C++/WinRT. I'm not a C++ developer and have no idea how well that works in practice. «Windows seems to have actually lost interest in high level languages over time. Seems like they have renewed their love affair with C++ and that's the "future" now.» I think that is related with pjmlp's complaint above with C++/WinRT (versus the older C++/CX) is that it does feel a lot like going back to the bad old days of MFC and (especially) ATL. The "WRL" templates library of C++/WinRT from my understanding is intentionally designed a lot like ATL. I can appreciate that Windows developers with a lot of C++ Win32 experience and massive brownfields of C++ Win32 apps like it much more for exactly those sorts of reasons: it looks/acts/smells a lot more like 90s COM, there's less relearning, there's far more interoperability with existing code structures/patterns/compiler choices (beyond the "need to upgrade to at least C++17"). I wouldn't necessarily phrase that as Windows seeming to have "lost" interest in high level languages. On the one hand I don't think "Windows" has ever really cared about high level languages in one way or another. That's as much "the Fall of the House of Longhorn" story as any other: the infighting between core Windows which has always been C++ and seemingly likely always will and the Developer Division trying to prioritize Developer Productivity and higher languages especially via .NET doing as much damage to Longhorn's goals as any other reason for slips/delays/production issues. In all those fights .NET still exists and higher level languages still have a seat at the table. (Though JS got knocked out late in Windows 8 from having a direct WinRT story and subsequently/relatedly Electron is winning. Though React Native is sort of making a stand. Sort of.) Of course even .NET at this point seems to think that Windows-specific apps are on the way out and there's seemingly a lot more focus on MAUI and cross-platform apps than WinUI apps.
- pjmlp 5y agoIt goes beyond that, I wouldn't complain that much if they created a proper developer experience for C++/WinRT. However it basically goes like this, you edit the IDL files with the same editing capabilities as if you were in Notepad, because to this day they still haven't bothered to add syntax highlighting or code completion to IDL files editing experience. Then to top that, your C++ files get generated, and then it is up to you to track down the changes between the newly generated code and the last time you edited the IDL files. So you manually merge that generated code into the C++ files of your project. Naturally a wonderful experience to those of us on .NET that occasionally need to deal with C++. You are right regarding high level languages on Windows, the political might of WinDev means that something like iOS with Swift, or Android/Kotlin, where C and C++ play a minor role, will never happen. Every time .NET gets a bit more of focus, they spoil the fun. Interesting fact, the new context menu for Windows 11 requires a COM implementation to add entries for your application.
- native_samples 5y agoWhich new context menu is that?
- WorldMaker 5y agoWindows 11 File Explorer now defaults to a new context menu when right clicking [1] with the modern "command bar" approach (first seen in OneNote for a number of years now, with the most common options collapsed to icons on a "toolbar" at the top/bottom closest to the mouse). It shouldn't be a surprise that extensions to it still use COM (extensions to File Explorer have always used COM). Especially because these new COM interfaces for Shell Extension have been added retroactively all the way back to Windows 7. (The new ones differ from the old ones in providing more data to Windows for grouping/merging the extensions into submenus than previously supported.) [1] Random image search example: https://cdn.mos.cms.futurecdn.net/LNbaeoqJymdkQ3uSK7MeKY-970-80.png https://cdn.mos.cms.futurecdn.net/LNbaeoqJymdkQ3uSK7MeKY-970... (ETA: Useful blog post: https://blogs.windows.com/windowsdeveloper/2021/07/19/extending-the-context-menu-and-share-dialog-in-windows-11/ https://blogs.windows.com/windowsdeveloper/2021/07/19/extend...)