1. Advice needed for converting MFC to Euphoria
------=_NextPart_000_0012_01C04CB3.89E3F990
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Everyone.
I am currently working on the new version of Morfit for Euphoria =
(Version 4.0)
It is going well. Wrappers are complete and *seem* to be bug free. I =
have
completed ports of many of the samples we didn't get around to last time =
as
well as a couple of new ones.
I am now trying to tackle some of the more complex samples. Most use MFC
unfortunately which I know *nothing* about.=20
Firstly, is MFC a version of OOP? (I know virtually nothing about OOP =
either)
Does anyone have any pointers / tips on un-OOPing C code?
Should I instead try one of the Eu OOP libraries?
As an example I have the following in an include....
class camera =20
{
public:
camera();
virtual ~camera();
int init(DWORD object_to_chase);=20
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;=20
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?)
Does "camera1->set_chase_flexible_mode();" call the function and then =
somehow fill in an=20
element in the structure? But how if "set_chase_flexible_mode" is a =
"void" function??
What are all those functions / procedures doing in there?
Any advice greatly appreciated.
=20
Thanks
=20
Mark=20
------=_NextPart_000_0012_01C04CB3.89E3F990
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Everyone.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I am currently working on the new =
version of Morfit=20
for Euphoria (Version 4.0)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>It is going well. Wrappers are complete =
and *seem*=20
to be bug free. I have</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>completed ports of many of the samples =
we didn't=20
get around to last time as</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>well as a couple of new =
ones.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I am now trying to tackle some of the =
more complex=20
samples. Most use MFC</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>unfortunately which I know *nothing*=20
about. </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Firstly, is MFC a version of OOP? =
(I know=20
virtually nothing about OOP either)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Does anyone have any pointers / tips on =
un-OOPing C=20
code?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Should I instead try one of the Eu OOP=20
libraries?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>As an example I have the following in =
an=20
include....</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>class camera =20
~camera();<BR> int init(DWORD=20
sp; =20
andle; </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>};</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>and lines like these in the main=20
program....</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Is camera1 a pointer to an instance of =
a structure=20
of type camera? (did that make any sense?)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Does "<FONT face=3DArial=20
size=3D2>camera1->set_chase_flexible_mode();" call the function and =
then=20
somehow fill in an </FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>element in the structure? But how if=20
"set_chase_flexible_mode" is a "void" function??</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>What are all those functions / =
procedures doing in=20
there?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><EM> </EM>Any advice greatly=20
appreciated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
------=_NextPart_000_0012_01C04CB3.89E3F990--
2. Re: Advice needed for converting MFC to Euphoria
>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 an instance of an camera-class *object*.
>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??
>
>What are all those functions / procedures doing in there?
>
An object's functions (also known as mehods) 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 cource 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 = 0; //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.