Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C2059 and I don't see it Pin
Saurabh.Garg20-Apr-08 17:50
Saurabh.Garg20-Apr-08 17:50 
GeneralRe: C2059 and I don't see it Pin
Naveen20-Apr-08 18:10
Naveen20-Apr-08 18:10 
GeneralRe: C2059 and I don't see it Pin
charlieg22-Apr-08 14:46
charlieg22-Apr-08 14:46 
GeneralPC COM PORT Pin
@monsoon20-Apr-08 15:39
@monsoon20-Apr-08 15:39 
GeneralRe: PC COM PORT Pin
David Crow20-Apr-08 16:18
David Crow20-Apr-08 16:18 
GeneralRe: PC COM PORT Pin
@monsoon20-Apr-08 17:01
@monsoon20-Apr-08 17:01 
QuestionRe: PC COM PORT Pin
CPallini20-Apr-08 21:39
mveCPallini20-Apr-08 21:39 
Questionerror C2199 Pin
lahom20-Apr-08 13:19
lahom20-Apr-08 13:19 
hi
i used a "file type extension " article to create one of my own.
everything is going well except for the registry Key Type Constants:
when i run it , there are 18 errors of the same type which is :
error C2199: syntax error : found 'const short (' at global scope (was a declaration intended?)
please help me . this is afinal step in my graduation project
thanks in advance


/////////////////////////////////////////////////////////////////
// Windows Registry Root Key Constants.
/* const int HKEY_CLASSES_ROOT = &H80000000; */
/* const int HKEY_CURRENT_CONFIG = &H80000005 ;*/
/* const int HKEY_CURRENT_USER = &H80000001; */
/* const int HKEY_DYN_DATA = &H80000006 ;*/
/* const int HKEY_LOCAL_MACHINE = &H80000002; */
/* const int HKEY_USERS = &H80000003 ;*/

// Windows Registry Key Type Constants.

const short REG_OPTION_NON_VOLATILE =0; // Key is preserved when system is rebooted
const short REG_DWORD =4; // 32-bit number

const short REG_EXPAND_SZ =2; // Unicode nul terminated string
const short REG_SZ =1 ; // Unicode nul terminated string

const short REG_BINARY =3 ; // Free form binary

const short REG_DWORD_BIG_ENDIAN =5 ; // 32-bit number
const short REG_DWORD_LITTLE_ENDIAN =4 ; // 32-bit number (same as REG_DWORD)

// Function Error Constants.
const short ERROR_SUCCESS =0;
const short ERROR_REG =1;

// Registry Access Rights.
const int SYNCHRONIZE = &H100000;
const int READ_CONTROL = &H20000;
const int STANDARD_RIGHTS_ALL = &H1F0000;
const int STANDARD_RIGHTS_READ = (READ_CONTROL);
const int STANDARD_RIGHTS_WRITE = (READ_CONTROL);
const short KEY_QUERY_VALUE = &H1;
const short KEY_SET_VALUE = &H2;
const short KEY_CREATE_LINK = &H20;
const short KEY_CREATE_SUB_KEY = &H4;
const short KEY_ENUMERATE_SUB_KEYS = &H8;
const short KEY_NOTIFY = &H10;
const int KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE));
const int KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE));
const int KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE));
const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE));

// Windows Registry API Declarations.
// Registry API To Open A Key.
int RegOpenKeyEx /*RegOpenKeyExA*/ (int hKey, Cstring lpSubKey, int u1Options, int samDesired, int& phkResult); //"advapi32.dll"

// Registry API To Create A New Key.

int RegCreateKeyEx /*RegCreateKeyExA*/ (int hKey, CString lpSubKey, int Reserved, CString lpClass, int dwOptions, int samDesired, int lpSecurityAttributes, int& phkResult, int lpdwDisposition);//"advapi32.dll"


// Registry API To Query A String Value.
int RegQueryValueExString /*RegQueryValueExStringA */ (int hKey, CString lpValueName, int lpReserved, int& lpType, CString lpData, int& lpcbData);//"advapi32.dll" Alias "RegQueryValueExA" _

// Note that if you declare the lpData parameter as String, you must pass it By Value.

