Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:37:08+00:00 2026-06-13T19:37:08+00:00

In my C++/WinAPI application I get the My Documents folder path using this code:

  • 0

In my C++/WinAPI application I get the My Documents folder path using this code:

wchar_t path[MAX_PATH];
SHGetFolderPathW(NULL,CSIDL_PERSONAL,NULL,SHGFP_TYPE_CURRENT,path);

One of the users runs my program on a pc connected to his corporate network. He has the My Documents folder on a network. So my code returns something like
\\paq\user.name$\My Documents
Though he says he has a local copy of My Documents.
The problem is that when he ‘swaps VPN’, the online My Documents becomes unavailable and my program crashes with the system error code 64 “The specified network name is no longer available” ( it tries to write to the file opened in the online my docs folder).

How can I always get the local My Documents folder path using C++/WinAPI?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:37:09+00:00Added an answer on June 13, 2026 at 7:37 pm

    CSIDL_PERSONAL is the only official “My Documents” folder. If he redirected that to a network folder, then even Windows would not be able to access “My Documents” when off the VPN. Unlike the various AppData folders (CSIDL_APPDATA, CSIDL_COMMON_APPDATA, and CSIDL_LOCAL_APPDATA), Windows has no concept of separate local and remote “My Documents” folders, so whatever local folder he has would have had to been created manually as a normal folder, and thus the Shell API would not know about it. The only way your app will find it is to ask him where it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C++ WinAPI application I open the file using this code CreateFileW(path,FILE_APPEND_DATA,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); While the
I'm writing a Win32 application using plain C and WinAPI. No MFC or C++
I want to use WinApi function ComboBox_SetCurSel in my C# application. For this purpose
Here is my situation. I'm creating a drawing application using OpenGL and WinAPI. My
I'm writing a Windows CE application in C++ directly applying the WINAPI. In this
I am writing an application where I get sound data using low-latency ASIO card.
I wrote a simple WinAPI application in C++ which embeds the Abode Flash ActiveX
This typedef: typedef DWORD WINAPI (* CM_Open_DevNode_Key)(DWORD, DWORD, DWORD, DWORD, PHKEY, DWORD); compiles fine
I'm using WinApi. Is SendMessage/PostMessage a good, thread safe method of communicating with the
I'm using the WinAPI to set the time zone on a Windows XP SP3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.