Where can I find the Windows header files - winapi

Sometimes in my research into Microsoft functions, I'll see the name of a constant and perhaps a reference to a header file - like winuser.h. I don't often need to refer to them but when I do, I wind up spending some time Googling to find out where those files are. With this question, I can hopefully come to the answer right away. The question, as the title says, is: Assuming I've installed Visual Studio or the SDK, where in the file directory structure on a windows machine can I find the basic windows header files, like windows.h and winuser.h?

First you need to install Visual Studio or the Windows SDK. I'd give URLs here but they change with every new version of windows. The header files could be in
C:\Program Files\Microsoft SDKs\Windows\vX.X\Include
C:\Program Files (x86)\Microsoft SDKs\Windows\vX.X\Include
(where vX.X reflects the version number)
Update - May 2020
I'm on a new machine and installed VS2019 and the WindowsSDK and here are the new locations:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Professional\SDK\ScopeCppSDK\vc15\SDK\include\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um
I do not see any includes in the 'Program Files' folders.

Related

Visual Studio 2022: Cannot open include file: 'ctype.h'

I've got the infamous error message in C++ build: "Cannot open include file: 'ctype.h'". I know a similar question was already asked multiple times, but my case seems different because I am using the latest Visual Studio 2022 and seems to behave differently.
I have a bunch of existing C++ projects, they use plain 32-bit Windows API with DirectX 6, and I used VC++ build tools 2015 and Windows SDK 8.1 to compile it without any issues in previous versions of Visual Studio. Everything was fine in Visual Studio 2019, no special setup was needed, until I uninstalled it and installed Visual Studio 2022.
Now I can open my solutions, it nicely shows they are using C++ build tools 2015, which I installed together with VS2022, and the solutions also shows correctly that they use Windows 8.1 SDK. But Windows 8.1 SDK is not present in VS2022 installation, I installed it separately. I also tried to "repair" VS2022 installation, but that only deleted all my UI preferences, but not fixed anything in build. Also, I tried to reinstall Windows 8.1 SDK, but it said it is already OK.
When looking to Visual Studio, I can't see any place where I can set default include and lib directories, I can only list what is being used right now. VS2022 shows this list:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
C:\Program Files\Windows Kits\10\Include\10.0.10240.0\ucrt
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt
The actual error message I receive is this:
c:\program files (x86)\windows kits\8.1\include\um\winnt.h(31): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
So it says that winnt.h from windows kits 8.1 cannot find ctype.h. And yes, there is no ctype.h in that folder or anywhere around, I can see it only in C:\Program Files\Microsoft Visual Studio\2022\Professional\SDK\ScopeCppSDK\vc15\SDK\include\ucrt
which I think is the folder with VC++ 2015 build tools. So this seems correct, but I am wondering why this folder is not a part of default include directories when VC++ 2015 build tools are set in project settings. Because it seems that VS2022 is correctly picking my Windows 8.1 SDK, but not picking correctly the older C++ compiler.
When I try to add the folder where ctype.h resides to include folders, I receive another type of errors saying that other files are incompatible with these include files. Of course, this system of directories needs to be in sync. So please what is the correct way of using this?
Also, I tried to switch the VC++ build tools to 2022 version. Unfortunately, that also does not fix the issue. And Windows 10 SDK is not installed, the software wants to stay compatible with older Windows, so I don't need it.
I found a bug report which is related: https://developercommunity.visualstudio.com/t/windows-81-sdk-1/151682
Although Microsoft staff declined to accept it as a bug, it is happening for me as well. When I install only Windows 8.1 SDK, no project can be compiled with it. I even tried to create a new Windows API project in VS2022, the project was created, but failed to compile with the same error.
So I tried to install Windows 10 SDK (from VS2022 installed, but that is probably not important) and this added some missing files which now help to compile Windows 8.1 SDK projects. Problem seems to be solved, my old C++ code can now be compiled with Windows 8.1 SDK and both C++ build tools 2015 and 2022.

Visual Studio 2019 Windows SDK executable path macro has multiple paths

I'm trying to use $(WindowsSDK_ExecutablePath_x64) in my C++ project post build events to copy some files. However, it contains two paths instead of one. I can't seem to be able to find how to use the first path (not the .Net one):
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64
I'd like to do something like copy /Y $(WindowsSDK_ExecutablePath_x64)\bin\file.ext destination in my post build events. How can I do this? I'm using VS 2019 and have the latest Windows SDK installed.
I ended up using the following:
$(WindowsSdkDir)bin\$(TargetPlatformVersion)\x64\dxil.dll

After installing Windows 10 SDK, why I can't find makeappx.exe

After installing Windows 10 SDK, why I can't find makeappx.exe
In the directory of C:\Program Files (x86) \Windows Kits\10\bin\x64\, there is only one folder called XamlDiagnostics and file GenXBF.dll.
In the directory of C:\Program Files (x86) \Windows Kits\10\bin\10.0.16299.0\x64, there is only one file genxbf.dll.
I have repeatedly installed SDK several times, and again got
The features installed on this computer are up-to-date
What's the matter?
In my case, I found it was in a different location to the one specified in the Microsoft documentation.
I was following the instructions in the documentation for creating an appx from a Microsoft Edge extension, found here.
In the documentation, it says makeappx.exe can be found in the following location:
C:\Program Files (x86)\Windows Kits\10\bin\x64
This was incorrect - I then found this documentation which gave the correct path:
C:\Program Files (x86)\Windows Kits\10\bin\[build
number]\x64\makeappx.exe
For some reason the file did not turn up in a search for the filename using file explorer search, even though it was there.

VS2017: “Cannot find the resource compiler DLL. Please make sure the path is correct.”

I am using Visual Studio 2017. When I try to build a solution, I encounter this error:
Cannot find the resource compiler DLL. Please make sure the path is correct.
I checked my system, and found that the v7.0, v8.0, v8.0A, v8.1A, and v10.0A SDKs are installed on my machine. I checked my project properties, and the default SDK is v8.0
Me too, i have only the "windows 10 sdk version 10.0.15063.0" installed, and solved after:
Copy rddll.dll from:
c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rcdll.dll
to:
c:\Program Files (x86)\Windows Kits\10\bin\x86\
ref link: https://developercommunity.visualstudio.com/content/problem/43024/ide-cannot-find-the-resource-compiler-dll-rcdlldll.html
Just a temporary workaround, but it works.
Edit:
Run Visual Studio Installer from start menu, and click Update, after a while it's done, all thing worked.
it's doesn't need to copy file any more.
you could copy from
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\rcdll.dll
to
C:\Program Files (x86)\Windows Kits\10\bin\x64\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\x64\rcdll.dll
and copy from
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rcdll.dll
to
C:\Program Files (x86)\Windows Kits\10\bin\x86\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\x86\rcdll.dll
The reason is that Visual Studio cannot find the requested files.
You have to (re)install or repair the requested version through Visual Studio Installer.
You can reach that through Visual Studio menu bar -> Tools -> Get Tools and Features -> Individual Components -> find and tick the respective {version} tools to install and then click "Modify".
It should work after that. Best of luck.
you can just simply change the compiler from resource compiler to C / C++ Compiler and you can do that by simply making a resource and you will face that error, after that right click the empty resource that have been generated and on the folder of resources right click the [nameofyourproject].rc and then choose properties and from item type change it to C / C++ Compiler and then delete that resource and create a new one and you will find it works fine with you.

The specified module could not be found. Exception from HRESULT: 0x8007007E

Im getting the following message on a messagebox shown from visual studio when I try to do any modifications on an sql server database from visual studio's server explorer on my 64bit machine at home. The database was created and filled on a 32bit machine. Any thoughts?
EDIT:
Fixed it by replacing the corrupted dll located here: "C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools\dsref80.dll"
Just as a bit of a heads-up to anyone else coming here from Google...
This happened (for me, and most people here) as a result of installing VS11 Beta, and then un-installing VS11 Beta without installing VS2012. Replacing the DLLs mentioned above, and optionally the DLLs located in the path below, seemed to fix the problems.
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\*.dll
My problem was largely the same.
I was unable to create database diagram. Visual Studio 2010 would just silently fail, but SQL Server Management Studio gave the error message "The specified module could not be found. (MS Visual Database Tools)". This happened after having tried (and removed) the new Visual Studio beta.
Your solution brought me in the right direction. But instead of the dsref80.dll file, my problem was the whole folder C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8. After removing that folder and inserting a copy from a virtual machine (repairing VS would probably have worked also), everything is working again!
I ran into this problem trying to use the SQL Server 2008 R2 Business Intelligence Development Studio (BIDS), which uses Visual Studio 2008 Shell (integrated mode). Every time I tried to create a new Integration Services Project, I was getting an error, "... The specified module could not be found. (Exception from HRESULT: 0x8007007E) (System.Windows.Forms) ...".
As other posters have noted, the files in MSDesigners8 seem to be corrupted. I didn't think to install SQL Server 2008 R2 BIDS in a virtual machine to get copies of the DLL's to put into that folder, but I found a solution which seems to work: installing the Visual Studio 2008 Shell (integrated mode) SP1.
Before that, I renamed the MSDesigners8 folder to MSDesigners8_old (and the .dll files were also renamed .dllold. I don't think that matters necessarily; I'm including it here only in case it does matter). I tried repairing as well as reinstalling BIDS, but it did not recreate the MSDesigners8 folder. Installing SP1 did.
After that, it may also take a reinstall of BIDS, but it may not. Good luck!
I was experiencing this same error on Visual Studio Professional 2012 Version 11.0.61030.00 Update 4 and solved it by going to C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools and renaming the dsref80.dll file to desref80.old.dll and then running the "Repair" action on my Visual Studio installation. When repairing, the Visual Studio repair dialog told me it couldn't locate the package source since I didn't have the installation disc available, so I just selected the "Download" option and it worked. This installs the appropriate version of the desref80.dll file.
f you think you may have this problem, just replace your files with a copy from another SQL Server 2008R2/Visual Studio 2008 Installation, that is working, as follows:
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\msddslm.dll
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\msdds.dll
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\msddsf.dll
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\msddslmp.dll
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\msddsp.dll

Resources