Using Windows media foundation - c++

Ok so my new gig is high performance video (think Google streetview but movies) - the hard work is all embedded capture and image processing but:
I was looking at the new MS video offerings to display content = Windows Media Foundation.
Is anyone actually using this ?
There are no books on the topic.
The only documentation is a developer
team blog with a single entry 9 months old.
I thought we had got past having to learn an MS api by spying on the com control messages!
Is it just another wrapper around the same old activeX control?

I read the Media Foundation Programming Guide, and it's as complete as everything else is w/ MS, in that you have all the information you need, no clue on how to find it, and no idea what's important when.
I'm trying to use MMF, but I'm currently not getting anywhere, and am thinking that going back to DirectShow might be the better approach as there is more example code with explanations.
No, it does not appear to be just another wrapper around the same ActiveX controls.

Did you read Media Foundation Programming Guide? It looks pretty complete.

To get started with Media Foundation you might want to read this. Media Foundation was first introduced in Windows Vista. Thus, you must have Vista or later versions of Windows to develop Media Foundation apps. If you are targeting Windows XP users then, D-Show might be a better option.

Related

UWP front end with a COM backend

I'm a student working on a diy scientific computing engine. I would really like to develop using the UWP XAML UI. Nothing else. I just want to consume the front end from a standard COM DLL. I need access to things like MySQL/Cluster and dynamic loading. I am quite proficient in COM. UWP and windows runtime component sandboxing is counter productive for me. VS2017 is awesome. XAML is awesome. This is not a store app. I just need to wrap basic event calls that wouldn't need to marshal anything more complicated than a string or a float. I can't seem to nail down an appropriate consice approach. Is there an approach that is supported by the relevant community?
With the recently announced XAML Islands at the //Build 2018 Conference, you will be able to create XAML UserControls and host them on your Win32/.NET framework applications (ie: Winforms or WPF). This technology is currently in preview and supports the XAML WebView control, allowing Win32/.NET apps to have a fully HTML5 rendering engine.
For more information take a look at:
https://blogs.windows.com/buildingapps/2018/05/07/modernizing-applications-for-our-multi-sense-multi-device-world/
https://learn.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-host-controls
To address your WPF longevity question, our focus is on improving the UWP platform, but we do realize many companies have application assets in Winforms and WPF, so our goal is to ensure developers can interop with our new technologies. You might want to investigate the .NETCore3 roadmap to learn more.
https://blogs.msdn.microsoft.com/dotnet/2018/05/07/net-core-3-and-support-for-windows-desktop-applications/
Hope this helps,
Adam Braden [MS]

Creating GUIs in Win32 C++

I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI.
I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However most answers seem outdated and I'm not sure if they fit my specific project. Also tutorials for Windows 8 'metro apps' are clogging my Google search results, which is NOT what I'm looking for.
I use Visual Studio. I've followed tutorials. I have basic knowledge of C and Java and extensive experience with PHP. I'm excited to learn C++, so I'm not looking for GUIs to create a GUI (like WinForms). I also don't care about managed code and portability for now, especially since I'm trying to avoid dependencies (i.e. users having to install .NET). As long as it runs smoothly on Vista and up, I'm happy.
The application
The software will teach basic physics to kids. I'd like to create a main area and a sidebar. The main area will feature a physics animation, say a bouncing ball, along with some Q&A. Users can zoom in to the animation to measure some stuff and answer the question. Users can track their progress in the sidebar. That's pretty much it.
What I've found so far
I'm getting a bit frustrated with MSDN. Most of their examples are given in four different languages (C#, C++, etc). I can't seem to get more than a bit of Hello World code from them.
I found a GDI API on MSDN and it seems like a good start for me. However I've read quite a few answers on SO saying creating layouts in pure C++ is really hard, that we're better of using frameworks like ATL and WTL. Since I'm also going to create (somewhat interactive) animations, I've wondered whether I should use gaming-targeted APIs like Direct2D.
Since all of this is new to me, and there are a lot of options, I don't know where to start for my particular application. Any tips would be greatly appreciated!
Using the raw Win32 API (no additional downloads or third-party helpers):
Here's a good primer (introduces dialog boxes, text boxes, buttons, etc): theForger's Win32 API Tutorial
And here's where you go from there (numeric up-downs, list boxes, combo boxes, tooltips, and more): Common Controls on MSDN. Most of these require you to #include <commctrl.h>.
I also found this to be a good resource that covered what the other two didn't: Win32 Developer - Window Assets
But the Win32 API doesn't seem like it does exactly what you want. A physics app for kids should have a more visual GUI than the API can provide. Good luck, though!
If you're ok with adding additional Frameworks, I'd suggest looking at Qt.
It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.
If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.
To get started, see my (old) tutorial "Lessons in Windows API Programming".
But you really need a good book, such as edition 5 or earlier of Charles Petzold's classic "Programming Windows".
The problem with latest edition is that it's for C# and .NET, with Charles grabbing the tail of the "new way" at just the wrong timeā€¦
Disclaimer: I haven't checked the details of edition numbers.
Using the Windows API is the simplest, but producing advanced GUIs can take a very long time. Microsoft Foundation Class is a way to make the Windows API more user friendly and OOP. Does anyone have any experience with MFC?
Why not use some 2D C++ game engine, like HGE: http://hge.relishgames.com/overview.html.

