Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ CODE.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Thu Dec 16, 2010 6:38 pm    Post subject: Re: C++ CODE. Reply with quote

Shrooms wrote:
If anyone knows how to code in vc++, here is my question.

You have on your form called (Main) a pictureBox.

You click this pictureBox and it opens a second form called (General).

Back on the form (Main) that same picture box we clicked is displaying a picture.

Right when you clicked it to open the General form, I want it to switch to a new picture.

How can this be done?





I have decided to do this in my Main.h;

Code:
private: System::Void pictureBox10_Click(System::Object^ sender, System::EventArgs^ e) {
general->Visible = true;
if(general->Visible == true)
{
Main->pictureBox10->ImageLocation = "http://localhostr.com/files/yI6Yoct/general-icon.png";
}
else
{
Main->pictureBox10->ImageLocation = "http://localhostr.com/files/4RMoB8y/box-icon.png";
}
}
here are the errors;


1>c:\users\*****\documents\visual studio 2010\projects\*****\*************\****\Main.h(484) : error C2143: syntax error : missing ';' before '->'

1>c:\users\*****\documents\visual studio 2010\projects\*****\*************\****\Main.h(484) : error C2143: syntax error : missing ';' before '->'

1>c:\users\*****\documents\visual studio 2010\projects\*****\*************\****\Main.h(488) : error C2143: syntax error : missing ';' before '->'

1>c:\users\*****\documents\visual studio 2010\projects\*****\*************\****\Main.h(488) : error C2143: syntax error : missing ';' before '->'

I put the headers for general and those errors reflect back to the code with the url


shouldn't it be like this?

Code:

private: System::Void pictureBox10_Click(System::Object^  sender, System::EventArgs^  e) {
         general.Visible = true;
   if(general.Visible == true)
    {
      Main.pictureBox10.ImageLocation = "http://localhostr.com/files/yI6Yoct/general-icon.png";
   }
   else
   {
      Main.pictureBox10.ImageLocation = "http://localhostr.com/files/4RMoB8y/box-icon.png";
   }
       }
Back to top
View user's profile Send private message MSN Messenger
Up2Admin
I'm a spammer
Reputation: 126

Joined: 17 Oct 2007
Posts: 6548
Location: Texas

PostPosted: Thu Dec 16, 2010 7:05 pm    Post subject: Reply with quote

Visual C++?
_________________
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Thu Dec 16, 2010 7:10 pm    Post subject: Reply with quote

Shrooms wrote:
I will try that now!

Edit: GoGoodr, that code does not work, gives a lot of errors.

care to post the errors?
--- forget it. I forget every single thing I knew about C++ after being so much time with C#

ugh: I'm trying again

btw: shouldn't you be doing this in your .cpp instead of the header file?

Quote:
private: System::Void pictureBox10_Click(System::Object^ sender, System::EventArgs^ e) {
general->Visible = true;
if(general->Visible == true)
{
pictureBox10->ImageLocation = "http://localhostr.com/files/yI6Yoct/general-icon.png";
}
else
{
pictureBox10->ImageLocation = "http://localhostr.com/files/4RMoB8y/box-icon.png";
}
}


Last edited by gogodr on Thu Dec 16, 2010 7:48 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
407
Master Cheater
Reputation: 0

Joined: 25 Oct 2007
Posts: 357

PostPosted: Thu Dec 16, 2010 7:41 pm    Post subject: Reply with quote

You're missing a
Code:
;
Back to top
View user's profile Send private message
Crinchy
Expert Cheater
Reputation: 0

Joined: 27 Dec 2008
Posts: 193

PostPosted: Thu Dec 16, 2010 7:51 pm    Post subject: Reply with quote

It should be
Code:
[Shroom's gay]

_________________
When life throws bricks at you, throw bananas right back at it!
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Dec 16, 2010 8:18 pm    Post subject: Reply with quote

Visual C++

OH MAH GOD
Back to top
View user's profile Send private message MSN Messenger
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Thu Dec 16, 2010 11:19 pm    Post subject: Reply with quote

Shrooms wrote:
gogodr wrote:
Shrooms wrote:
I will try that now!

Edit: GoGoodr, that code does not work, gives a lot of errors.

care to post the errors?
--- forget it. I forget every single thing I knew about C++ after being so much time with C#

ugh: I'm trying again

btw: shouldn't you be doing this in your .cpp instead of the header file?

Quote:
private: System::Void pictureBox10_Click(System::Object^ sender, System::EventArgs^ e) {
general->Visible = true;
if(general->Visible == true)
{
pictureBox10->ImageLocation = "http://localhostr.com/files/yI6Yoct/general-icon.png";
}
else
{
pictureBox10->ImageLocation = "http://localhostr.com/files/4RMoB8y/box-icon.png";
}
}


ILUV U!!!

I am doing in .h as general is not declared in .cpp and I dun know how to declare in cpp.

well if it works fine then it is ok
Back to top
View user's profile Send private message MSN Messenger
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Dec 17, 2010 7:01 am    Post subject: Reply with quote

You use the .h file to define what functions and given parameters are used in the .cpp file. You include the .h file in the cpp file, create a function using

NAMEOFCLASS::myHeaderFunction(PARA1, PARA2) {

return STUFFHERE;

}

Also, you forgot a ; somewhere. Syntax errors; the number one cause of compiling errors.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites