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 


Visual C++ 2008 adding a function to a class?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NuclearPowered
Master Cheater
Reputation: 0

Joined: 30 Dec 2007
Posts: 345

PostPosted: Sat Feb 09, 2008 4:43 pm    Post subject: Visual C++ 2008 adding a function to a class? Reply with quote

I'm following this tutorial to learn how to execute code when pressing a button and writing the output to a text box (handy for making a memory trainer Very Happy)

One problem tough, the guide tells me to add a function to the Form1 class by right clicking the class in class view, then clicking add and then add function, but there is no Add option!

I checked MSDN and they also tell me to add it that way but I can;t find it!
I added a SS



The guide Im following:
http://www.functionx.com/vcnet/applications/danilopizza.htm



Naamloos.png
 Description:
 Filesize:  110.85 KB
 Viewed:  2123 Time(s)

Naamloos.png


Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Sat Feb 09, 2008 6:53 pm    Post subject: Reply with quote

I don't think you can do it with the express edition. I have the professional edition and never used the express edition, so I can't tell you with certainty. You can still add a function without doing it that way. What you do is:
1. Go into solution explorer
2. right click form1.h -> view code
3. add the function under
Code:
public ref class Form1 : public System::Windows::Forms::Form

You'll have a choice on this. You can put it under public, protected, or private
Back to top
View user's profile Send private message
kittonkicker
I post too much
Reputation: 1

Joined: 19 Apr 2006
Posts: 2171

PostPosted: Sat Feb 09, 2008 10:21 pm    Post subject: Reply with quote

Why not just add the function to the class manually?

It's pretty simple:

Code:
class CClass {
         public:
             CClass();
             ~CClass();
             int somevariable;
             void myfunction(int param, char* param2);
}


Then define the function's body like:

Code:
void CClass::myfunction(int param,char* param2)
{
     dosomethinghere;
}
Back to top
View user's profile Send private message
NuclearPowered
Master Cheater
Reputation: 0

Joined: 30 Dec 2007
Posts: 345

PostPosted: Sun Feb 10, 2008 5:05 am    Post subject: Reply with quote

I download visual studio 2008 professional and there's an Add button there Very Happy

Kik0r I'll try your manual method aswell,

Thanks for helping guys Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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