I need some help fixing my singleton. I've been reading some papers about singletons all over the web but I just can't seem to get them working
So I would be glad if someone with a little experience with the singleton design pattern would please have a look at my source and try pointing out what im doing wrong.
The source might be kinda messy due to the many tests I've been doing lately and it's not all too well commented so if you see anything else in there please leave a post or two
Sorry about that..
ATM I'm having trouble finding a way to get a working pointer to my singleton. I think I'm getting the singleton declared the right way in the NewOrder.cpp but then when I try to make i pointer in the other classes of the engine it ofcourse colides. I've tried with derived classes and all other things I could think of but I think I'm just messing it more up.
So if it's posible I would appreciate if you'd check if the fundamentals of my singleton is correct.
But for some reason my VC++ just crashes without any kind of errors everytime I start it so Im trying to get my source working in Code::Blocks. Ill return as soon as I get this fixed.
You seem to be right. But I guess the real problem is I have no idea how to use my singleton outside the first class in which the singleton as declared (neworder.cpp).
My singleton is build as the ones in the papers and they never describe how to use the singleton in multiple files.
I've seen it done in IrrTrueAxis made by Spintz. But I think he uses some kind of derived classes. I've tried to dublicate his pattern but I just can't seem to get it right.
Im actually quite confused and not too sure of what im doing wrong here. Sorry.
And yes I have been working in VC++ and now Code::Blocks trying to debug my way through this.
I've gotten this error before while working with the singleton earlier on so my guess would be it has something to do with the design of the singleton.. am i far off here?
Eureka! (what a nice word )
That sure did the trick. Everything is back to normal but with the singleton pattern applied Now I can start focusing on some of the more fun part of the programming
Thank you both of you!
Nope not really
It's just that I'm used to program small utilities in Visual Basic so classes, pointers and design patterns are totally new to me. This is like a whole new world to me