Re: GetFontUnicodeRanges() will not compile

Tech-Archive recommends: Fix windows errors by optimizing your registry



In an intelligent world, where the developers at Microsoft actually paid attention to what
is going on with The Rest Of Us, one of the pages of the App Wizard would have options to
select all the various platform options in terms of human-readable terms, such as
Operating System
( ) Win95
( ) Win98
( ) WinMe
( ) NT 4.x
( ) Win2K
(*) WinXP
( ) Server 2003
( ) Vista
Internet Explorer
( ) IE6
(*) IE7

and so on, and it would show the symbols in an edit control, or edit controls, as
appropriate. This would be OBVIOUS, USEFUL, and VALUABLE. Not like rewriting the GUI to
be unusable. In the modern VS, this page could be invoked at ANY time after app
generation, or it would be part of the Properties page.

We can only hope.
joe

On Mon, 19 Nov 2007 19:37:27 -0600, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote:


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in
message news:qtu3k3dk6hnem679buolrrifld284l57f8@xxxxxxxxxx
You probably have the wrong platform SDK. Cutting and
pasting is usually considered a bad
idea, because it is supposed to work "out of the box".
For example, by cutting and
pasting, you caused the C++ compiler to think this was a
C++ method. You can tell this
instantly by looking at the name of the method; it has C++
name decoration on it. If it
were trying to link to the API and got an undefined
symbol, it would have said that the
symbol GetFontUnicodeRanges was undefined. Show the
declaration; it is almost certain you
did not copy it precisely as in the SDK. Or by the time
your copied-and-pasted definition
was seen, key macros required for correct compilation were
no longer defined.

If you ever find a definition in a header file and you get
an undefined symbol when trying
to use it, it means you have the wrong conditionals set.
joe


Everything finally works correctly, and it is all very
simple.
GetFontUnicodeRanges() reports the actual Unicode BMP code
points that the font defines. Thus the user of my system can
simply specify the Unicode BMP code points that they will
require, and I can produce these code points directly using
TextOutW().

#define _WIN32_WINNT 0X500
Although I did have to manually force this to be defined, (I
wonder why that was), now it all works correctly.

Thanks again for all your help.

On Mon, 19 Nov 2007 13:40:01 -0600, "Peter Olcott"
<NoSpam@xxxxxxxxxxxxx> wrote:

I am using MS Visual C++ 6.0 on a Windows XP Pro platform.
I forced the code to almost compile by cutting and pasting
the declarations from the wingdi.h include file. Now I am
getting this linker error:


--------------------Configuration: UnicodeTest - Win32
Debug--------------------
Linking...
UnicodeTestDlg.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) unsigned long __stdcall
GetFontUnicodeRanges(struct HDC__ *,struct tagGLYPHSET *)"
(__imp_?GetFontUnicodeRanges@@YGKPAUHDC__@@PAUtagGLYPHSET@@@Z)
Debug/UnicodeTest.exe : fatal error LNK1120: 1 unresolved
externals
Error executing link.exe.

UnicodeTest.exe - 2 error(s), 0 warning(s)


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in
message news:v3o3k35vutqof6uu5c763ligj3o6kj072d@xxxxxxxxxx
What are the various constants sent in your stdafx.h,
and
are you using a Win2K or higher
platform SDK?
joe
On Mon, 19 Nov 2007 11:08:17 -0600, "Peter Olcott"
<NoSpam@xxxxxxxxxxxxx> wrote:

LPGLYPHSET lpgs; // pointer to the glyph set
structure
::GetFontUnicodeRanges(this->GetDC(), lpgs); // HDC
hdc,
LPGLYPHSET lpgs


--------------------Configuration: UnicodeTest - Win32
Debug--------------------
Compiling...
UnicodeTestDlg.cpp
O:\cpp\DFA\UnicodeTest\UnicodeTestDlg.cpp(179) : error
C2065: 'LPGLYPHSET' : undeclared identifier
O:\cpp\DFA\UnicodeTest\UnicodeTestDlg.cpp(179) : error
C2146: syntax error : missing ';' before identifier
'lpgs'
O:\cpp\DFA\UnicodeTest\UnicodeTestDlg.cpp(179) : error
C2065: 'lpgs' : undeclared identifier
O:\cpp\DFA\UnicodeTest\UnicodeTestDlg.cpp(180) : error
C2039: 'GetFontUnicodeRanges' : is not a member of
'`global
namespace''
O:\cpp\DFA\UnicodeTest\UnicodeTestDlg.cpp(180) : error
C2065: 'GetFontUnicodeRanges' : undeclared identifier
Error executing cl.exe.

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages