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

Thread: Api CreateEvent

  1. #1
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    Api CreateEvent

    Could some please explain how CreateEvent works ,

    could it be used to send a signal to another process ( listening for an event) , like a command to do something.

    I got one process creates a shared Memory ( 2MB) , waits for another process to attached to that shared Memory fill it with data ( to be processed) now I wan to send a command signal to the 1st process that shared Memory is written to and can now proceed with processing that data, once done data is written back to the shared buffer command signal send to the send process to let them know that data is process and they go ahead and copy it from there.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Api CreateEvent

    Quote Originally Posted by aamir121a View Post
    Could some please explain how CreateEvent works ,

    could it be used to send a signal to another process ( listening for an event) , like a command to do something.
    Yes. it can.
    You have to create the named event.
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    Re: Api CreateEvent

    Thanks victor could you please post some example

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Api CreateEvent

    What's wrong with the MSDN example? http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Api CreateEvent

    I've created a templated class called MMFileStructT that creates a memory mapped file sized to a structure.

    The class also exposes two named events so that two processes can signal changes in the mmf data.

    See the code guru article: http://www.codeguru.com/cpp/article.php/c17975/

  6. #6
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    Re: Api CreateEvent

    Thank you all

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