Why do i keep geting this error?

Posts 113 of 13 · Page 1 of 1
Why do i keep geting this error?
Code:
Error	1	error C2664: 'ID3DXFont::DrawTextW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'	c:\users\chris\desktop\uptodatebase\my hacks\cabase\directx.cpp	27	1	CaBase
&
Code:
	2	IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR"	c:\users\chris\desktop\uptodatebase\my hacks\cabase\directx.cpp	27	26	CaBase
this is what is causing it
Code:
void cDirectx::DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt, ...)
{
	RECT FontPos = { x, y, x + 120, y + 16 };
	char buf[1024] = {'\0'};
	va_list va_alist;

	va_start(va_alist, fmt);
	vsprintf_s(buf, fmt, va_alist);
	va_end(va_alist);

	g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}
Quote Originally Posted by cosconub View Post
Code:
Error	1	error C2664: 'ID3DXFont::DrawTextW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'	c:\users\chris\desktop\uptodatebase\my hacks\cabase\directx.cpp	27	1	CaBase
&
Code:
	2	IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR"	c:\users\chris\desktop\uptodatebase\my hacks\cabase\directx.cpp	27	26	CaBase
this is what is causing it
Code:
void cDirectx::DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt, ...)
{
	RECT FontPos = { x, y, x + 120, y + 16 };
	char buf[1024] = {'\0'};
	va_list va_alist;

	va_start(va_alist, fmt);
	vsprintf_s(buf, fmt, va_alist);
	va_end(va_alist);

	g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}


Hahahaha and you code for a VIP site //
It's cause you didn't learn C++.
Quote Originally Posted by Stephen View Post




Hahahaha and you code for a VIP site //
XD FAIL SAUCE
Quote Originally Posted by Beatz View Post
It's cause you didn't learn C++.
Dude are you gonna help me or flame me i just want some help
Quote Originally Posted by cosconub View Post
Dude are you gonna help me or flame me i just want some help
Read the error...
Google it...

I helped you.
i dont remember, but does it have to do with the multi byte character set?
bingo hes using a unicode byte character set, not a multi byte.. just change it in your programs propertys
^^you should thank him he helped you
/ i love thanks it makes me uber l337
Quote Originally Posted by gcflames12 View Post
/ i love thanks it makes me uber l337
thanks whore xD
thanks fixxed it
Posts 113 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?