you cant call it like that. Your trying to call a non-static functions as if its a static function. A static function is a function you can call without creating the object, a non-static function needs the object to be created first.
You can't return a 0 from NewApplication, you need to to create the app and return a pointer to it. The symbian framework takes it from there, and calls your pointer. In NewApplication() you can't really do much as your application isn't created yet (UI wise, which includes the view arch). Most applications consist of a really small NewApplication(). Here is what it usually is.
The symbian framework takes this and calls CreateDocumentL() from this pointer, which should return a pointer to the newly created document object, which in turns calls the CreateAppUiL() creating your base symbian framework.
EXPORT_C CApaApplication* NewApplication()
return new Myviewapp;
Now there should be no reason you require your code in the NewApplication() function, if you want your code to do something at startup, put it in the ConstructL function of your MyviewappUI section.