Archived

This topic is now archived and is closed to further replies.

perfectly_dark

Why doesnt this work?

Recommended Posts

perfectly_dark    253
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?

Share this post


Link to post
Share on other sites
perfectly_dark    253
here''s my headers:
#include <windows.h>
#include <windowsx.h>
#include <iostream.h>
#include <math.h>
#include <malloc.h>
#include <ddraw.h>

I dont think it''s the headers, when I remove the second line it compiles error free.

Share this post


Link to post
Share on other sites