Why am I getting this error and how can I go about putting a string variable into the FindWindow() function?
The compiler error message is pretty clear. The FindWindow()
function expects a const char*
as second parameter, which std::string
isn't.
To get a (const
) pointer to the raw char array data managed by a std::string
instance use the c_str()
method:
FindWindow(NULL, myString.c_str());