Hello I'm trying to create a take a program path and put in in a registry file, but I keep on having an error. Here is the code:
#include <iostream>
#include <windows.h>
#include <winuser.h>
#include <tchar.h>
#include <limits>
using namespace std;
void reg() {
char buffer[MAX_PATH];
GetModuleFileName(NULL,buffer,sizeof(buffer));
const unsigned char Path[ MAX_PATH ] = {buffer};
::HKEY Handle_Key = 0;
::RegSetValueEx( Handle_Key, "My Directory", 0, 1, Path, sizeof Path );
};
The error I'm getting says
invalid conversion from 'char*' to 'unsigned char' [-fpermissive]
I have spent hours looking for a solution, but I can't find one.