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

  • Home
  • SEARCH
  • 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 8471637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:50:59+00:00 2026-06-10T16:50:59+00:00

Well, I am very new at c++, so I decided to do something simple

  • 0

Well, I am very new at c++, so I decided to do something simple after a few projects that gave me a basic understanding of c++ (no, the hello world one doesn’t count), I just want to make a folder on %appdata% and I figured out I just needed to do this

void MakeFolder()
{
LPCTSTR appdata = getenv("APPDATA");
char *appchar = getenv("APPDATA");
size_t sizeApp = sizeof(appchar) + 8;
LPCTSTR folder = "/Folder";
StringCchCat(appdata, sizeApp, folder);
CreateDirectory (appdata,NULL);
}

But it says “StringCchCat: identifier not found”, I have included STDDEF.h already, and the error code doesn’t change! but I am not sure the code itself would work anyway…

  • 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-10T16:51:00+00:00Added an answer on June 10, 2026 at 4:51 pm

    StringCchCat is declared in <strsafe.h>; you need to include that header.

    But… since you are new to C++, don’t mess with C strings. Use std::string:

    char const* const raw_appdata = getenv("APPDATA");
    if (raw_appdata == nullptr)
    {
        // Handle error
    }
    
    std::string const appdata = raw_appdata;
    std::string const folder  = appdata + "\\Folder";
    
    if (CreateDirectory(appdata.c_str(), nullptr) == FALSE)
    {
        // Handle error
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I decided to implement a very simple program recursively, to see how well Java
Well, I decided that it's time to learn a new skill, programming objective-c. My
I'm very much new to programming and have been doing fairly well so far.
I'm new to python so I really don't know the language very well. the
I don't understand MEF very well, so hopefully this is a simple fix of
I've read a few other questions that seem similar but I'm still very confused,
I'm very new to JSON, and I need to parse some that an API
I understand very well the need for websites' front ends to be coded and
GCC is a very well respected multi-language compiler (from what I've gathered). One thing
Drupal has a very well-architected, jQuery -based autocomplete.js . Usually, you don't have to

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.