Why can't labels prints integrers? - c++-cli

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
int result = 0;
result += 1;
label1->Text = result;
}
Can someone tell me how to fix this code?

value += 1;
String^ lol = System::Convert::ToString(value);
label1->Text = lol;

Related

Connection between two Indy UDP Servers

I'm using RAD Studio 10.2 with two instances of TIdUDPServer from Indy 10.
I run my program on Windows 10 and check the counters of sent and received packages, but there are no packages received. At the same time, I see through Wireshark that they come to the PC, but the second TIdUDPServer does not receive the packages. Why?
Here is my code:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
typedef struct {
char Data[10000];
} struct_Buffer;
int i = 0;
int n = 0;
int k = 0;
int TxSize = 1400;
char TxData;
struct_Buffer TxBuffer;
AnsiString ServerIP1 = "192.168.10.1";
AnsiString ServerIP2 = "192.168.10.2";
TBytes Buffer;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
class TMyQueueProc1 : public TCppInterfacedObject<TThreadProcedure>
{
private:
int m_counter;
TIdBytes m_bytes;
public:
TMyQueueProc1(int ACounter, const TIdBytes &AData) : m_counter(ACounter), m_bytes(AData) {}
INTFOBJECT_IMPL_IUNKNOWN(TInterfacedObject);
void __fastcall Invoke()
{
Form1->Label1->Caption = "Rx " + IntToStr(m_counter);
}
};
void __fastcall TForm1::FormCreate(TObject *Sender)
{
try {
TIdSocketHandle *SocketHandle_Server = Form1->IdUDPServer1->Bindings->Add();
SocketHandle_Server->IP = ServerIP1;
SocketHandle_Server->Port = 4004;
Form1->IdUDPServer1->Active = true;
}
catch(Exception *ex) {
ShowMessage("IdUDPServer1 start error!");
}
try {
TIdSocketHandle *SocketHandle_Echo = Form1->IdUDPServer2->Bindings->Add();
SocketHandle_Echo->IP = ServerIP2;
SocketHandle_Echo->Port = 4004;
Form1->IdUDPServer2->Active = true;
}
catch(Exception *ex) {
ShowMessage("IdUDPServer2 start error!");
}
Timer1->Interval = 100;
Timer1->Enabled = true;
Label3->Caption = "IdUPDServer1: " + ServerIP1;
Label4->Caption = "IdUDPServer2: " + ServerIP2;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
TxData++;
if (TxData == 255) TxData = 0;
for (k = 0; k < TxSize; k++) TxBuffer.Data[k] = TxData;
Buffer = RawToBytes(&TxBuffer.Data[0], TxSize);
Form1->IdUDPServer1->SendBuffer(ServerIP2, 4004, Buffer);
n++;
Label2->Caption = "Tx " + IntToStr(n);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::IdUDPServer2UDPRead(TIdUDPListenerThread *AThread, const TIdBytes AData,
TIdSocketHandle *ABinding)
{
i++;
TThread::Queue(NULL, _di_TThreadProcedure(new TMyQueueProc1(i, AData)));
}
//---------------------------------------------------------------------------

Visual Studio C++ ERR : Functions already have bodies

Just a warning, I'm new and inexperienced in C++ so if I have really bad syntax or I'm missing something obvious, please excuse me. I'm trying to make a program that allows me to open other programs (like game launchers) from inside of it.
I don't want to define the programs in the code so I can change it without recompiling. I'm using a Visual Studio generated Windows Form header file that I've made a few tweaks to and a main cpp file. When I go to compile, I get an ERR_MESSAGE saying that my functions already have bodies. Here's my code:
CPP Script MyForm.cpp:
#include "MyForm.h"
#include <iostream> // Debug (Remove once done)
#include <fstream> // File stream
#include <stdlib.h> // Execute files
using namespace std;
using namespace System;
using namespace System::Windows::Forms;
// Creating the virtual file arrays
char line1[];
char line2[];
char line3[];
char line4[];
char line5[];
char line6[];
char line7[];
char line8[];
char line9[];
char line10[];
char line11[];
char line12[];
namespace Loader {
void loadProgram(int num) {
char new_line[] = { '\n' };
if (num == 1) {
if (line2 != new_line) {
system(line2);
}
}
else if (num == 2) {
if (line4 != new_line) {
system(line4);
}
}
else if (num == 3) {
if (line6 != new_line) {
system(line6);
}
}
else if (num == 4) {
if (line8 != new_line) {
system(line8);
}
}
else if (num == 5) {
if (line10 != new_line) {
system(line10);
}
}
else if (num == 6) {
if (line12 != new_line) {
system(line12);
}
}
}
}
[STAThreadAttribute]
int main() {
// Assigning variables made in pre-processing
const int lineLength = 255;
if (!lineLength) {
const int lineLength = 255;
}
unsigned int lineLengthUnsigned = lineLength;
char line1[lineLength];
char line2[lineLength];
char line3[lineLength];
char line4[lineLength];
char line5[lineLength];
char line6[lineLength];
char line7[lineLength];
char line8[lineLength];
char line9[lineLength];
char line10[lineLength];
char line11[lineLength];
char line12[lineLength];
ifstream file("Programs.txt"); // Load programs list file (READ ONLY)
// Odd lines are program names, even lines are program shortcuts
file.getline(line1, lineLength);
file.getline(line2, lineLength);
file.getline(line3, lineLength);
file.getline(line4, lineLength);
file.getline(line5, lineLength);
file.getline(line6, lineLength);
file.getline(line7, lineLength);
file.getline(line8, lineLength);
file.getline(line9, lineLength);
file.getline(line10, lineLength);
file.getline(line11, lineLength);
file.getline(line12, lineLength);
// Below will run the window
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
FileOpener::MyForm form;
Application::Run(%form);
}
Header File MyForm.h:
#pragma once
#include "MyForm.cpp"
using namespace System;
using namespace System::Windows::Forms;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Data;
using namespace System::Drawing;
namespace FileOpener {
/// <summary>
/// Summary for MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
MyForm(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(12, 12);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(64, 64);
this->button1->TabIndex = 0;
this->button1->Text = L"button1";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
//
// button2
//
this->button2->Location = System::Drawing::Point(82, 12);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(64, 64);
this->button2->TabIndex = 1;
this->button2->Text = L"button2";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
//
// button3
//
this->button3->Location = System::Drawing::Point(152, 12);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(64, 64);
this->button3->TabIndex = 2;
this->button3->Text = L"button3";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &MyForm::button3_Click);
//
// button4
//
this->button4->Location = System::Drawing::Point(12, 82);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(64, 64);
this->button4->TabIndex = 3;
this->button4->Text = L"button4";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &MyForm::button4_Click);
//
// button5
//
this->button5->Location = System::Drawing::Point(82, 82);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(64, 64);
this->button5->TabIndex = 4;
this->button5->Text = L"button5";
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &MyForm::button5_Click);
//
// button6
//
this->button6->Location = System::Drawing::Point(152, 82);
this->button6->Name = L"button6";
this->button6->Size = System::Drawing::Size(64, 64);
this->button6->TabIndex = 5;
this->button6->Text = L"button6";
this->button6->UseVisualStyleBackColor = true;
this->button6->Click += gcnew System::EventHandler(this, &MyForm::button6_Click);
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::Black;
this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"$this.BackgroundImage")));
this->ClientSize = System::Drawing::Size(228, 157);
this->Controls->Add(this->button6);
this->Controls->Add(this->button5);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
this->Name = L"MyForm";
this->Text = L"File Opener";
this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
this->ResumeLayout(false);
}
private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
}
public: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(1);
}
public: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(2);
}
public: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(3);
}
public: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(4);
}
public: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(5);
}
public: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
Loader::loadProgram(6);
}
};
}
#pragma endregion
Again, sorry for any facepalm-worthy parts in my code or this post, as this is my first post. Any pointers/tips would be appreciated!
I was able to fix the functions already have bodies error by using PeterT's suggestion.

