> I am reviewing the example HTTPFormServer from Poco - Net - Samples. I would like to know how to access a global public class I have created in HTTPFormServer constructor from within the handleRequest method of class FormRequestHandler.
> Thanks in advance.
Well, not sure what you try to achieve because if you have an instance of that class that is global and public, access should be no problem?
Anyway, theer are three possibilites how you can access another class in your FormRequestHandler:
* public, global instance: really bad, don't use
* singleton pattern: Poco_Util_Application is an example for that. No public constructor, copy constructor, destructor, assignement operator. Only a static MyClass& instance method which holds in its implementation a static local variable of type Poco::SingletonHolder. This is better than the first alternative.
* Ask yourself if you really must make that class available globally. If not, keep it inside your application as a variable, and change the FormRequesthandlerFactory plus the FormRequestHandler to take as input all required values.