Missing file from MSDN example for GDI printing - c++

I am trying to learn to print using GDI.
I have searched MSDN for resources and found this example.
I like the thought of putting printing in separate thread, and using GDI is easier for me to learn than using XPS API so I have downloaded the example.
After trying to compile it ( I use Visual Studio 2008 ) I get this error:
fatal error C1083: Cannot open include file: 't2embapi.h': No such file or directory
According to this, I have found out that I am not the only one facing this problem.
Still, I have tried to Google the above error and found this that indicates me not having the latest SDK.
I have searched in C:\Program Files\Microsoft SDKs\Windows and found a folder v6.0A which indicates that I do not have latest SDK installed.
However, here I have found one post where person with the same problem did not solve it by downloading the latest SDK ( although the year that post was made is 2006, still the file was missing then too, and downloading the SDK didn't help-why should anything change now? ).
My question is:
Is there a way to get this file ( if I am wrong about downloading the latest SDK please correct me ) ?
I think that this file has to do something with fonts-is there a way to modify the example so I do not have to use that file?
Thank you for you rime to view this thread and for trying to help.
Best regards.

T2Embapi.h is supplied by the Windows SDK, it contains declarations for the Font Embedding Services Library to handle embedded OpenType fonts. Clearly the SDK version you use is too old to have it. Not exactly sure which version is required, I know that v6.0 doesn't have it but v7.1 does.
There's some sloppiness in the project due to it starting as an XPS sample. T2Embapi isn't actually required to build the GDI sample. You can simply delete the #include from stdafx.h. Also some sloppiness in the Release configuration settings of the project, remove T2embed.lib and XpsPrint.lib from the linker's Additional Dependencies setting.

Your question is:
1.
Is there a way to get this file ( if I am wrong about downloading the latest SDK please correct me ) ?
The latest version of Windows SDK is for Windows 8.1. Windows Software Development Kit (SDK) for Windows 8.1. However, I think the 't2embapi.h' have already included Windows SDK for Windows 7, because I found the header file in 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include'.
2.
I think that this file has to do something with fonts-is there a way to modify the example so I do not have to use that file?
#Hans Passant has already answered about that.

Related

CUDA opencv building fails - missing file that is actually there

I am trying to do the following: getting to work
CUDA 9.1 with
openCV 3.4.2 and
Visual Studio Enterprise 2015 (v 14.0 Update 3) on
Windows 7 Enterprise x64 SP 1 using
CMake 3.12.0
and also searching for others with the same problem - no success there.
I have worked through this tutorial on getting the software to work together. I do not intend to use Intel MKL and TBB.
I have succeeded in
installing CUDA
generating the Makefiles for openCV with CMake, and having the CUDA libraries included without any mistakes (barring the download of optional stuff, as the PC I am working on is to stay off the internet)
generating the .sln solution file for building openCV in Visual Studio
The problem is in the next step - building openCV. The compiler claims that "opencv2/opencv_modules.hpp" cannot be opened by gpu_mat_cu when it tries to build opencv_world. The thing is that the include path works according to Visual Studio - it detects the right file in the gpu_mat.cu. The project (opencv_world) has the right directory in its include paths as static path.
I am new to Visual Studio (I worked in Linux with QT, CUDA and openCV before), so I am not too sure I am not missing some kind of settings I should change.
The opencv_world.hpp only consists of #define instructions. I have tried deleting the include of opencv_world.hpp and instead just defining the parameter in gpu_mat.cu itself, but if I do, the next include (that, again, VS finds the path to without problems) is not resolved.
I guess there is something obvious I am missing, but I don't seem to be able to resolve this issue, so thanks in advance for your help.
Cr4sh
P.S.: The files CMake wanted to download for openCV and failed at (obviously; no internet connection) are: opencv_ffmpeg.dll, opencv_ffmped64.dll, ffmpeg_version.cmake, ippicv_2017u3_win_intel64_general_20180518.zip, res10_300x300_ssd_iter_140000_fp16.caffemodel and opencv_face_detector_uint8.pb
I'd add the CMakeCache.txt file in a spoiler tag, but it has too many characters. If you think it would help, let me know and I'll upload it somewhere.
I got the solution, just in case someone stumbles over the same problem: it's the most simple thing that everybody knows until they don't - my include path contained a white space that apparently somewhere was treated as a String divider for whatever interprets that path.

Getting Juce to Work (Windows)

I downloaded Juce and VisualStudio2017 because through researches it seemed that Juce was a good way to create a GUI app dealing with midi files.
My problem is i can't even get to use the first examples of GUI !
I get this type of error, for multiple different files :
[...]\juce\modules\juce_core\native/juce_BasicNativeHeaders.h(135): fatal error C1083: Cannot open include file: 'wininet.h': No such file or directory (compiling source file ....\JuceLibraryCode\include_juce_audio_formats.cpp).
Can anyone help me ?
Looking for this wininet.h file into google doesn't appear to give me any help :/
It seems that Windows 10 SDK JUCE was targeting by default was broken - multiple files, like wininet.h mentioned by you are missing there.
There are a few ways you can fix it:
1) You can get the latest JUCE develop where it is fixed, in particular it was fixed here
2) You can instruct Projucer to use the fixed SDK version by changing Windows Target Platform to 10.0.16299.0 (make sure you have the latest version of Visual Studio 2017 and that you have downloaded the Windows 10 SDK version 10.0.16299.0) as shown...
...here
3) You can wait for the new official JUCE release where the fix will be included (i.e. available on master).
Sorry for late response, usually the quickest way to raise any issues is via visiting forum.juce.com