How do I access a disposed object?

This is where I show my form. Basically I'm editing data in a database. I get the exception at line DataGridViewRow object.
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)
{
int selectedIndex = dataGridView1->CurrentCell->RowIndex;
if (selectedIndex >= 0)
{
MessageBox::Show("selection is" + selectedIndex);
edit->Show();
try
{
DataGridViewRow ^row = this->dataGridView1->Rows[selectedIndex];
edit->itemcodetextBox->Text = row->Cells[0]->Value->ToString();
edit->itemnametextbox->Text = row->Cells[1]->Value->ToString();
edit->stockamnttextBox->Text = row->Cells[2]->Value->ToString();
edit->pricetextBox->Text = row->Cells[3]->Value->ToString();
edit->categorytextBox->Text = row->Cells[4]->Value->ToString();
}
catch (Exception^ ex)
{
MessageBox::Show(" Error Updating Data ");
}
}

Why can't I get input from the ifstream?

I am trying to read in a text file for a maze program. The input is something like:
10 10
OO+E+OO+++
O++O+O+OOO
OOOOOO+O+O
+++++O++OO
OOO+OOO+O+
O+O+O+++O+
O+O+OOO+OO
++O+++O++O
O+OOOOO++O
O+O++O+OOO
When the user click on the open button, this opens a open file dialog box
{
openFileDialog1->InitialDirectory = "C:\Desktop;";
openFileDialog1->Filter = "Maze files (*.DAT)|*.DAT";
if (openFileDialog1->ShowDialog() == ::DialogResult::OK)
{
char filename[1024];
for (int i = 0; i < openFileDialog1->FileName->Length; i++)
{
filename[i] = openFileDialog1->FileName[i];
}
ifstream ifs;
ifs.open(filename); // NULL terminate this
maze = new Maze( panel1, ifs);
ifs.close();
}
}
the following is the maze constructor
Maze::Maze( Panel ^ drawingPanel, ifstream & ifs )
{
try
{
valid = false;
ifs >> width >> height;
int temp = width;
drawingPanel->Size.Width = width;
drawingPanel->Size.Height = height;
for (int i = 0; i < height; i++) // height is always nothing
for (int j = 0; j < width; j++)
{
if (orig[j][i] == DEADEND ||
orig[j][i] == OPEN ||
orig[j][i] == EXIT )
ifs >> orig[j][i]; // NULLS????
else
throw 'D'; // i had to throw something....so i threw the D /* make a slit class and throw the D there? slit.fill(D); */
}
// this should be last
panel = drawingPanel;
valid = true;
}
catch (...)
{
valid = false;
MessageBox::Show( "Not a proper maze file!" );
}
}
when the program runs: ifs >> width >> height width and height do not get set correctly.
I have searched this site for this problem and have not been able to find anything that has helped. Sorry for my inexperience, any help is greatly appreciated.
You'e program very ugly : don't know if you're programming in C or C++ or C++/CLI, or try to mix the 3...
Because you use Windows Form projet, i will give you a .Net solution for read a file, it's not the better solution but this does not mix things.
First for read the file, on a first window :
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
openFileDialog1->Filter = "Maze Files (*.dat) | *.dat";
if (openFileDialog1->ShowDialog() == ::DialogResult::OK)
{
String ^fileName = openFileDialog1->FileName;
IO::StreamReader ^myMazeFile = gcnew IO::StreamReader(fileName);
String ^content = myMazeFile->ReadToEnd();
richTextBox1->Text = content;
myMazeFile->Close();
// display button for open second form wich draw maze
button2->Visible = true;
}
}
now we have our file content, so we pass it to a second form who will draw the maze :
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)
{
String ^content = richTextBox1->Text;
Maze ^frm = gcnew Maze(content);
frm->Show();
}
Second window, create overload constructor :
Maze(String ^contentMap)
{
InitializeComponent();
String ^dimension = getWords(contentMap, 2);
array<String ^> ^coordsString = dimension->Split(gcnew array<Char> {' '});
m_width = Convert::ToInt32(coordsString[0]);
m_height = Convert::ToInt32(coordsString[1]);
panel1->Width = m_width;
panel1->Height = m_height;
}
getWords method :
String ^getWords(String ^input, int numWords)
{
try
{
int words = numWords;
for (int i = 0; i < input->Length; ++i)
{
if (input[i] == ' ' ||input[i] == '\n')
words--;
if (words == 0)
{
return input->Substring(0, i);
}
}
}
catch (Exception ^ex)
{
// ...
}
return String::Empty;
}
You have your dimension in full .Net (private member m_width and m_height).

