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

    Special folders on network

    Hi. Need some help here.

    Is it possible to find a special folder on another machine over a network?

    Currently I use SHGetSpecialFolderPath to find the All Users folder on my machine, but how can I find the All Users folder for someone else's machine (over a LAN)from a program running on mine? Can this be done?

    Basically, I need my program to write a file on someone else's machine on the network, but I don't know which directories are going to have write permissions etc, so I need to use one of the special folders (or somewhere else appropriate - any ideas?).

    Does anyone have any advice for me?

    Cheers.

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Special folders on network

    Quote Originally Posted by Jim1981
    Currently I use SHGetSpecialFolderPath to find the All Users folder on my machine, but how can I find the All Users folder for someone else's machine (over a LAN)from a program running on mine? Can this be done?
    No.
    You have to share the folder that you want on the other machine.

    Or use a client-server design.
    Make a little app (client) that runs on the other machine. Then send a message from your machine to the client (including the file data). The client can then write the file to the desired folder, because it is running on the other machine.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Mar 2003
    Posts
    53

    Re: Special folders on network

    Right, thanks Marc.

    Just thinking now about the quickest, easiest way of sorting out my problem.

    Is it possible to run an executable from my program and get a return value from it when it closes?

    I know this can't be done using WinExec, but maybe some other way?

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Special folders on network

    You can use CreateProcess, WaitForSingleObject and GetExitCodeProcess to respectively start the app, wait untill it finished and get the result code.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

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