# Fonts and Book Source Code

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

## Recommended Posts

Hi, recently i purchase the second edition RPG with DirectX and am having trouble compiling the programes. I can compile most of the programmes but when i get to a font example i get the following errors... --------------------Configuration: Font - Win32 Debug-------------------- Compiling... WinMain.cpp c:\personal\programming\bookcode\chap02\font\winmain.cpp(138) : error C2664: 'D3DXCreateFontIndirectA' : cannot convert parameter 2 from 'struct tagLOGFONTA *' to 'const struct _D3DXFONT_DESCA *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\personal\programming\bookcode\chap02\font\winmain.cpp(171) : error C2039: 'Begin' : is not a member of 'ID3DXFont' c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\d3dx9core.h(294) : see declaration of 'ID3DXFont' c:\personal\programming\bookcode\chap02\font\winmain.cpp(172) : error C2660: 'DrawTextA' : function does not take 5 parameters c:\personal\programming\bookcode\chap02\font\winmain.cpp(173) : error C2039: 'End' : is not a member of 'ID3DXFont' c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\d3dx9core.h(294) : see declaration of 'ID3DXFont' Error executing cl.exe. Font.exe - 4 error(s), 0 warning(s) Having looked at the Documentation on MSDN for the 'D3DXCreateFontIndirectA' function seems correct in that number of parameters, The ID3DXFont interface does not have a begin or end function and the DrawTextA takes 6 parameters not 5. But having looked at the following archived article on MDSN, http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3dx/interfaces/id3dxfont/_id3dxfont.asp This gives the ID3DXFont interface having the Begin and End functions, and also the DrawText does take 5 not 6 parameters. I have downloaded the DirectX SDK 9.0 (summer 2004) edition and installed this on my machine. All i can think of is that i am running the wrong versionof the SDK. But using the SDK that can on the CD( Summer 2003 by memory) still has the same problems. Can Anyone Point me in the right direction?

##### Share on other sites
I'd look at your function declarations then check the MSDN documentation to compare..Seems like something isn't matching up.

• 15
• 22
• 13
• 14
• 45