Results 1 to 13 of 13
  1. #1
    cosconub's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in the programming section MPGH Cash: $90,000,000,000
    Posts
    372
    Reputation
    -4
    Thanks
    39
    My Mood
    Psychedelic

    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);
    }
    Last edited by cosconub; 08-19-2010 at 06:08 AM.

  2. #2
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,689
    Reputation
    184
    Thanks
    1,149
    My Mood
    Aggressive
    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 //

  3. #3
    Beatz's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    In your head.
    Posts
    2,118
    Reputation
    66
    Thanks
    321
    My Mood
    Stressed
    It's cause you didn't learn C++.
    Don't Talk If You Can't Do.


  4. #4
    Yepikiyay's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    320
    Reputation
    10
    Thanks
    37
    My Mood
    Drunk
    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++.

    I Hate You
    Current Status: Online Playing MineCraft

  5. #5
    cosconub's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in the programming section MPGH Cash: $90,000,000,000
    Posts
    372
    Reputation
    -4
    Thanks
    39
    My Mood
    Psychedelic
    Dude are you gonna help me or flame me i just want some help

  6. #6
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    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.

  7. #7
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    i dont remember, but does it have to do with the multi byte character set?

  8. #8
    gcflames12's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    wada
    Posts
    181
    Reputation
    10
    Thanks
    24
    bingo hes using a unicode byte character set, not a multi byte.. just change it in your programs propertys

  9. The Following User Says Thank You to gcflames12 For This Useful Post:

    cosconub (08-19-2010)

  10. #9
    swatfx's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    659
    Reputation
    20
    Thanks
    108
    My Mood
    Mellow
    ^^you should thank him he helped you

  11. #10
    gcflames12's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    wada
    Posts
    181
    Reputation
    10
    Thanks
    24
    / i love thanks it makes me uber l337

  12. #11
    swatfx's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    659
    Reputation
    20
    Thanks
    108
    My Mood
    Mellow
    Quote Originally Posted by gcflames12 View Post
    / i love thanks it makes me uber l337
    thanks whore xD

  13. #12
    gcflames12's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    wada
    Posts
    181
    Reputation
    10
    Thanks
    24
    haha howd u know :P pm me!!!!

  14. #13
    cosconub's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in the programming section MPGH Cash: $90,000,000,000
    Posts
    372
    Reputation
    -4
    Thanks
    39
    My Mood
    Psychedelic
    thanks fixxed it
    Last edited by cosconub; 08-19-2010 at 01:33 PM.

Similar Threads

  1. [Help Request] why do i keep getting this error?
    By guypeledftw in forum Combat Arms Help
    Replies: 1
    Last Post: 06-17-2011, 10:15 AM
  2. WHY DO I KEEP GETTING THIS?????????
    By megacool4000 in forum Combat Arms Coding Help & Discussion
    Replies: 24
    Last Post: 10-30-2010, 09:42 PM
  3. Why i keep getting this error?
    By muumimamma in forum Combat Arms EU Help
    Replies: 10
    Last Post: 07-03-2010, 10:19 PM
  4. I keep getting this error message
    By I-Rule in forum CrossFire Help
    Replies: 7
    Last Post: 06-29-2010, 12:43 AM
  5. help i keep getting this error
    By <sniper> in forum Hardware & Software Support
    Replies: 0
    Last Post: 10-29-2007, 05:13 PM