Why doesnt this work?
I read the font Tutorial for beginners and I tried the code and it didnt work because of these two lines:
HFONT fnt;
fnt = CreateFont(14,0,0,0,0,0,0,0,0,0,0,0,0, "Arial");
Heres the errors I get:
C:\Program Files\Microsoft Visual Studio\MyProjects\DirectX\DirectX.cpp(20) : error C2501: ''fnt'' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\DirectX\DirectX.cpp(20) : error C2040: ''fnt'' : ''int'' differs in levels of indirection from ''struct HFONT__ *''
C:\Program Files\Microsoft Visual Studio\MyProjects\DirectX\DirectX.cpp(20) : error C2440: ''initializing'' : cannot convert from ''struct HFONT__ *'' to ''int''
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
The origial code was
HFONT fnt
Fnt = CreateFont(...)
but fnt and Fnt are not the same, Case-Sensitive, any help?
It almost sounds like you don''t have the right headers included, I think windows.h is all you need for fonts.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement