where can I find the project to build DirectShow BaseClasses? - c++

I am working on a software product that goes waaaay back. Part of our source code is a project that builds baseclasses. This is supposedly a project that ships with the Windows SDK and is used for developing apps that reference DirectShow.
Unfortunately the version we have checked in to our repository is out of date and issues many warnings when we build (all related to warning C4996: 'GetVersionExW': was declared deprecated).
Personally, I cannot find any information about how to find the newest (or indeed any) version of this little nugget of Windows goodness. As recently as a few days ago Microsoft Learn published a tutorial about this very topic (https://learn.microsoft.com/en-us/windows/win32/directshow/directshow-base-classes). But, it is essentially useless.
For example, if I click here: https://learn.microsoft.com/en-us/windows/win32/directshow/using-the-directshow-base-classes it tells me:
The base class library is provided as a SDK sample in the Microsoft
Windows Software Development Kit (SDK)
(https://go.microsoft.com/fwlink/p/?linkid=62332). The exact location
depends on the version of the SDK that you have installed, but the
relative path is:
(SDK samples root)\DirectShow\BaseClasses
I have Visual Studio 2022 installed and there is no such path in its directory tree, nor in C:\Program Files (x86)\Windows Kits. However, if I click on the link quoted, it sends me to a page that basically tells me that all I need to do to get the Windows SDK is download Visual Studio. Hmmmm....
Does anyone know how to get a contemporary version of the DirectShow base classes? Microsoft is not being very helpful on this point.

This is a classic Microsoft: Moving things around but failing to update references.
If you navigate to DirectShow sample apps, you'll find the link to the new GitHub home under Windows-classic-samples/Samples/Win7Samples/multimedia/directshow/, including the baseclasses directory.
Since you are explicitly asking for a "contemporary" version of the DirectShow base classes, that's what the GitHub repository contains. They haven't been (to my knowledge) updated since. DirectShow is in maintenance mode, and Microsoft encourage clients to use more recent technologies instead (such as Microsoft Media Foundation or the Windows Runtime types under the Windows.Media.Capture namespace).

For this reason I copied the directshow baseclasses and included them in the project, when I implemented GraphStudioNext. I didn't touch the project in a while but maybe this helps: https://github.com/cplussharp/graph-studio-next/tree/master/baseclasses
PS: I just saw, Roman has a more updated version of the base classes: https://alax.info/blog/2157

Related

DirectX SDK folder missing folders

My application requires Microsoft DirectX June (2010)/lib/x86 however the only things that appears when opening the folder are DirectX Utility folders.
My theory is that the download must have been updated or something because when I downloaded Detours again the files were different.
Anyone know how to get the lib file?
The legacy DirectX SDK is available from download from the Microsoft Downloads site. The self-extracting EXE itself is now SHA-256 signed, but the content is unchanged from the June 2010 release.
http://go.microsoft.com/fwlink/?LinkId=226640
The legacy DirectSetup REDIST image is available here:
http://go.microsoft.com/fwlink/p/?LinkId=159853
http://go.microsoft.com/fwlink/?LinkID=194352
The self-extracting EXE, DSETUP EXEs/DLLs, and CABS are now SHA-256 signed, but the content is unchanged from the April 2011 refresh.
Keep in mind there are numerous known issues with these old bits. In particular, your original report sounds like you may have hit this issue:
https://walbourn.github.io/known-issue-directx-sdk-june-2010-setup-and-the-s1023-error/
https://learn.microsoft.com/en-US/troubleshoot/windows/win32/s1023-error-when-you-install-directx-sdk
Finally, if you are trying to use the legacy DirectX SDK with VS 2012 or later, the integration instructions are different. See https://learn.microsoft.com/en-us/windows/win32/directx-sdk--august-2009
Note that you really shouldn't need to use the legacy DirectX SDK at all.
The Windows SDK already includes the include headers and link libraries for d3d9.lib, d3d10.lib, d3d11.lib, dxgi.lib, dxguid.lib, etc. See https://walbourn.github.io/directx-sdks-of-a-certain-age/
If you need d3dx9, d3dx10, or d3dx11, you should use this NuGet instead which provides the headers, link libraries, and a simple side-by-side REDIST for those DLLs. They are also SHA-256 signed. See https://walbourn.github.io/legacy-d3dx-on-nuget/
If you need XAudio2 for Windows 7, then use this NuGet instead. See https://aka.ms/xaudio2redist
If you need dxerr.lib, build it yourself. See https://walbourn.github.io/wheres-dxerr-lib/
If you use the legacy Managed DirectX 1.1 assemblies, use SharpDX or SlimDX instead. https://walbourn.github.io/directx-and-net/
The only scenarios where you still have to use the legacy DirectX SDK are (a) to target Windows XP or (b) to use XACT.

Has Windows an integrated built-in C/C++ compiler package?

I would like to be able to compile C and C++ code under the Windows environment without using an IDE, just by using the Windows Command prompt (cmd.exe).
I come from Linux, where you are be able to install the gcc package with just a command in the terminal:
$ sudo apt install gcc
I wonder if there is a C/C++ compiler collection in a package inside the Windows install folders, just like the ones in Linux, I just need to install.
What also gives me a reason to ask this question is:
Since the kernel of Windows and the Windows API are written in C, and many of the high-level applications of the actual Windows 10 release are written in C++, it would be reasonable to also directly provide a suitable compiler suite. This is my thought modell, does not need to match reality.
Thanks for your help.
Since the kernel of Windows and the Windows API are written in C
Microsoft doesn't ship a compiler, or the required Windows SDK headers/libs (also includes a bunch of other useful development tools) for Windows in the installation.
Microsoft Visual C++ (part of Visual Studio) would be the equivalent "built in" choice although I am not sure if Microsoft ever specify exactly which version they use for a given Windows build and it is common to have lots of software built with different compilers/versions (including the various non-Microsoft ones).
As well as the full Visual Studio package with the IDE and other tools. Microsoft provide some components separately, such as the Build Tools for Visual Studio 2019.
I am sure this is for many reasons like most users not being interested in compiling their own software, and Microsoft still sells Visual Studio separately to larger organisations (historically to most serious users, but "Community" edition is now pretty nonrestrictive for individuals and small business).
Strangely enough it doesn't come with a C compiler, we need to install one, Mingw-w64 is allways my choice, you will need to add the path in environment variables (step 12), if you want to use it anywhere. You can then use the gcc command where it's more convenient like in Linux, don't forget to open a new cmd after the changes for them to take effect.
Unfortunately, Windows doesn't have the command line tools for installing/removing stuff and the great repository infrastructure we know and love from Linux.
You will need two things:
The command-line build tools. These can be found on the Visual Studio Downloads page under Tools for Visual Studio -> Build Tools for Visual Studio. This will include the compiler (cl.exe) and linker (link.exe) for the MSVC build toolchain.
The Windows SDK. The latest version of the SDK can currently be found here. This page has a tendency to move around, but googling for Windows SDK usually gives you the right page immediately. The SDK contains all the headers and libraries required to build Windows applications and make use of the Windows native API. The Windows SDK contains a lot of stuff which you may or may not need. You will almost certainly want to install the Windows SDK for Desktop C++ x86 Apps and Windows SDK for Desktop C++ amd64 Apps components. Most of the other stuff should be optional, but some of it is nonetheless highly useful.
You may want to download additional packages such as the Windows Debugger (which is an entirely different application than the Visual Studio debugger) or the Driver SDK, depending on what kind of things you want to develop.
Note that even if you don't intend to use the IDE in the end, installing the full Community Edition of Visual Studio is a far more convenient way to get a working build environment, so unless you have a really good reason not to, just go with the full package and choose to never open the IDE.
The built in compilers available on Windows 10 are for VisualBasic, C#, JScript.
To improve speed & performance of apps, "ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly".
For low level programmers, ilasm.exe (IL Assembler) ships with Windows, which also facilitates "tool and compiler" development; so you could even create your own language or build a better compiler for a current one, or "debug your code at low level and understand how .NET deals with your high level code", or "write your own compiler for a new .NET language."
For web programmers, AspNetCompiler precompiles server-side ASP.NET web-applications, therefore helps application performance because end users do not encounter a delay on the first request to the application.
All Compilers & assemblers come as builtin with Windows without IDE and can be run from "the Windows Command prompt (cmd.exe)", so no extra downloads necessary; located in folder: C:\Windows\Microsoft.NET\Framework\vx.x.xxxxx\ .
Note: C# is based on JScript.
Compilers:
vbc.exe
csc.exe
jsc.exe
ilasm.exe
ngen.exe
aspnet_compiler.exe
Addendum:
If you still are looking for a C compiler to handle some C source codes you already have spent your life on, then (without downloading) you can make/write a C compiler, in a high level language, then optimize it with a low level language.
This guide will "introduce you to the high-level architecture, theory, and .NET Framework APIs that are required to build your own .NET compiler" in C#.
You can to use gcc for windows. For e.g. mingw, tdm-gcc, mingw-68, Cygwin etc. Each of them allows you to work on c/c++. But if you are not sure about the installation process, and don't want to do all the work by yourself, the easiest solution is to download something like dev-c++ or code-blocks.
cygwin: https://cygwin.com/
mingw-64: http://mingw-w64.org/doku.php
Downloadable file can be found here (for mingw, dev-c++): https://sourceforge.net/
You can also install Microsoft compiler. I usually do it by installing the whole visual studio.

How to get installed version of Microsoft Visual C++ Redistributable(x64) in mfc application

I working on mfc application in which I need to check currently installed version Microsoft Visual C++ Redistributable.
Is there any way?
Each VS Version has its own redistributable files and they are named with a version number in the name.
So there is no "current" version. There may be several installations for different VS-Versions.
Usually the files are installed in the Windows\System32 directory for 64bit. So lookup the file you need and search for (i.e. MFC140u.dll) and you can determine it's version.
Also some programs may have a local copy of the runtime DLLs in their application directory...
I’ve written an application that inspects the customer installation. It works somewhat like the Microsoft Troubleshooters in that it identifies certain information about the user installation so that our tech support people can identify a potential problem with the customer installation. One of the things it reports on is the VC redistributables that are installed.
I accomplish this by interrogating the following LOCAL MACHINE registry key:
SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall
The code iterates through the sub-keys looking for a match on the “DisplayName” attribute of each sub-key. I look for “Microsoft”, “Visual”, “C++”, and “Redistributable”. If all strings are found, I collect the “DisplayVersion” attribute and report it to a dialog.
While this scheme will not indicate the "current" version, it should provide access to all versions that are installed.

VS2013 C++: Ignore Platform Include Folder

I have a problem when moving to our company's build system over which I have limited control. They have installed DirectX SDK plus Windows 8.1 SDK... My applications is using 8.1 specific features that conflict with DirectX SDK (it's deprecated for a reason). So basically, they have the DirectX SDK hardwired into include lookup and thus headers will resolve to it instead of Windows SDK.
Is there a way to exclude specific folders from "#include" lookup no matter if they were specified? Or is there a way to remove the DirectX SDK from the built-in lookup by some MSBuild command line argument etc?
Hypothetical Solution:
IgnoreIncludeDirectories="C:/program files/directx SDK/include"
:)
Thanks!
Actually it was easy.
set DXSDK_DIR=
%run your build script%
I am not sure if that is a general solution, but it worked and was suggested by one of our build engineers :). Maybe it will help someone else too.

Can I compile using VS2008's C++ compiler using VS2010 and only the Server 2008 Platform SDK?

I'd rather not install the entire VS 2008 installation given that I'm not going to be using anything other than the compiler. Will VS 2010's multitargeting work correctly using only the Platform SDK instead of the full VS2008 install?
The custom setup options are not nearly fine-grained enough to allow you to leave the big chunks like the IDE out. It isn't just the SDK that's used, at least the VC subdirectory needs to be there. And bits of Common7, also the folder that contains the IDE. Rename the folders, delete them later if it works out.
You can directly call the .net 3.5 MSBuild from command line by digging it out of the frameworks folder within windows. I am not certain if you could repoint Visual Studio at a different copy though. More importantly, unless you have found a bug, the copy of MSBuild included in the .Net 4 framework should properly build a project targeting the 3.5 framework. So you might be jumping through some unnecessary hoops in the first place.