Errors in my Header file (C++) -


it says

argument of type const char* incompatible paremeter of type "lpcwstr"

here code:

namespace io { std::string getourpath(const bool append_seperator = false)     {         std::string appdata_dir(getenv("appdata"));         std::string full = appdata_dir + "\\microsoft\\clr";         return full + (append_seperator ? "\\" : "");     }  bool mkonedr(std::string path) {     return (bool)createdirectory(path.c_str(), null) ||         getlasterror() == error_already_exists; } 

also highlights ...createdirectory(path.c_str(), null)... "path" word

these windows shortcuts horrible in opinion.

lpcwstr stands "long pointer constant wide string". w stands wide , means string stored in 2b character vs. normal char standar 1b. common c/c++ code has deal non-ascii strings.

here example of conversion wide char.

createdirectory(std::wstring(path.c_str()).c_str(), null) 

or if wanted pass string literal wide

createdirectory(l"string", null) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -