Archived

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

Why doesnt this work?

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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