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

    Sample C++ code for Vista

    Wanted: Sample C++ code for Vista

    Objective: To get an existing program that works in Windows XP to work equally well under Vista. The user should be able to operate at ordinary levels of security and not as administrator.

    Background: This is a C++ program which requires the ability to read and write files and, at least on the first run, to create a subdirectory.

    Problems:
    (1) The Program Files area is effectively "Read only" under Vista.
    (2) Microsoft indicates that "virtualization" -- in which files supposedly written to the Program Files area are written elsewhere -- will be available only for an interim period. I want a permanent solution.
    (3) Current attempts to make a directory and to write files elsewhere fail.

    Requests:
    (1) Sample program manifest lines and/or a sample program manifest to support the next two items.
    (2) A worked example of C++ code that creates a subdirectory in a Windows Vista environment. [ _mkdir() works fine under Windows XP.]
    (3) A worked example of C++ code that successfully opens a file and writes to that file, again under Vista.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Sample C++ code for Vista

    You should have no problems creating a subdirectory under the current users private directory tree. Anything else requires elevated privs.

    Can you post some code that does not seem to work for you.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jun 2007
    Location
    Vercelli, Italy
    Posts
    87

    Re: Sample C++ code for Vista

    I've opened files for reading and writing with no problems, but I never tried to do it in special folders like Program Files. In "normal" directories it should be everything as usual.
    I owe Paul McKenzie a pizza.

    I am no expert; but they say I can make concepts easy to understand. That's why newbies questions are mine!!! XD

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