×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    12

    Engine instantiating the GUI in a new thread

    Hi

    I want to write a server(engine) component which will provide a UI for a very brief period to get some details entered by the user and later on after some processing is done by the engine, the GUI should be killed. The server should run in the background always hence forth without exiting.

    I am planning to get the server.exe run on installation and once this comes up, it should create another thread and have the GUI run in that. The engine will provide an interface ( mixin class ) which the GUI will implement. When the new thread is created , the GUI will be made to run in that and the engine will give the GUI a handle to call it (the engine) for passing on the user input. The engine will get a handle to the GUI and via the mixin interface, the engine will notify the user with any progress info , error info etc displayed by the GUI. During this period, the user can get buttons in teh GUI to click and interrupt the processing carried out by the engine. The GUI will use the handle to the engine to call the appropriate functions.

    After a while the engine will kill the GUI thread and hence forth run in the background.

    Please tell me, if this is a feasible solution.

    Also, I want to know how I instantiate a GUI.exe in a separate thread. As far as I know, the RThread create() provides a function to be specified which will be run in the new thread. Can I specify GUI.exe to be run in the new thread. Pls help with a sample code snippet.
    Also, I want to know how I can pass the engine handle to the GUI and get the GUI handle to the engine


    I am using Series 60 3rd edition MR SDK based on v9.1

    Please help

    Thanks
    Last edited by savvy; 2007-05-14 at 18:24.

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Engine instantiating the GUI in a new thread

    It's much more preferable (and easier) to put the ui stuff in the main thread. Otherwise, you'll need to create an active scheduler (eikon environment), etc.
    I wrote some articles about this if you're interested, see my homepage developer section.

    Why don't you explain us what you're intending to do? Probably there's an easier way to achieve what you want, without that hassle.

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    12

    Re: Engine instantiating the GUI in a new thread

    Hi

    I am having a server component which is to run continuously once it is installed. Also, it has to provide a UI to the user to initially enter some user credentials at the very beginning after it is installed . Once the user enters the username and password information, the UI has to send it to the engine and the engine will pick it up and do soem processing. While the processing is done, the engine might want to provide some progress notifications to the user via the GUI and also the GUI will provide options for the user to cancel the processing. If the user wishes to cancel, he presses the cancel button and the GUI will immediately tell the engine to stop the background processing.

    Once the processing completes, or if the user cancels it, the GUI will have no further use. So, it should be closed but the engine is expected to run in the background since it would have to do some tasks periodically.

    Currently, I am having the GUI and the engine in two seprate processes and the GUI process brings up the engine process and they talk via client server sessions. But I wanted to know if I can do the same within a single process so that memory consumed is less.



    Please let me know if there are better alternatives.

    Thanks

  4. #4
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Engine instantiating the GUI in a new thread

    The better alternative is just having the client and server in separate processes, communicating each other by means of messages. The server provides asynch function calls and the ui shows progress information meanwhile. Memory consumption compared to the single process shouldn't be a concern, specially in 3rd edition. The only drawback would be performance, but according to what you described, that shouldn't be an issue either (compared to some other real-time situation, such as sending/receiving audio frames, etc)

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    12

    Re: Engine instantiating the GUI in a new thread

    Thanks a bunch for the quick response

Similar Threads

  1. S60 SDK 3rd edition FP1 Emulator problem
    By justteam in forum Symbian Tools & SDKs
    Replies: 14
    Last Post: 2010-03-23, 08:47
  2. console app running problem
    By xcompass in forum Symbian
    Replies: 3
    Last Post: 2009-05-08, 13:26
  3. Can't change stack size of the main GUI thread?
    By acclivity in forum Symbian
    Replies: 3
    Last Post: 2006-12-01, 11:17
  4. Link errors when trying to Display bitmap
    By Bkc82 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-01-16, 22:46
  5. Replies: 0
    Last Post: 2003-05-09, 10:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×