1. converting MFC to Euphoria (W/O TYPOS THIS TIME)

>class camera
>{
>public:
>  camera();
>  virtual ~camera();
>  int  init(DWORD object_to_chase);
>  void move(void);
>  void zoom_out(void);
>  void zoom_in(void);
>  void    set_chase_flexible_mode(void);
>  void    set_chase_location_mode(void);
>  void stop_chasing(void);
>  void update_chase_params(void);
>  DWORD m_camera_handle;
>
>private:
>  DWORD m_object_to_chase;
>
>};
>
>and lines like these in the main program....
>
>camera1->set_chase_flexible_mode();
>
>
>Is camera1 a pointer to an instance of a structure of type camera? (did
>that make any sense?)

Almost, it's a pointer to instance of the camera-class.



>Does "camera1->set_chase_flexible_mode();" call the function and then
>somehow fill in an
>element in the structure? But how if "set_chase_flexible_mode" is a "void"
>function??

It'll probably do something with m_object_to_chase.



>What are all those functions / procedures doing in there?
>

An object's functions (also known as methods) are there to do operations on
that same object's data.

Stupid example:

class person
{
public:
person();         //constructor (called when "new" is invoked)
virtual ~person;  //destructor (called when "delete" is invoked)
void set_first(char *first);
int get_age();
private:
char first;
int age;
};

And of course you'd have to write the functions you declared, wich is done
inside of the class-definition (?).

Let P be an instance of person, then you could do something like this:

i = P.age;         //ERROR! age is a private matter :)
i = P::get_age();  // ask politely..
P::set_first("Bubba");

etc.

I hope this was right. I've done some reading on OOP earlier on, though I've
never practiced it..

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu