This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Referencing members of the MyGame class from a separate CPP?


Referencing members of the MyGame class from a separate CPP?

Postby Conan » Sep 25, 2002 @ 3:17pm

Can anyone tell me how to access the MyGame class variables etc from a separate .cpp file.

I can declare a prototype for a function within the MyGame class and so long as the function is placed in the same .cpp file outwith the class everything builds fine but when I move the function body into a separate .cpp which includes
using namespace Frog; and
#include <PocketFrog.h>
I get undeclared identifiers etc etc

None of my C++ books nor 2 hours searching web C++ resources tells me how to do this but it's obviously required to write a big program as I can't have everything on one source nor do I want to have to pass values as function parameters all the time.

In C you just have function prototypes and includes & everything works but there's something I'm missing with C++.
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Guest » Sep 25, 2002 @ 4:13pm

Guest
 


Postby Mr.Prayer » Sep 25, 2002 @ 4:17pm

User avatar
Mr.Prayer
pm Member
 
Posts: 25
Joined: Jul 4, 2002 @ 5:13pm


Postby Kzinti » Sep 25, 2002 @ 5:12pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Thanks for the help Mr Prayer & Kzinti

Postby Conan » Sep 25, 2002 @ 6:57pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Kzinti » Sep 25, 2002 @ 7:07pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Great, that works fine !!!!

Postby Conan » Sep 25, 2002 @ 7:49pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Great, that works fine !!!!

Postby Mr.Prayer » Sep 25, 2002 @ 7:58pm

User avatar
Mr.Prayer
pm Member
 
Posts: 25
Joined: Jul 4, 2002 @ 5:13pm


Sorry Mr Prayer

Postby Conan » Sep 25, 2002 @ 8:34pm

And they (r y) are not even together on the keyboard, well I have been typing all day and my eyes are sore.

Happy coding
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

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 post attachments in this forum

cron