Build project file with premake4 - how to?

Based on http://arcsynthesis.org/gltut/Building%20the%20Tutorials.html - the book Im reading to learn openGL, I need to build my file projects with premake4. The book says:
"The SDK his library uses Premake to generate its build files. So, with premake4.exe in your path, go to the glsdk directory. Type premake4 plat, where plat is the name of the platform of choice. For Visual Studio 2008, this would be “vs2008”; for VS2010, this would be “vs2010.” This will generate Visual Studio projects and solution files for that particular version."
So, I've put the premake4.exe file inside but the problem is: When I execute it, one black command window shows up for a few ms, then fades and nothing happens.
I made one research on google about how to work with premake4 but I couldnt find nothing useful, even here on stack or you tube. Anyway, This seems weard since premake4 is really known, then I ask: Does anyone know what Im missing or could point me to somewhere which I can understand how to build my openGL "sdk" files?
Im using premake 4.3 with Windows 8.
Edit: I just found someone with the same problem - but the solution isnt really applying for me: Can't get premake working - gltut demos
Edit 2: Found once again someone with the same problem, but this no solution on the topic and also the OS is different from mine.. http://industriousone.com/topic/terminal-logout-when-running-premake4exe
As it says in the documentation you quoted:
Type premake4 plat, where plat is the name of the platform of choice. For Visual Studio 2008, this would be “vs2008”; for VS2010, this would be “vs2010.”
Just running it with no arguments (which is what double-clicking on it does) is not sufficient. You need to open a command prompt, cd to the directory the project is in, and then run premake4 vs2008 (replacing vs2008 with the name of the platform you're targeting).
The most recent version of Visual Studio supported by Premake is 2010, so for later versions, you'll still have to use premake vs2010 - later versions of VS should still be able to load the project.
ToxicFrog's answer was extremely helpful, but just to be a little more blunt and clear about the answer for someone who might not how to use the command prompt very well.
Place 'premake4.exe' inside your 'glsdk directory (file).
In Windows, hold down the 'Shift' key and right-click the glsdk directory.
Select "Open Command window here" from the drop-down box .
Type premake4 vs2010 (or whichever platform you are using. For example, if you are using Visual Studio 2013, use vs2013 for your platform.).
Note: According to ToxicFrog and Victor Oliveira the platform vs2010 is the highest it will support . However, I recently tried it with vs2012 and it worked just fine).

I cannot build and run a simple Qt 5 application,

I downloaded and installed Qt 5 on Windows 7.
I opened QtCreator 2.6.1 and created a new simple GUI application.
When I try to run it, it says:
“C:\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore\qglobal.h:46: error:
C1083: Cannot open include file: ‘stddef.h’: No such file or
directory”
What is the problem and how do I solve it?
My compiler is: MSVC2010 32 bit
A google search yielded the following:
http://qt-project.org/forums/viewthread/10255
This thread notes that this error happens when you don't have the Microsoft Platform SDK installed and you are using Visual Studio. That would make sense considering that stddef.h is one of the standard headers (usually its included using <cstddef>, but looking at the source for qtcore/global.h it would seem that it is indeed included as <stddef.h>). So, try installing the platform SDK if it isn't already there.
If you already do have the sdk, perhaps it isn't configured properly. This answer says you need to follow the instructions given by microsoft here to do command line builds properly. I think Qt Creator probably executes the compiler from the command line, so that may help.
If that still doesn't work, try installing the MinGW compiler and using that. I have seen a few references saying that its easier to compile for Qt under windows using MinGW.

DirectShow Graph::RenderFile --> VFW_E_NOT_FOUND with rebuilt project

After I have reinstalled VC++ 2008 during my yearly cleanup on my PC, my multimedia project that compiled and worked without a problem, seems to produce a strange error:
The application basically is a media player and uses DirectShow. I already retried it with the standard example of MSDN "HOW TO PLAY A FILE" and appearently the error happens at this line:
hr = pGraph->RenderFile(L"C:\\TEST.avi");
hr (HRESULT) returns VFW_E_NOT_FOUND and I have no idea why because the example file IS there, I already change the location AND the example file but anyway it keeps failing.
Could this error result from a damaged file or a wrong file version or am I just too dumb to find the error? I reinstalled every application I have had on the PC before reinstalling Windows, EXCEPT Visual Studio C++ 2010.
My configuration:
Windows 7 Ultimate x64 SP1
VC++ 2008 Express
Windows 7 SDK amd64 installed
DirectX SDK June 2010 installed
Question "answered", look for the comment below the question...
In short:
Folder options --> Hide known extensions checkbox ticked.
Renamed File as "TEST.avi" results in real name: TEST.avi.avi
(TEST.avi == Test.avi.avi) == FALSE --> me.idiot = true;
Actually, this question could be deleted (no real coding issue)!
Just for people like me who will try to find an answer.
In my case the path was right. But I still was getting the same error VFW_E_NOT_FOUND.
I tried to open a video file with media player and I got an error too.
The problem was in missing codecs.
The solution is to install K-Lite Codec Pack.
And the error disappeared.