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 4036330
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:12:35+00:00 2026-05-20T12:12:35+00:00

I am not able to see mounted drive using WNetAddConnection2W in Windows Service written

  • 0

I am not able to see mounted drive using WNetAddConnection2W in Windows Service written in VC++

When i debug the service it returns success but when i open explorer to see that mounted drive it is not there.
I am doing this in Windows service where my service is running in administartor previliages.
My code looks like :

    lpNetResource->lpRemoteName = L"\\\\172.24.18.240\\praveena\\CIFS";
    lpNetResource->lpLocalName = L"Z:"; 
dwRetVal = WNetAddConnection2W(lpNetResource, wcpPassword, wcpUserName, CONNECT_UPDATE_RECENT); 

When i use the same code in MFC Application it works fine.

Any help is appreciated.

  • 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-05-20T12:12:36+00:00Added an answer on May 20, 2026 at 12:12 pm

    When the drive is added or removed in another session (as it happens in case of Windows services), Explorer doesn’t have a way to know about this.

    To solve this problem in our Callback File System library, which creates virtual drives (and users do this from services), we have implemented a special shell extension DLL.
    This DLL listens to signals sent by the user-mode code which performs disk creation (and which is executed in service context). When the DLL receives the signal, it broadcasts WM_DEVICECHANGE system message. Then Explorer catches this message and rescans device list.

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

Sidebar

Related Questions

I was not able to reference a specific class method using the doxygen @see
I am using VS2008,I can not able to see the asp:silverlight (to embed my
It's something very obvious but I am not able to see it despite looking
I have make 1 animation in cocos2d game, but not able to see that
I am using the Xcode 4.2. I did not able to see any method
I am wondering why I am not able to see class properties when using
am not able see any of jaxb classes generated from my xsd using jaxb2-maven-plugin
I am trying to create a report but I am not able to see
I'm using DBVisualizer with against my shared hosting database. I'm not able to see
i am not able to see where i am going wrong with my xpath

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.