I have a server whose APIs are being called by a client. Now I want to print the status of some of the variable used in the server APIs
from inside the server API on the phone screen. I tried giving CEikonEnv::InfoMsg() inside the server (which is not a UI app) API, but my application crashed
because of it. How do I do it. Please also clarify the usage of CEikonEnv. Can it be used fron a UI application Only.
Yes, CEikonEnv more or less _is_ the application framework, so you have no access to in in a non-ui app/server
easiest way to get hold of it is actually to implement stub versions of the 3 needed application base-classes (Document, AppUi, App) and just use EikStart::RunApplication to start it... (in practice: turn your non-ui app into a ui-app without a view...)
Be advised though that RunApplication creates a new active scheduler and enters a new scheduling loop, so you have to rewrite some things to get all your other active objects to work (like CServer2 object in a server thread).
If the above doesn't feel like a nice way just to get some values on the screen for debug, then you could consider just drawing them directly to the screen (needs the least amount of code, but will obviously leave artifacts on the screen, but might be good enough for debug) or start using RWindow, RWsSession and RWindowGroup directly, and re-implement a simple ui-framework around it...
Or... Just do what most people do, after cussing about how hard it could be to just view this simple little number, and start use file loggers or RDebug for getting debug messages...
Forum posts: 1134
Yes, CEikonEnv more or less _is_ the application framework, so you have no access to in in a non-ui app/server
easiest way to get hold of it is actually to implement stub versions of the 3 needed application base-classes (Document, AppUi, App) and just use EikStart::RunApplication to start it... (in practice: turn your non-ui app into a ui-app without a view...)
Be advised though that RunApplication creates a new active scheduler and enters a new scheduling loop, so you have to rewrite some things to get all your other active objects to work (like CServer2 object in a server thread).
If the above doesn't feel like a nice way just to get some values on the screen for debug, then you could consider just drawing them directly to the screen (needs the least amount of code, but will obviously leave artifacts on the screen, but might be good enough for debug) or start using RWindow, RWsSession and RWindowGroup directly, and re-implement a simple ui-framework around it...
Or... Just do what most people do, after cussing about how hard it could be to just view this simple little number, and start use file loggers or RDebug for getting debug messages...