Hi i have the following function which i want to call:
uintptr_t GetModuleBaseAddress(DWORD procId, const wchar_t* modName)
Now i want to write a support function which takes a given string and converts it to the
target parameter 'const wchar_t* modName'
I have the folloing function:
wchar_t* stringToWchar(std::string s) {
std::wstring widestr = std::wstring(s.begin(), s.end());
const wchar_t* widestr = widestr.c_str();
return widestr;
}
at the return line i get the error: "no suitable conversion function from to exists"
.
What do i miss here?
In the final result i want to make a call like:
GetModuleBaseAddress(procId, stringToWchar("module.exe"))
Thx.