D3D Menu Error

Posts 1–13 of 13 · Page 1 of 1
D3D Menu Error
Hey there,

I just tried to make d3d menu from @qmoainx D3d menu tutorial [Cause I didn't learn D3D yet]

And I got error at building , Asked my friend he said he cant help cause he's an opengl coder

Link to tutorial

Sorry Its too big to post here

I made the headers and everything .




The Error
1>------ Build started: Project: D3DMenu, Configuration: Debug Win32 ------
1> D3DMenu.cpp
1>c:\users\idc\documents\visual studio 2010\projects\d3dmenu\d3dmenu\functions.h(13): error C2664: 'ID3DXFont:rawTextW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\idc\documents\visual studio 2010\projects\d3dmenu\d3dmenu\d3dmenu.cpp(166): error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If you cant help here do it via PM Please.

Don't go Off topic.

Any Help will be Thanked.

Virus scans :
Jotti
Virus Total
D3DMenu.rarattachment deleted · 139 downloads before removal
1>------ Build started: Project: D3DMenu, Configuration: Debug Win32 ------
1> D3DMenu.cpp
1>c:\users\idc\documents\visual studio\C++ 2010\projects\d3dmenu\d3dmenu\functions.h(13): error C2664: 'ID3DXFont:rawTextW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\idc\documents\visual studio\C++ 2010\projects\d3dmenu\d3dmenu\d3dmenu.cpp(166): error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
No Erorr code : #5 SR(S)**#Fixederror
lol easiest error ever.. well sometimes it can be tricky
Yours
Code:
 "GetModuleHandleW"
Fixed
Code:
 L"GetModuleHandleW"
Quote Originally Posted by Fly3r View Post
lol easiest error ever.. well sometimes it can be tricky
Yours
Code:
 "GetModuleHandleW"
Fixed
Code:
 L"GetModuleHandleW"
Tried yours , Another error.


Edit: This worked without any errors

hD3D = (DWORD)"GetModuleHandleW(d3dx9.dll)";
Okay I need help with this error please.

1>c:\users\idc\documents\visual studio 2010\projects\d3dmenu\d3dmenu\functions.h(13): error C2664: 'ID3DXFont:rawTextW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Code
#include "SystemIncludes.h"


void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
{
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}
try that again or just go to project properties and made it Multi Byte char
Quote Originally Posted by Fly3r View Post
try that again or just go to project properties and made it Multi Byte char
Here is the Result

1>------ Build started: Project: D3DMenu, Configuration: Debug Win32 ------
1> D3DMenu.cpp
1>c:\users\idc\documents\visual studio 2010\projects\d3dmenu\d3dmenu\functions.h(8): error C2664: 'ID3DXFont:rawTextW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
check project setting.
character set:multi byte characters
press thanx
Quote Originally Posted by giniyat101 View Post
check project setting.
character set:multi byte characters
press thanx
When I tried Multi char I got this error

1>------ Build started: Project: D3DMenu, Configuration: Debug Win32 ------
1> D3DMenu.cpp
1>c:\users\idc\documents\visual studio 2010\projects\d3dmenu\d3dmenu\functions.h(8): error C2664: 'ID3DXFont:rawTextW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Quote Originally Posted by TeRMiN4T0R2 View Post
When I tried Multi char I got this error
check functions.h file
Code:
  void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
change to :
Code:
  void PrintText(LPCWSTR pString, int x, int y, D3DCOLOR col, ID3DXFont *font)
Quote Originally Posted by giniyat101 View Post
check functions.h file
Code:
  void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
change to :
Code:
  void PrintText(LPCWSTR pString, int x, int y, D3DCOLOR col, ID3DXFont *font)
Another error
1>------ Build started: Project: D3DMenu, Configuration: Release Win32 ------
1> D3DMenu.cpp
1>D3DMenu.cpp(39): error C2664: 'PrintText' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(47): error C2664: 'PrintText' : cannot convert parameter 1 from 'const char [17]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(52): error C2664: 'PrintText' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(102): error C2664: 'PrintText' : cannot convert parameter 1 from 'const char [3]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(104): error C2664: 'PrintText' : cannot convert parameter 1 from 'const char [4]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(121): error C2664: 'PrintText' : cannot convert parameter 1 from 'const char [37]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D3DMenu.cpp(123): error C2664: 'PrintText' : cannot convert parameter 1 from 'const char [37]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Quote Originally Posted by TeRMiN4T0R2 View Post
Another error
first, this is English only forum, so remove arabic
second, google Hans211 D3D base or TopBlast D3D base both are good
All clean. /approved
Solved by giniyat101

/Request close
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?