Makkedah

Members
  • Content count

    22
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Makkedah

  • Rank
    Member
  1. It used to be that in Visual C++.NET 2003 I could declare a static function or variable in the following manner: public __gc class Game { public: static int location; static void SaveGame(); }; But now in 2005: class Game { public: static int date; }; Gives me the following errors: Error 9 error LNK2020: unresolved token (0A000290) "public: static int Game::date" (?date@Game@@2HA) Game.obj Error 10 error LNK2001: unresolved external symbol "public: static int Game::date" (?date@Game@@2HA) Game.obj The only difference that I can see is that I use the managed C++ for the working version, but I didn't think that would make any difference. If it does, then I'm in trouble, because I can't get that to work in 2005 either. What should I do?
  2. I've been using Visual C++.NET 2003 for over a year, but now that I'm in college my teacher wants me to switch to 2005. The main problem that I have encountered in switching is that I create a windows form, but it won't compile because it cannot find the System namespace. I'm sure this is an easy fix, I just can't find it. Edit: The problem was that I had to enable the Common Language Runtime libraries in the project properties. [Edited by - Makkedah on September 24, 2006 10:51:09 AM]
  3. Alternative to serialization?

    I hope this is enough info... BinaryFormatter *formatter = new BinaryFormatter(); String *filename = S"Monsters.mon"; FileStream *output = new FileStream(filename, FileMode::OpenOrCreate, FileAccess::Write); formatter->Serialize(output, monstercopylist); output->Close(); Also, I'm using Visual C++.net 2003.
  4. I have been using serialization to save and load save states for my game. Now I want to start loading monster, skill, and item data from files, but I am using a different program to create those files. Thus, whenever I try to deserialize these files I get an error. I have really liked serialization until this came along, so it would be great if there was something that I could do make the serialization work. If not, what would be a good alternative that would allow me to do this?
  5. Alright, the forward declarations were the problem. I wasn't being specific enough when I tried them before. Thanks!
  6. So I have lots of class declarations that should each be a file in itself, but instead they are all combined together in the same big header file. This is so, because whenever they have their own header files, they say that the classes in the big header file are undefined, even though I #include the header. How can I seperate these class declarations? I'm using Visual C++.NET 2003.
  7. Quick Windows form question

    Awesome, thank you! Works wonderfully.
  8. Basically, I'm going to have one form show another form, and I will need the second form to return the selected index of its list box to the first form. Is there a way to do this? And if so, how?
  9. Actually, now my error is that the gengame namespace does not exist. I use it in several other files, I don't understand why this one is any different except perhaps because it is in a namespace as well. Any ideas about this? [Edited by - Makkedah on March 21, 2006 5:47:03 PM]
  10. I don't really know how much to post... #pragma once #using <mscorlib.dll> #include "Gengame1point2.h"//Header in which the Character class is defined. using namespace System; namespace skillspace { [Serializable] public __gc class Skill { public: static void effect1(Character*); } } in the Skill function definition file: void Skill::effect1(Character* opponent) { } And the character class: #pragma once #using <mscorlib.dll> using namespace skillspace; using namespace itemspace; using namespace System; namespace gengame { __gc class Character { //class members here }; }
  11. I've defined a class named Character, and I have another class called Skill. In one method of class skill, I want to pass two Character pointers to a method called Effect1. I tried doing it the same way as I might with a String pointer: void effect1(Character*); I have included the header that defines the Character class in the Skill header, but it keeps giving me the error that Identifier Character could not be found. I'm using Visual C++ .net. [Edited by - Makkedah on March 22, 2006 10:10:55 AM]
  12. Global pointers to objects?

    Sorry, I'm still clueless. What is a wrapper? And I tried integrating the example code, using my own classes, objects, and pointer names, with my current code to no avail. Let's see if I can expound further. I have a class called Character, and I want to make a pointer to an object that I create with this class, an object whose methods will be accessible to all the files of the project.
  13. Global pointers to objects?

    Sorry, I'm really quite a noob as far as pointers and objects are concerned. Could this be explained a little more in detail? I don't really understand any of the part under the class myObject, and I don't know anything about a shared_ptr (other than the obvious).
  14. I'm making an extremely basic RPG in windows. Basically what I decided that I needed to do was find a way to make the main character data global. I assumed that this would mean having a global pointer, but I don't know where to put this global pointer, or if it is even possible to make a global pointer to an object. I'm certainly not convicted that this is the right way to do it, so if there are any better suggestions for how to make methods from several different classes access data from the same object, I am quite open to them.
  15. Multi-dimensional vectors

    Alright thanks! That works, but now my curiosity has been piqued and I want to make sure that it is possible to use vectors to achieve my ends.