by flohofwoe · 10y ago · 0 comments
I really wonder why Microsoft had to invent their own, incompatible C++ dialect when projects like emscripten can cross-compile perfectly standard C++ to Javascript, which is a much more exotic compile target than the .NET runtime.
If that's not good enough for you there is also Mondern C++ by Kenny Kerr which is a C++1x projection of the windows runtime.
Instead C++/CX targets the traditional COM platform which goes back decades and was kind of resurrected as the foundation of WinRT (and whatever it's called in Windows 10 -- UWP I guess? I have trouble following these rebrandings).
As far as I've understood, the point of C++/CX is somewhat similar to Objective-C. You can still write raw COM code in plain C or C++ (just like you can use the Obj-C runtime from plain C if you really want to)... But C++/CX is there to make it more palatable.
[0]https://en.wikipedia.org/wiki/Windows_Runtime#Programming_in...
I prefer developing native parts in C++ without CX. Compile classic C++ DLL. Then I use a combination of C-style [DllImport]-ed functions, and COM-style IUnknown-derived objects. This approach works fantastic for a whole bunch of Microsoft’s APIs like Direct3D and Media Foundation. I don’t see why not use the same approach in designing custom DLLs.
Or, at least, that must've been a sane opinion to hold back when managed c++ was first invented.