×

Discussion Board

Results 1 to 15 of 15

Threaded View

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    Exclamation TFindProcess - unbelievable

    Its been three days I am struggling for mere 4-5 lines of code. Can anyone from you tell me why the following code behaves so strangely:


    Code:
    	//    CConsoleBase* console = Console::NewL(_L("test"), TSize(KDefaultConsWidth, KDefaultConsHeight));
    
    	_LIT(KProcessName,"myprocess*");
    
    	TFindProcess find(KProcessName);
    	TFullName name;
    	TInt numProcess = 0;
    
    	while (find.Next(name) == KErrNone)
    	{
    		numProcess++;
    	}
    
    	if(numProcess==0)
    	{
    		// process is not running
    	}
    In the above code, numProcess++ is always called as the code progresses through the while condition block. But numProcess++ should not be called because myprocess.exe is not running.

    If I add the following line at the start of the code then it never goes to the while loop and numProcess++ is not called.

    // CConsoleBase* console = Console::NewL(_L("test"), TSize(KDefaultConsWidth, KDefaultConsHeight));


    HOW CAN THIS BE POSSIBLE ????

    Please try it yourself and you will be amazed!!!
    Last edited by say2paul; 2008-09-18 at 13:03.

Similar Threads

  1. TFindProcess and RProcess in E32Main problem
    By Yotamix in forum Symbian
    Replies: 2
    Last Post: 2008-09-10, 11:24
  2. Replies: 1
    Last Post: 2007-07-06, 12:42
  3. Unbelievable Bug in 6600!
    By vishwas_dot_h in forum Mobile Java General
    Replies: 1
    Last Post: 2004-06-03, 13:53
  4. Unbelievable...
    By lebrowski in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-07-07, 09:25

Posting Permissions

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