I'm trying to make a game of battleship that uses a windows Form created with visual studio 2008. but I think i'm running into a lot of problems from trying to combine this form with what I would consider “normal” C++ code.
I think it's due to the fact that the form is managed by CLR, whereas my other code is not.
I've noticed when I try to create objects in the form based on classes that arn't managed it says mixed types are not allowed, a c4368 error. It goes away if I make the object a pointer to that type however.
But i've now decided to try making only a single object that's unmanaged in my form, a main game controller (MGC) class. That object will contain both the player objects, and methods to act on the players like place their ships or check for hits/misses, etc...
about the only thing being passed between the form and this MGC object will be a few integers, representing what the row and column were of the cell they clicked on.
Then all of my un-managed logic can unwind within the bowels of this object.
Will this work, or am I doing something extremely dumb?
Should I make the MGC object a “managed” C++ class, and then have it use the other classes, or try and make all of those other objects “managed” as well?