'I need to read the memory by the string, but when I try it gives the following error

argument of type "char *" is incompatible with parameter of type "LPCWSTR"
'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UINT)': unable to convert an argument 2 of 'char [255]' to 'LPCWSTR'
type conversion': conversion from 'unsigned int' to larger size 'LPVOID'

The code I'm using is this

char buffer[255] = { 0 };
            unsigned addr = 0xb50798;
            if (ReadProcessMemory(hproc, (LPVOID)addr, &buffer, sizeof(buffer), NULL))
            {
                MessageBoxW(hwnd, buffer, NULL, NULL);
c++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source