WebCam Preview and Capture to File (Windows)

What are the available options for creating applications that allow preview of a webcam and exporting the current webcam image to file?
EDIT: I've since found that MS Media Foundation offers similar features to DirectShow that work from Vista upwards. However, while apparently possible, the documentation, samples, and forums don't suggest an easy way to perform the above. On the other hand, with DirectShow you can fairly easily merge two of the sample apps to achieve it.
EDIT: Researching available camera APIs I've also found the MS MediaCapture API looks useful but this seems to be only available on windows 8 (and may be limited to managed C++/.net/javascript).
EDIT: DirectShow is supported on the Windows 8 standard desktop (For Metro style applications the video platform is Media Foundation).
Consider using directshow. You may have a look here
You basically found the answers yourself. DirectShow and Media Foundation are the APIs. Neither of the two cover all Microsoft environments: Metro supports a subset of MF, and MF is not available in legacy OSes. DirectShow is presumably easier, more flexible, with more sample code around.

Can I make a game using c++ that will run on the web?

There is some libraries that lets you run C++. So, it is it possible to run a game that uses directx full mode screen?
Google is developing a tool to allow this kind of thing via Chrome. It is called Chrome Native Client, or NACL for short. http://blog.chromium.org/2010/05/sneak-peek-at-native-client-sdk.html
In general, no. Most online games are written with Javascript, Flash, the newly hatchedd HTML5 and similar technologies. Perhaps C++ integration is possible on some level, but you definitely cannot write a browser-hosted game purely and entirely in C++.
it could also be done with an ActiveX control. ActiveX only works in IE. there are Netscape plugins that work in other browsers. so make a solution that contains both. you need a book on ActiveX/COM/OLE. Better yet, take a class if you can find one, you will learn far more, because COM is not an easy subject to just read about and then really do - versioning is a big problem.
nope, not supported in firefox. but read this: http://www.google.com/chrome/intl/en/webmasters-faq.html#activex
some people may have activex controls disabled. if this is the case, your game will not run. you will have to tell the user that they will need to change their security settings in IE. you can get feedback from the object element in javascript as to whether or not the activex loaded. there is code out there for that.
http://msdn.microsoft.com/en-us/library/7sw4ddf8%28v=vs.85%29.aspx
examples are all over the internet.

Web Developer curious about developing for the Android

Hey there,
So I've been heavily focused on design/development using web technology for the last few years (php/mysql, javascript, etc), and I'm a bit hesitant to start learning C++.. At the same time, I see it as a potentially enjoyable learning experience.
To keep things brief, right now I'm developing an online app that plots out certain locations on a map, and you can sort through these locations and do a bunch of other nifty things..sorry to be vague. The point is: I don't see any real advantages of making this an actual "app" when the entire functionality of the app itself can do quite fine through the modern mobile browser..
Not to mention that, by living in a browser, it's much less proprietary
So, my question is: Is there any way to make a simple app that's basically porting the user to my site? I guess it'd be convenient that as an app, the user has a nice little icon to click on when they do need to access it..
Android development relies heavily on Java. So you are all ready on the right track.
However if you just want to make an app that brings people to your website, running javascript I am guessing, this is easy to do with android.
Android supports the webkit browser and has a view group called WebView. Your app can be nothing more than a shortcut on a desktop that opens a webview directly pointed to your website. It could add other options to point to other parts of your website like bookmarks.
WebView webview = new WebView(this);
setContentView(webview);
weview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("yoursiteurlgoeshere);
A lot of apps on the market are actually based around a WebView. There are other classes that allow you more control over the view, like whether links are opened in the webview or in a new browser, or whether the user is allowed to use the resize options, etc.
Welcome to Android.
There is a massive article on exactly this type of idea. It discusses a number of different things and is well worth the read if you are indeed interested in making a cross-phone web-app. It talks about an html5 facility in the works for creating such a thing as you describe, but it isn't quite universal yet.
Here is an article on making an iphone app in html5.
You can also use phonegap to port your design to andorid.
also, check out a jquery plugin calld jqtouch if you are interseted in developing touch capable applications quickly.
If you are worried about speed and the issue of internet connectivity, you can use html5 local storage features which are available on both android and itouch. Ibm has a great series on these issues and part 2 covers local storage.
No. The problem with web technology on a mobile device is the delay. You are far away from the server, so a lot of the things you can easily do with a normal client creates a very bad user experience on a mobile device. The roundtrip time is simply too large. You have to move much more functionality to the client. This client is also less powerfull, and tends to have limits on caching large elements
How is this related to C++?
There is also a C++ API which is only recently available. Google calls it the NDK (Native Development Kit). Information about it can be found here: http://developer.android.com/sdk/ndk/index.html
I personally haven't developed using the NDK. The only real reason someone would really need to would be to write a high-performance application that can't stand the overhead of the Java JVM--which is getting more and more rare these days IMO.
As far as creating a simple app with a web container in it, see Phobos' response. That is exactly how I'd do it personally.