Solved Massive of Errors with the Directx Menu.

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Timori

Newbie
Feb 14, 2014
3
102
0
Hey guys, i have some weird Problems with the DirecX Menu.

THese are the Messages that get thrown to me:

C++:
1>------ Build started: Project: Win32Project1, Configuration: Debug Win32 ------
1>  d3d9dev.cpp
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(9): error C2146: syntax error : missing ';' before identifier 'hacks'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(22): error C2228: left of '.CreateFontA' must have class/struct/union
1>          type is 'int'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(81): error C2228: left of '.InitializeMenuItems' must have class/struct/union
1>          type is 'int'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(216): error C2228: left of '.KeyboardInput' must have class/struct/union
1>          type is 'int'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(217): error C2228: left of '.DrawMenu' must have class/struct/union
1>          type is 'int'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\d3d9dev.cpp(614): error C2228: left of '.m_Stride' must have class/struct/union
1>          type is 'int'
1>  Hacks.cpp
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(3): error C2628: 'Hacks' followed by 'int' is illegal (did you forget a ';'?)
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(3): error C2440: 'initializing' : cannot convert from 'int' to 'Hacks'
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(48): error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Hacks' (or there is no acceptable conversion)
1>          c:\program files (x86)\windows kits\8.1\include\shared\guiddef.h(192): could be 'bool operator ==(const GUID &,const GUID &)'
1>          while trying to match the argument list '(Hacks, int)'
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(81): error C2676: binary '>' : 'Hacks' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(83): error C2676: binary '--' : 'Hacks' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(90): error C2676: binary '<' : 'Hacks' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(92): error C2676: binary '++' : 'Hacks' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(97): error C2677: binary '[' : no global operator found which takes type 'Hacks' (or there is no acceptable conversion)
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(97): error C2228: left of '.on' must have class/struct/union
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(97): error C2088: '[' : illegal for class
1>c:\users\tobias\documents\visual studio 2013\projects\win32project1\win32project1\hacks.cpp(102): error C2143: syntax error : missing ';' before '}'
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have done all the steps as in the Video, but still this is Happening. I Redid the whole tutorial about 3 Times because i might forgot something, but i clearly didnt..
I have already set up the Projekts Properties and linked them to the Summer 2004 release which i got on this Site somewhere.

I can simply not get what might be wrong with my VC 2012 /2013 (but the same Errors are at VC 2010).

I hope someone might be able to help me out here

Here are the Files:
d3d9dev.cpp, the original as with Fleeps release.

Hacks.h:
C++:
#pragma once

#include <Windows.h>
#include "d3d9.h"
#include <ctime>
#include <iostream>

#define D3DHOOK_TEXTURE
#define MAX_MENU_ITEMS 3

#define HACK_CROSSHAIR 0
#define Inf_MONEY 1
#define HIDE_MENU 2

class Hacks
{
public:
	int m_Stride;

	void Hacks::CreateForm(IDirect3DDevice9 *d3dDevice, std::string choiceFont);
	void Hacks::InitializeMenuItems();
	void Hacks::DrawText(LPCSTR TextToDraw, int x, int y, D3DCOLOR Color);
	void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice);
	void Hacks::DrawFilledRectangle(int x, int y, int w, int h, D3DCOLOR Color, IDirect3DDevice9 *d3dDevice);
	void Hacks::DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Color, IDirect3DDevice9 *d3dDevice);
	void Hacks::KeyboardInput();

	LPDIRECT3DBASETEXTURE9 textRed;
	LPDIRECT3DBASETEXTURE9 textGreen;
	LPDIRECT3DBASETEXTURE9 textBlue;
	LPDIRECT3DBASETEXTURE9 textWhite;

	D3DVIEWPORT9 ViewPort;

	LPD3DXFONT Font;

	struct d3dMenuHack
	{
		bool on;
		std::string name;
	};

	d3dMenuHack hack[MAX_MENU_ITEMS];
}
And Hacks.cpp:
C++:
#include "Hacks.h"

int MenuIndex = 0;

D3DCOLOR fontRed = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR fontGreen = D3DCOLOR_ARGB(255, 0, 255, 0);
D3DCOLOR fontBlue = D3DCOLOR_ARGB(255, 0, 0, 255);
D3DCOLOR fontWhite = D3DCOLOR_ARGB(255, 0, 0, 0);
D3DCOLOR fontBlack = D3DCOLOR_ARGB(255, 255, 255, 255);

