what do you do to make createfilea winapi function work in this form?

Simply concatenate the two std::strings into a new std::string, and then use its c_str() method, eg:

std::string Path = ...;
std::string username = ...;
std::string fullpath = Path + username;

HANDLE file{ CreateFileA(fullpath.c_str(), ...) };

Or simply:

std::string Path = ...;
std::string username = ...;

HANDLE file{ CreateFileA((Path + username).c_str(), ...) };

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top