title: Creating a single object of class to be used in other class during library use
body: <p>I have a DLL which has a lot of objects doing all sorts of things, and all these objects should have their unique identifying number. Now, I need to implement a class, and one object of this class will generate unique numbers. Unique numbers are needed on object creation (object <code>file_with_unique_number</code> in its constructor calls object <code>generator</code> and gets a unique number)    </p>
  
  <p>When and where in program is it best to create this object? How should all these <code>file</code> objects communicate with <code>generator</code>? I don't want to pass a pointer to <code>generator</code> each time I create a <code>file</code>, and from what I've heard using global variables is instant death penalty</p>