AddFontResourceEx
-
I am trying to include AddFontResourceEx(Fontname,FR_PRIVATE,0); but get the error message that the function and FR_PRIVATE are undefined. Of course I have wingdi.h in the opening lines : #define UNICODE // Save as Unicode -Codepage 1200 #include ; #include ; The error is produced when I try to compile. I have added gdi32.lib to the command line. What am I supposed to do about gdi32.dll ? Thanks for any help Raymond Mercier
-
I am trying to include AddFontResourceEx(Fontname,FR_PRIVATE,0); but get the error message that the function and FR_PRIVATE are undefined. Of course I have wingdi.h in the opening lines : #define UNICODE // Save as Unicode -Codepage 1200 #include ; #include ; The error is produced when I try to compile. I have added gdi32.lib to the command line. What am I supposed to do about gdi32.dll ? Thanks for any help Raymond Mercier
-
Sorry, this failed to appear ! #define UNICODE // Save as Unicode -Codepage 1200 #include <windows.h> #include <Winbase.h> #include <WinGDI.h>
You need to install the Platform SDK[^] or Windows SDK[^]. Which SDK is Right for Me?[^] Best Wishes, -David Delaune
-
You need to install the Platform SDK[^] or Windows SDK[^]. Which SDK is Right for Me?[^] Best Wishes, -David Delaune
Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1. Meanwhile I have managed (sort of) with these lines, which do allow me to get the function. I still fail to see why I have to go through all this, but not for AddFontResource, and I still have to put 0x10, since FR_PRIVATE is not recognized. static FARPROC fpAddFontRes,fpRemoveFontRes; HMODULE hLibrary; hLibrary=LoadLibraryW(L"gdi32.dll"); fpAddFontRes=GetProcAddress(hLibrary,(LPCSTR)"AddFontResourceExW"); fpRemoveFontRes=GetProcAddress(hLibrary,(LPCSTR)"RemoveFontResourceExW"); ..... nFontLoad=(*fpAddFontRes)(Bact,0x10,0); At least this works fine ! Raymond Mercier
-
Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1. Meanwhile I have managed (sort of) with these lines, which do allow me to get the function. I still fail to see why I have to go through all this, but not for AddFontResource, and I still have to put 0x10, since FR_PRIVATE is not recognized. static FARPROC fpAddFontRes,fpRemoveFontRes; HMODULE hLibrary; hLibrary=LoadLibraryW(L"gdi32.dll"); fpAddFontRes=GetProcAddress(hLibrary,(LPCSTR)"AddFontResourceExW"); fpRemoveFontRes=GetProcAddress(hLibrary,(LPCSTR)"RemoveFontResourceExW"); ..... nFontLoad=(*fpAddFontRes)(Bact,0x10,0); At least this works fine ! Raymond Mercier
RaymondM wrote:
Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1.
My recommendation remains the same. The updated headers are included with the Platform SDK. You can use the Platform SDK with VC6. I have a copy of VC6 installed along-side several versions of the Platform SDK. I can't believe that you went this many years without it. The LoadLibrary/GetProcAddress technique will also work if you choose to do it that way. But the next time you try to use a new GDI enum/constant or data type you might be back in the same boat.
RaymondM wrote:
I still fail to see why I have to go through all this, but not for AddFontResource
AddFontResource[^] was included in the VC6 header distribution. AddFontResourceEx [^]is available in Windows 2000 and above and the header file was updated in the Platform SDK. The declaration for AddFontResourceEx [^]is preceeded by:
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
So you would need: 1.) A header file with the AddFontResourceEx declaration. 2.) Declare a windows version greater or equal to _WIN32_WINNT_WIN2K. Best Wishes, -David Delaunemodified on Tuesday, January 27, 2009 3:19 AM
-
RaymondM wrote:
Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1.
My recommendation remains the same. The updated headers are included with the Platform SDK. You can use the Platform SDK with VC6. I have a copy of VC6 installed along-side several versions of the Platform SDK. I can't believe that you went this many years without it. The LoadLibrary/GetProcAddress technique will also work if you choose to do it that way. But the next time you try to use a new GDI enum/constant or data type you might be back in the same boat.
RaymondM wrote:
I still fail to see why I have to go through all this, but not for AddFontResource
AddFontResource[^] was included in the VC6 header distribution. AddFontResourceEx [^]is available in Windows 2000 and above and the header file was updated in the Platform SDK. The declaration for AddFontResourceEx [^]is preceeded by:
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
So you would need: 1.) A header file with the AddFontResourceEx declaration. 2.) Declare a windows version greater or equal to _WIN32_WINNT_WIN2K. Best Wishes, -David Delaunemodified on Tuesday, January 27, 2009 3:19 AM
>>"I can't believe that you went this many years without it" (PlatformSDK). I don't know why you think that I do not already have the headers, since they come with the full installation of Microsoft Visual Studio .NET 2003, including its PlatformSDK. In wingdi.h I find the condition _WIN32_WINNT >= 0x0500, which is obviously satisfied in the XP that I am using. From I see that for XP _WIN32_WINNT = 501 So I only need to add #define _WIN32_WINNT 501 before windows.h, and then I can call the function I need. That is of course the only point that I had overlooked. Raymond Mercier
-
>>"I can't believe that you went this many years without it" (PlatformSDK). I don't know why you think that I do not already have the headers, since they come with the full installation of Microsoft Visual Studio .NET 2003, including its PlatformSDK. In wingdi.h I find the condition _WIN32_WINNT >= 0x0500, which is obviously satisfied in the XP that I am using. From I see that for XP _WIN32_WINNT = 501 So I only need to add #define _WIN32_WINNT 501 before windows.h, and then I can call the function I need. That is of course the only point that I had overlooked. Raymond Mercier
RaymondM wrote:
I don't know why you think that I do not already have the headers
Because you told me that you were compiling the project with VC6.
RaymondM wrote:
So I only need to add #define _WIN32_WINNT 501 before windows.h, and then I can call the function I need. That is of course the only point that I had overlooked.
Exactly what I stated in my last response. I am happy to hear that you have corrected the problem. Best Wishes, -David Delaune