How can i get value from textbox?

I've started C++ 1 week ago and learnt a lot of useful things. Now i'm coding a hack for an online game. i did it like that;
DWORD ENEMY = 0x01516370; //Base address
DWORD ENEMY_OFFSET = 0x4;
void Map1Function(bool fEnable)
{
if(fEnable)
{
WritePointer(ENEMY, ENEMY_OFFSET, textbox1->Text);
}
else
{
WritePointer(ENEMY, ENEMY_OFFSET, textbox1->Text);
}
}
How can i get value from textbox ? Thanks.
My function :
#include <Windows.h>
bool WritePointer(unsigned long ulBase, int iOffset, int iValue)
{
__try { *(int*)(*(unsigned long*)ulBase + iOffset) = iValue; return true; }
__except (EXCEPTION_EXECUTE_HANDLER) { return false; }
}
But it gives that error when i do it like that ^ :
c:\users\*\documents\visual studio 2010\projects\tutorial\tutorial\Hacks.h(63): error C2065: 'textbox1' : undeclared identifier
1>c:\users\*\documents\visual studio 2010\projects\tutorial\tutorial\Hacks.h(63): error C2227: left of '->Text' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\*\documents\visual studio 2010\projects\tutorial\tutorial\Hacks.h(67): error C2065: 'textbox1' : undeclared identifier
1>c:\users\*\documents\visual studio 2010\projects\tutorial\tutorial\Hacks.h(67): error C2227: left of '->Text' must point to class/struct/union/generic type
1> type is ''unknown-type''
Full src :
#pragma once
namespace Tutorial {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::GroupBox^ groupBox1;
private: System::Windows::Forms::CheckBox^ checkBox5;
private: System::Windows::Forms::CheckBox^ checkBox4;
private: System::Windows::Forms::CheckBox^ checkBox3;
private: System::Windows::Forms::RadioButton^ radioButton3;
private: System::Windows::Forms::RadioButton^ radioButton2;
private: System::Windows::Forms::RadioButton^ radioButton1;
private: System::Windows::Forms::CheckBox^ checkBox2;
private: System::Windows::Forms::CheckBox^ checkBox1;
private: System::Windows::Forms::LinkLabel^ linkLabel1;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::CheckBox^ checkBox8;
private: System::Windows::Forms::CheckBox^ checkBox7;
private: System::Windows::Forms::CheckBox^ checkBox6;
private: System::Windows::Forms::TextBox^ textBox1;
protected:
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel());
this->label1 = (gcnew System::Windows::Forms::Label());
this->checkBox8 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox7 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox6 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox5 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox4 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox3 = (gcnew System::Windows::Forms::CheckBox());
this->radioButton3 = (gcnew System::Windows::Forms::RadioButton());
this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
this->checkBox2 = (gcnew System::Windows::Forms::CheckBox());
this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// groupBox1
//
this->groupBox1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"groupBox1.BackgroundImage")));
this->groupBox1->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom;
this->groupBox1->Controls->Add(this->textBox1);
this->groupBox1->Controls->Add(this->linkLabel1);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Controls->Add(this->checkBox8);
this->groupBox1->Controls->Add(this->checkBox7);
this->groupBox1->Controls->Add(this->checkBox6);
this->groupBox1->Controls->Add(this->checkBox5);
this->groupBox1->Controls->Add(this->checkBox4);
this->groupBox1->Controls->Add(this->checkBox3);
this->groupBox1->Controls->Add(this->radioButton3);
this->groupBox1->Controls->Add(this->radioButton2);
this->groupBox1->Controls->Add(this->radioButton1);
this->groupBox1->Controls->Add(this->checkBox2);
this->groupBox1->Controls->Add(this->checkBox1);
this->groupBox1->Location = System::Drawing::Point(0, 0);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(856, 799);
this->groupBox1->TabIndex = 0;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L"Functions";
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(115, 273);
this->textBox1->Multiline = true;
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(54, 18);
this->textBox1->TabIndex = 13;
//
// linkLabel1
//
this->linkLabel1->AutoSize = true;
this->linkLabel1->Location = System::Drawing::Point(9, 309);
this->linkLabel1->Name = L"linkLabel1";
this->linkLabel1->Size = System::Drawing::Size(114, 15);
this->linkLabel1->TabIndex = 12;
this->linkLabel1->TabStop = true;
this->linkLabel1->Text = L"www.elitepvpers.com";
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(9, 294);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(126, 15);
this->label1->TabIndex = 11;
this->label1->Text = L"Credits : SilverEmerald";
//
// checkBox8
//
this->checkBox8->AutoSize = true;
this->checkBox8->Location = System::Drawing::Point(12, 272);
this->checkBox8->Name = L"checkBox8";
this->checkBox8->Size = System::Drawing::Size(103, 19);
this->checkBox8->TabIndex = 10;
this->checkBox8->Text = L"Room Password";
this->checkBox8->UseVisualStyleBackColor = true;
this->checkBox8->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox8_CheckedChanged);
//
// checkBox7
//
this->checkBox7->AutoSize = true;
this->checkBox7->Location = System::Drawing::Point(12, 247);
this->checkBox7->Name = L"checkBox7";
this->checkBox7->Size = System::Drawing::Size(83, 19);
this->checkBox7->TabIndex = 9;
this->checkBox7->Text = L"No Gravity";
this->checkBox7->UseVisualStyleBackColor = true;
this->checkBox7->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox7_CheckedChanged);
//
// checkBox6
//
this->checkBox6->AutoSize = true;
this->checkBox6->Location = System::Drawing::Point(12, 222);
this->checkBox6->Name = L"checkBox6";
this->checkBox6->Size = System::Drawing::Size(76, 19);
this->checkBox6->TabIndex = 1;
this->checkBox6->Text = L"Cam Hack";
this->checkBox6->UseVisualStyleBackColor = true;
this->checkBox6->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox6_CheckedChanged);
//
// checkBox5
//
this->checkBox5->AutoSize = true;
this->checkBox5->Location = System::Drawing::Point(12, 197);
this->checkBox5->Name = L"checkBox5";
this->checkBox5->Size = System::Drawing::Size(85, 19);
this->checkBox5->TabIndex = 8;
this->checkBox5->Text = L"Infinite SP";
this->checkBox5->UseVisualStyleBackColor = true;
this->checkBox5->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox5_CheckedChanged);
//
// checkBox4
//
this->checkBox4->AutoSize = true;
this->checkBox4->Location = System::Drawing::Point(12, 172);
this->checkBox4->Name = L"checkBox4";
this->checkBox4->Size = System::Drawing::Size(124, 19);
this->checkBox4->TabIndex = 7;
this->checkBox4->Text = L"HP Refill / Suicide";
this->checkBox4->UseVisualStyleBackColor = true;
this->checkBox4->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox4_CheckedChanged);
//
// checkBox3
//
this->checkBox3->AutoSize = true;
this->checkBox3->Location = System::Drawing::Point(12, 147);
this->checkBox3->Name = L"checkBox3";
this->checkBox3->Size = System::Drawing::Size(163, 19);
this->checkBox3->TabIndex = 6;
this->checkBox3->Text = L"[Conquest] Frozen Enemies";
this->checkBox3->UseVisualStyleBackColor = true;
this->checkBox3->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox3_CheckedChanged);
//
// radioButton3
//
this->radioButton3->AutoSize = true;
this->radioButton3->Location = System::Drawing::Point(12, 122);
this->radioButton3->Name = L"radioButton3";
this->radioButton3->Size = System::Drawing::Size(81, 19);
this->radioButton3->TabIndex = 5;
this->radioButton3->TabStop = true;
this->radioButton3->Text = L"Deactivate";
this->radioButton3->UseVisualStyleBackColor = true;
this->radioButton3->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton3_CheckedChanged);
//
// radioButton2
//
this->radioButton2->AutoSize = true;
this->radioButton2->Location = System::Drawing::Point(12, 97);
this->radioButton2->Name = L"radioButton2";
this->radioButton2->Size = System::Drawing::Size(72, 19);
this->radioButton2->TabIndex = 4;
this->radioButton2->TabStop = true;
this->radioButton2->Text = L"HitRange";
this->radioButton2->UseVisualStyleBackColor = true;
this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton2_CheckedChanged);
//
// radioButton1
//
this->radioButton1->AutoSize = true;
this->radioButton1->Location = System::Drawing::Point(12, 72);
this->radioButton1->Name = L"radioButton1";
this->radioButton1->Size = System::Drawing::Size(79, 19);
this->radioButton1->TabIndex = 3;
this->radioButton1->TabStop = true;
this->radioButton1->Text = L"WallShoot";
this->radioButton1->UseVisualStyleBackColor = true;
this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton1_CheckedChanged);
//
// checkBox2
//
this->checkBox2->AutoSize = true;
this->checkBox2->Location = System::Drawing::Point(12, 47);
this->checkBox2->Name = L"checkBox2";
this->checkBox2->Size = System::Drawing::Size(106, 19);
this->checkBox2->TabIndex = 2;
this->checkBox2->Text = L"Design Changer";
this->checkBox2->UseVisualStyleBackColor = true;
this->checkBox2->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox2_CheckedChanged);
//
// checkBox1
//
this->checkBox1->AutoSize = true;
this->checkBox1->Location = System::Drawing::Point(12, 22);
this->checkBox1->Name = L"checkBox1";
this->checkBox1->Size = System::Drawing::Size(69, 19);
this->checkBox1->TabIndex = 1;
this->checkBox1->Text = L"No Blast";
this->checkBox1->UseVisualStyleBackColor = true;
this->checkBox1->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox1_CheckedChanged);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(7, 15);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(705, 344);
this->Controls->Add(this->groupBox1);
this->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(162)));
this->MaximizeBox = false;
this->Name = L"Form1";
this->Text = L"S4League EU In-Game Hack 23.03.14";
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox2_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void radioButton1_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox8_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void radioButton2_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void radioButton3_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox3_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox4_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox5_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox6_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void checkBox7_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
};
}
It's textBox1, not textbox1; variables are case sensitive.
Also, this won't work, you need to convert the string from the Text property to an int value. You will need this:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
int value = Convert::ToInt32(textBox1->Text);
WritePointer(ENEMY, ENEMY_OFFSET, value);
}
Notice how the textBox1 is used within the Form1 class. It is necessary because the textBox1 is private to the class.