void Hacks::CreateForm(IDirect3DDevice9 *d3dDevice, std::string choiceFont)
{
	D3DXCreateFont(d3dDevice, 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET,
		OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
		choiceFont.c_str(), &Font);
}

void Hacks::InitializeMenuItems()
{
	hack[HACK_CROSSHAIR].name = "Activate Crosshair";
	hack[Inf_MONEY].name = "Activate Inf Money";
	hack[HIDE_MENU].on = false;

}
void Hacks::DrawText(LPCSTR TextToDraw, int x, int y, D3DCOLOR Color)
{
	RECT rct = { x - 120, x + 120, y + 15 };
	Font->DrawTextA(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Color);

}
void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice)
{
	if (!hack[HIDE_MENU].on)
	{
		DrawFilledRectangle(55, 20, 200, 50, fontBlue, d3dDevice);
		DrawBorderBox(55, 20, 200, 50, 4, fontBlack, d3dDevice);
		DrawTextA("STARBOUND", 190, 30, fontWhite);

		DrawFilledRectangle(30, 55, 250, (62 * MAX_MENU_ITEMS), fontBlue, d3dDevice);
		DrawBorderBox(30, 55, 250, (62 * MAX_MENU_ITEMS), 6, fontBlack, d3dDevice);

		int y = 40;
		for (int i = 0; i < MAX_MENU_ITEMS; i++)
		{
			DrawFilledRectangle(45, 30 + y, 220, 40, hack[i].on ? fontGreen : fontRed, d3dDevice);
			DrawBorderBox(45, 30 + y, 220, 40, 4, fontBlack, d3dDevice);

			if (MenuIndex == i)
			{
				DrawBorderBox(45, 26 + y, 228, 48, 4, fontBlack, d3dDevice);
			}

			DrawTextA(hack[i].name.c_str(), 170, 59 + y, fontBlack);

			y = y + 50;


		}

		DrawTextA("Select using arrow Keys", 170, ((62 * MAX_MENU_ITEMS) + 7), fontWhite);
		DrawTextA("Turn ON/OFF [END] Key", 170, ((62 * MAX_MENU_ITEMS) + 27), fontWhite);
	}
}

void Hacks::DrawFilledRectangle(int x, int y, int w, int h, D3DCOLOR Color, IDirect3DDevice9 *d3dDevice)
{
	D3DRECT rct = { x, y, x + w, y + h };
	d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, Color, 0, 0);
}
void Hacks::DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Color, IDirect3DDevice9 *d3dDevice)
{
	DrawFilledRectangle(x, y, w, thickness, Color, d3dDevice);
	DrawFilledRectangle(x, y, thickness, h, Color, d3dDevice);
	DrawFilledRectangle(x + w, y, thickness, h, Color, d3dDevice);
	DrawFilledRectangle(x, y, w + thickness, thickness, Color, d3dDevice);
}
void Hacks::KeyboardInput()
{
	if (GetAsyncKeyState(VK_UP) & 1)
	{
		if (MenuIndex > 0)
		{
			MenuIndex--;
		}


	}
	if (GetAsyncKeyState(VK_DOWN) & 1)
	{
		if (MenuIndex < MAX_MENU_ITEMS - 1)
		{
			MenuIndex++;
		}
	}
	if (GetAsyncKeyState(VK_END) & 1)
	{
		hack[MenuIndex].on = !hack[MenuIndex].on;
	}
	if (GetAsyncKeyState(VK_INSERT) & 1)
	{
		hack[HIDE_MENU].on = !hack[HIDE_MENU].on
	}
}
I am using Windows 8, 64-Bit.

EDIT 1: Hmm i think it is wired, that the Debugger shows lower "hacks.cpp" while my file is definitily "Hacks.cpp" with an Upper H
EDIT 2: Changed Code of the Hacks files a bit as i tried things out, no solution till now :(
 
Last edited:

squeenie

Hacker
Meme Tier VIP
Dank Tier Donator
Mar 6, 2013
677
5,478
37
In your last if statement are missing a semi colon and there's probably a bunch of other things but it's too painful to read it on my phone.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods