I want to build a framework which gives some structure to the app using it. To create this structure I would like to use interfaces. The application then uses these interfaces and implements the required functions. I want to provide a clear initialization sequence for the app through the framework. Which means, specific functions are called at specific points in the framework startup code. The framework should be the main frame for the application.

struct myFramework {
        myFrameworkApp myFWApp;
}

interface myFrameworkApp {
        void init();
}

main(){
        myFramework mf = new myFramework;

        mf.myFWApp.init(); // this bombs because myFWApp is NULL
}

class myAppCode : myFrameworkApp {
        void init() {...}
}


How can I create an instance of myAppCode from within the framework code an have it call the init function? Or do I have to create a myAppCode global with a predefined name and use this symbol within the framework code?

I'm a bit lost, now to get things started from the framework and plug-in user specific application code.

--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

Reply via email to