473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

bi directional relationship problem in visual c++ 2008

3
ok here is my problem.
i have a multi class project, there are 6 or so classes that have a 7th class referenced to, but in that 7th class i have it referenced to 1 of the first 6. this is creating problems for me and is quite hurting my brain.
here is some code:
Expand|Select|Wrap|Line Numbers
  1. #pragma once
  2. #include "player.h"
  3. ref class building :
  4. public square
  5.     {
  6.     public:
  7.         building(String^ t, int p, int hp)
  8.         {
  9.             title = t;
  10.             price = p;
  11.             hprice = hp;
  12.         }
  13.         virtual void action(player^ a) override{System::Windows::Forms::MessageBox::Show("action'd by " + title);}
  14.     private:
  15.         int price;
  16.         int hprice;
  17.     }; 
Expand|Select|Wrap|Line Numbers
  1. #pragma once
  2. ref class player
  3.     {
  4.     public:
  5.         player(void);
  6.         void buyProperty(building ^ a);
  7.     private:
  8.         int money;
  9.         int position;
  10.         int piece;
  11.         System::String^ name;
  12.         array<building ^>^ owned;
  13.     };
  14.  
i get hit with o so many errors when this starts up that begins with it not being able to find the building variable in player or the player variable in building.
any help is greatly appreciated
thanks!
Dec 4 '07 #1
3 1255
kotmfu
3
i forgot to say that i have all the stuff declared in the stdafx file aswell (as well as the form)
ive never had any trouble declaring like that before its just this one that is killing it
Dec 4 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
This looks like C#.

I am moving this to the .NET forum.
Dec 4 '07 #3
kotmfu
3
This looks like C#.

I am moving this to the .NET forum.
its c++ but it is .net
Dec 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: AlesD | last post by:
Hello, could you please help me with following problem: I have reversible container which holds (unsorted) instances of objects with common base class. From time to time I need to search for...
1
by: paakwesi | last post by:
I'm looking to modify the javascript behavior on http://research.yale.edu/%7Ekamusi/exercises/learners/index.php to do two things: Initial State: Both menus are populated with all their entries...
2
by: Rogier | last post by:
Hello, I want to make a client/server app, for a game. Where I can send object to and from the server. With this I mean the client can send an object to the server but the server can also send...
2
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
0
by: solita | last post by:
Can we create mobile appplications in visual studio? If so can somebody give me a useful link Also how can i create a desktop shortcut while deploying applications (cab files) for windows ce in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.