   The Singleton vs The DLL
  I have a video subsystem that is normally accessed by the GetInstance() on the singleton. When however I try to call this from the DirectInput DLL to get the hwnd I spawn a new copy of the video class. Anyone know a way around this? I would prefer a method where the DirectInput DLL can...''request'' the information it needs rather than having to be toldMany thanks    Chris Brodiehttp:\\fourth.flipcode.com
  That''s odd.I''m going to suggest a few things, I can''t really tell what''s wrong without seeing your code.First off, it''s common practice to make singleton constructors private so you get a warning if you''re accidentally spawning new copies.Second:  Do you have a member variable used for instance counting?  It''s relatively common to keep one, and when your first GetInstance is called to spawn an instance, and from then on just return the pointer, as indicated by the reference count.You must always use pointers when messing with your singleton.  If you don''t use a pointer, then it will attempt to construct one for you.  If you use a pointer and use "new" with it, it will attempt to construct one for you.  Use a pointer, and use GetInstance to get the singleton... though for added usability, I often macro it like this in the singleton''s header:#define SINGLETON CSingleton::GetInstance();then use it with SINGLETON->DoSomething();Does any of that help?-fel  