CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Process Class

  1. #1
    Join Date
    Mar 2005
    Posts
    4

    Unhappy Process Class

    Hi,

    I'm using the Process class to start new processes, but it seems that the Start method only starts processes if they don't already exist. If the process exists, the method returns false.

    How can I start 2 or more instances of the same application?

    Thank you
    J

  2. #2
    Join Date
    Mar 2005
    Location
    India
    Posts
    45

    Re: Process Class

    Hi,
    I m Confused why the multiple instance not running on ur pc. Coz its running on my pc. may be its useful for u.

    Code:
    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    	Process.Start("Notepad.exe")
    EndSub
    Best of Luck

    Regards
    Gurmeet

  3. #3
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Process Class

    Quote Originally Posted by jrlima
    Hi,

    I'm using the Process class to start new processes, but it seems that the Start method only starts processes if they don't already exist. If the process exists, the method returns false.

    How can I start 2 or more instances of the same application?

    Thank you
    J
    Some processes allows only one instance of them, for example Windows Media Player (wmplayer.exe). See, if this is the case with you. Starting 'notepad.exe' should work, as elaborated by code example (ss_gurmeet).
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  4. #4
    Join Date
    Mar 2005
    Posts
    4

    Re: Process Class

    In the MSDN, all overloads of Process.Start() have :

    "If the process is already running, no additional process resource is started. Instead, the existing process resource is reused and no new Process component is created"

    If this is true, how can you create more then 1 process with the same name?

  5. #5
    Join Date
    Apr 2005
    Posts
    298

    Re: Process Class

    you are confusing a process with a program

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured