You can use registry to pass the value
Write to registry
HKEY RegKey;
RegCreateKey(HKEY_LOCAL_MACHINE,_T("Software\\Worms"),&RegKey);
RegSetValueEx(RegKey,_T("PATH_NAME"),NULL,REG_SZ,(BYTE * const)name,MAXPATH);
Read from registry
RegOpenKey(HKEY_LOCAL_MACHINE,_T("Software\\Worms"),&RegKey)
RegQueryValueEx(RegKey,_T("PATH_NAME"),NULL,NULL,(BYTE * const)name,&vRetSize)