//Registry API To Query A Long (DWORD) Value.
int RegQueryValueExLong /* RegQueryValueExLongA */(int hKey, CString lpValueName, int lpReserved, int& lpType, int& lpData, int& lpcbData); //"advapi32.dll"


// Registry API To Query A NULL Value.
int RegQueryValueExNULL /* RegQueryValueExA */ (int hKey, CString lpValueName, int lpReserved, int& lpType, int lpData, int& lpcbData);//"advapi32.dll"

// Registry API To Set A String Value.
int RegSetValueExString /* RegSetValueExA */(int hKey, CString lpValueName, int Reserved, int dwType, CString lpValue, int cbData);// "advapi32.dll"

// Note that if you declare the lpData parameter as String, you must pass it By Value.

// Registry API To Set A Long (DWORD) Value.
int RegSetValueExLong /* RegSetValueExA */ (int hKey, CString lpValueName, int Reserved, int dwType, int& lpValue, int cbData);//"advapi32.dll"

// Registry API To Delete A Key.
int RegDeleteKey /* RegDeleteKeyA */ (int hKey, CString lpSubKey); //"advapi32.dll"

// Registry API To Delete A Key Value.
int RegDeleteValue /* RegDeleteValueA */ (int hKey, CString lpValueName ); //"advapi32.dll"

// Registry API To Close A Key.
int RegCloseKey (int hKey); // "advapi32.dll"

//Constants For Error Messages.
const CString OpenErr = "Error: Opening Registry Key!";
const CString DeleteErr = "Error: Deleteing Key!";
const CString CreateErr = "Error: Creating Key!";
const CString QueryErr = "Error: Querying Value!";

#endif // !defined(AFX_FILE_COMMANDS_
//////////////////////////////////////////////////

lahom
GeneralRe: error C2199 Pin
David Crow20-Apr-08 16:24
David Crow20-Apr-08 16:24 
GeneralRe: error C2199 Pin
lahom21-Apr-08 17:38
lahom21-Apr-08 17:38 
GeneralRe: error C2199 Pin
David Crow22-Apr-08 3:01
David Crow22-Apr-08 3:01 
GeneralQuick Question Setting Precision of Double Pin
DrWigglechin20-Apr-08 12:52
DrWigglechin20-Apr-08 12:52 
GeneralRe: Quick Question Setting Precision of Double Pin
Saurabh.Garg20-Apr-08 17:47
Saurabh.Garg20-Apr-08 17:47 
QuestionControl used for displaying both text,image and lnk Pin
vayanan20-Apr-08 9:32
vayanan20-Apr-08 9:32 
GeneralRe: Control used for displaying both text,image and lnk Pin
David Crow20-Apr-08 16:25
David Crow20-Apr-08 16:25 
GeneralRe: Control used for displaying both text,image and lnk Pin
Hamid_RT20-Apr-08 17:57
Hamid_RT20-Apr-08 17:57 
GeneralDirect pixel access using WinG Pin
Lord Kixdemp20-Apr-08 6:30
Lord Kixdemp20-Apr-08 6:30 
GeneralStrange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 [modified] Pin
Anthony Appleyard20-Apr-08 5:47
Anthony Appleyard20-Apr-08 5:47 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
Saurabh.Garg20-Apr-08 17:57
Saurabh.Garg20-Apr-08 17:57 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
nisha0000020-Apr-08 17:58
nisha0000020-Apr-08 17:58 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
Anthony Appleyard20-Apr-08 19:41
Anthony Appleyard20-Apr-08 19:41 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
Anthony Appleyard20-Apr-08 20:36
Anthony Appleyard20-Apr-08 20:36 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
Anthony Appleyard21-Apr-08 1:27
Anthony Appleyard21-Apr-08 1:27 
GeneralRe: Strange bug in SetPixel in Visual C++ program running under Windows Vista: only displaying if (x&256)==0 Pin
Joao Araujo21-Nov-09 12:47
Joao Araujo21-Nov-09 12:47 
GeneralDetect USB Masstorage device Pin
Xeqtr20-Apr-08 4:08
Xeqtr20-Apr-08 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.