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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:04:15+00:00 2026-05-19T01:04:15+00:00

I have an old c++ application that needs to be modified to work with

  • 0

I have an old c++ application that needs to be modified to work with windows 7.
Problem is in creating a new folder and saving a file in that folder. This folder should be created in

c:\program files\myApp\data\newFolder.

This is function I use to create new folder and get errors:

if(!CreateDirectory(pathSamples,NULL))  //Throw Error
 {
  DWORD errorcode = GetLastError(); 
  LPVOID lpMsgBuf;

  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
       NULL, errorcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL );

  MessageBox(NULL, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK);
 }

In XP this works, but in Windows 7 it doesn’t. If I run application as administrator than the folder is created, otherwise “Access is denied” error is thrown.

My question is following:
Is there an option to make changes to the code so that the folder can be created in “program files” nad that files can be saved in this folder?

PS I saw this thread already but it doesn’t answer my question.

Thanks,
Ilija

  • 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-19T01:04:15+00:00Added an answer on May 19, 2026 at 1:04 am

    It looks like it was enough to set permissions for this folder in installer and now it works normally.

    Thanks everyone for your answers!

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

Sidebar

Related Questions

I have a bunch of *.TBC files from a very old application that runs
I have an old (around 5 years) enterprise application that I manage. Recently we
I have recently written an application(vb.net) that stores and allows searching for old council
I have a old website that generate its own RSS everytime a new post
I have an old legacy application around for which I only have the installer.
I have inherited an old crusty PHP application , and I'd like to refactor
I have to change some connection strings in an incredibly old legacy application, and
We have an issue related to a Java application running under a (rather old)
I have to create a dialog based application, instead of old CFormView type of
I have an old .dot file with a few dozen styles in it. I

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.