CreateProcess() in C

This is a discussion on CreateProcess() in C within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, am new to this community. Am trying to implement a chat Program in C (windows). where I need ...

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    5

    CreateProcess() in C

    Hi all, am new to this community. Am trying to implement a chat Program in C (windows).
    where I need both the client and the server to communicate, without waiting for a reply from the other side, like the way we chat in any messenger.
    Is there any way of accomplishing it? I tried out CreateProcess() function, but am not clear how to specify the location of the file as an argument. Can anyone help me out? If there are better techniques than CreateProcess(), then pls suggest that.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,205
    Firstly, CreateProcess() is a win32 function, not a C function. This post is in the wrong forum.

    Second, you need to focus attention on how the client and server communicate (starting with how the server accepts new client connections and how the client establishes connection to the server).

    The client should not need to start the server executing, or vice versa (which is all you can do with CreateProcess(), if you limit yourself to a scenario with client and server running on the same machine).

    The client needs to cope if it can't establish a connection to the server. Once client and server have established a connection, both need to cope with the other dropping out.
    Right 98% of the time, and don't care about the other 3%.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    5
    @Grumpy:
    In what way is your post related to my question? I could not understand, can u pls elaborate?

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    5
    I get an error code 2 if I specify the location of the file as the second parameter. AND
    I get an error code 123 if I specify the location of the file as the first parameter.

    and both these codes stand for- "THE SYSTEM COULD NOT FIND THE FILE SPECIFIED."

    So can anyone help me with the code as to how to specify the exact location of the file in the CreateProcess() function? PLS PLS.

  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    5
    The problem was with the blocking nature of the sockets. Used IOCTLSOCKET() and got it fixed!!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question about CreateProcess()
    By Riscilla in forum C++ Programming
    Replies: 2
    Last Post: 12-27-2009, 11:32 PM
  2. CreateProcess with arguments
    By Niara in forum Windows Programming
    Replies: 14
    Last Post: 09-08-2007, 05:41 AM
  3. question on CreateProcess() redirection
    By ac251404 in forum Windows Programming
    Replies: 13
    Last Post: 07-18-2006, 11:06 AM
  4. CreateProcess
    By Unregistered in forum Windows Programming
    Replies: 3
    Last Post: 05-12-2002, 06:45 AM
  5. CreateProcess()
    By Newfie in forum C++ Programming
    Replies: 2
    Last Post: 05-07-2002, 07:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21