Adding version info to a Windows Phone 8.1 C++/CLI Class Library - dll

I have created a universal C++/CX windows runtime component library. Universal library projects in VS2013 build to a Windows 8.1 dll and a Windows Phone 8.1 dll.
For the Windows 8.1 dll I can add a "resource.rc" file, and then add VERSIONINFO to that.
But for the Windows Phone 8.1 dll I cannot add a "resource.rc" file because that requires winres.h, which is not present. I tried removing all of the references to winres.h from the Resource.rc code, but the resulting dll does not contain the version information.
How do I version a C++/CX WP 8.1 wrc library?

This worked for me. Add .rc file as usually. Then go to project "Configuration Properties > Resources > General".
To "Additional Include directories" add $(WindowsSDK80Path)\Include\um.
Basically, it should point to path like "C:\Program Files (x86)\Windows Kits\8.1\Include\um".

Related

Adding a new dll reference to Windows Phone 8.1 project replaces the existing dll

The default blank Windows Phone 8.1 template came with 2 default references ".NET for Windows Store apps" and "Windows Phone 8.1". Then I added a new dll "PresentationCore". After this, when I tried to add a reference to dll "System.Drawing",I found that the existing dll "PresentationCore" was replaced with this new dll.
However, the default 2 dlls remained the same. Does anyone have an idea what's going on here?

Some .dll files are missing in WIN8.1 OS?

I'm trying to register a dll file(32bit) in windows 8.1 os,
but somehow I check the dll from Dependency Walker and find out
Some .dll files are missing in WIN8.1 OS as follow:
1. API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
2. API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
3. API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
4. API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
5. EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
6. IESHIMS.DLL
I google it and the problem is about upgrade OS to WIN8.1,
but how can I make these .dll files back?
or is there any way to solve this problem?

Copy to AppX output directory with Visual Studio 2013 (WinRT app)?

I have a WinRT app built with VS2013 using C#. It uses SQLite so it needs the sqlite3.dll included in the project to be in the output directory. I included that DLL in my project and set it to always copy to the output directory. The problem is VS2013 copies it to the Debug directory, but not the AppX directory underneath Debug, which appears to be the WinRT output directory. Because of the the app fails because it can't find sqlite3.dll, which is up in the parent Debug directory instead of the AppX directory.
For now I'm just hand-copying the DLL into the AppX directory. What's the best way to fix this problem so that the DLL is copied to the correct directory?
In your project's Properties window choose Build Events tab. On Post-build window include similar string (please, mind to change the path to sqlite3.dll):
xcopy /Y $(ProjectDir)3DParties\sqlite3\$(PlatformName)\sqlite3.dll $(TargetDir)AppX\
Or even better option. This page https://www.sqlite.org/download.html contains section named "Precompiled Binaries for Windows Runtime" where you can download VSIX package. When you install this package into your system, you can simply reference sqlite3.dll for all target platforms (ARM, x86, x64) including all necessities automatically like this: Add Reference -> Windows 8.1 -> Extensions -> SQLite for Windows Runtime (Windows 8.1)
I can't be sure this is the "right" solution, but I set the file's property to Content/Copy-if-newer.
THEN what I've found is that if the AppX directory is already there, VS doesn't update it, just as you describe above, BUT if you delete the Appx directory then VS will create it from scratch and add the necessary files.
Not as good as having everything automated, but beats hand-copying.

Windows Phone class library localized resources not working

I have a Windows Phone class library with a resources (.resx) file. I have a reference to the class library from an actual Windows Phone Application project. Everything works well when I reference the library project in the solution, but when I add a reference to the actual assembly (.dll) file then localization stops working and the Windows Phone Application just uses the default locale when navigating to the pages declared in the library assembly. Does anyone know why?
Found the solution. When you reference a Windows Phone library assembly (the .dll file itself, not its project within the same solution), you have to make sure that its resource folders are in the same directory as the assembly. That is, if your library is localized in Spanish for example, besides copying the .dll file from your bin folder, you must also copy the 'es' folder to the same directory.

d3dx11.h not in Windows 8.0 kit

My development platform is windows 7 x64. I have installed VS2012 and I'd like to compile a project that includes some Dx11 code.
Specifically, it includes the following files:
#include <d3dx11.h>
#include <d3dx10.h>
and links to
#pragma comment (lib, "d3dx11.lib")
#pragma comment (lib, "d3dx10.lib")
I already have VS2011 installed on my development machine, but I wanted to try the unit testing facilities in VS2012 for native C++.
Due to having VS2011 installed and working on DirectShow code, I have the Windows 7.1 SDK installed.
VS2012 picked this up and had references to the 7.1 SDK, but compilation of my project under VS2012 with the 7.1 SDK referenced gave errors:
"warning C4005: '__useHeader' : macro redefinition"
I googled this and found a query like mine on social.msdn.microsoft.com. and the solution recommended linking with the Windows 8 kit instead of the 7.1 SDK in order to solve this problem.
The Windows 8 kit includes headers like d3d11.h, but not d3dx11.h.
How can I include d3dx11 (from the Dx SDK) along with the windows 8 kit, but without getting multiple "macro redefinition" errors?
I found the following rather annoying quote in this MSDN page.
D3DX is not considered the canonical API for using Direct3D in Windows
8 and therefore isn't included with the corresponding Windows SDK.
Investigate alternate solutions for working with the Direct3D API.
For legacy projects, such as the Windows 7 (and earlier) DirectX SDK
samples, the following steps are necessary to build applications with
D3DX using the DirectX SDK:
Modify the project’s VC++ directories as follows to use the right
order for SDK headers and libraries.
i. Open Properties for the project and select the VC++ Directories
page.
ii. Select All Configurations and All Platforms.
iii. Set these directories as follows:
Executable Directories: (On right-side drop-down)
Include Directories: $(IncludePath);$(DXSDK_DIR)Include
Include Library Directories: $(LibraryPath);$(DXSDK_DIR)Lib\x86
iv. Click Apply.
v. Choose the x64 Platform.
vi. Set the Library directory as follows:
Library Directories: $(LibraryPath);$(DXSDK_DIR)Lib\x64
Wherever "d3dx9.h", "d3dx10.h", or "d3dx11.h" are included in your
project, be sure to explicitly include "d3d9.h", "d3d10.h" and
"dxgi.h", or "d3d11.h" and "dxgi.h" first to ensure you are picking up
the newer version.
You can disable warning C4005 if needed; however, this warning
indicates you are using the older version of these headers.
Remove all references to DXGIType.h in your project. This header
doesn't exist in the Windows SDK, and the DirectX SDK version
conflicts with the new winerror.h.
All D3DX DLLs are installed onto your development computer by the
DirectX SDK installation. Ensure that the necessary D3DX dependencies
are redistributed with any sample or with your application if it is
moved to another machine.
Be aware that replacement technologies for current uses of D3DX11
include DirectXTex and DirectXTK. D3DXMath is replaced by DirectXMath.
FFS Microsoft, please don't change the API's mid-version like this!!!