CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    119

    Named pipes and COM

    I have an app which has a COM interface that other developers can use to access the app and perform basic tasks. One of those tasks is saving a file. I had a request from a user who wants to pass in a named pipe for the file name instead of a path. I use a standard _open call in the main app to do the writing, so it should work automatically. However when you try calling the COM function with a named pipe the _open call returns -1 with errno set to EINVAL. If I copy the code from the main app over to the test app that creates the pipe and do the _open there it works fine, so it seems to be some sort of permission issue. Should this work? Or is there something about the app being accessed via COM that would prevent it from working? Any help or advice would be greatly appreciated.

    Dan

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Named pipes and COM

    From _open, _wopen article:

    EINVAL

    Invalid oflag or pmode argument.
    Does your server impersonate client?
    Best regards,
    Igor

  3. #3
    Join Date
    Mar 2004
    Posts
    119

    Re: Named pipes and COM

    Thanks for the help, but I figured it out. Was nothing to do with COM. My routine was checking to see if the the output file supplied existed and if it did it was deleting it before it actually started the output. Apparently when this sequence is used on a pipe it closes the pipe which is why the _open failed.

    Dan

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