I've got a HANDLE declared like this:
HANDLE handle = new string("test");
How can I get the value from handle?
Something like this:
string myval = (string)handle; //Cast doesn't work
I've got a HANDLE declared like this:
HANDLE handle = new string("test");
How can I get the value from handle?
Something like this:
string myval = (string)handle; //Cast doesn't work
If HANDLE is either a void* or a string* then you can use
string myval = *(string*)handle;
or the clearer
string myval = *reinterpret_cast<string*>(handle);
If HANDLE is any other type then it's likely that the behaviour of your program is undefined.
Note that a value copy of your string will be taken.