Click here to Skip to main content
15,926,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: text color Pin
Ryan Binns7-Mar-05 20:31
Ryan Binns7-Mar-05 20:31 
GeneralUsing FindWindow in ISAPI Pin
arponjude7-Mar-05 19:18
arponjude7-Mar-05 19:18 
GeneralRe: Using FindWindow in ISAPI Pin
arponjude7-Mar-05 22:04
arponjude7-Mar-05 22:04 
GeneralISAPI and VC++ Client [downloading and uploading of file] Pin
arponjude7-Mar-05 19:06
arponjude7-Mar-05 19:06 
GeneralMultiline Textbox Pin
Anand for every one7-Mar-05 18:40
Anand for every one7-Mar-05 18:40 
GeneralRe: Multiline Textbox Pin
PJ Arends7-Mar-05 18:46
professionalPJ Arends7-Mar-05 18:46 
GeneralRe: Multiline Textbox Pin
ThatsAlok7-Mar-05 18:57
ThatsAlok7-Mar-05 18:57 
QuestionSample from MSDN, Is this correct? Pin
eight7-Mar-05 17:45
eight7-Mar-05 17:45 
Hi. i'm trying to understand event logging. I got this sample function from MSDN on adding source into the registry. Is this code correct? It's hard to learn something when the sample is incorrect. Thanks

<br />
BOOL AddEventSource(<br />
   LPTSTR pszLogName, // Application log or a custom log<br />
   LPTSTR pszSrcName, // event source name<br />
   LPTSTR pszMsgDLL,  // path for message DLL<br />
   DWORD  dwNum)      // number of categories<br />
{<br />
   HKEY hk; <br />
   DWORD dwData, dwDisp; <br />
   TCHAR szBuf[MAX_PATH]; <br />
<br />
   // Create the event source as a subkey of the log. <br />
 <br />
   wsprintf(szBuf, <br />
      "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s",<br />
<br />
//Shouldn't it be "%SYSTEM%"?<br />
      pszLogName, pszSrcName); <br />
 <br />
   if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szBuf, <br />
          0, NULL, REG_OPTION_NON_VOLATILE,<br />
          KEY_WRITE, NULL, &hk, &dwDisp)) <br />
   {<br />
      printf("Could not create the registry key.");<br />
// Why do we need to record an error message if it's true? <br />
      return FALSE;<br />
   }<br />
 <br />
   // Set the name of the message file. <br />
 <br />
   if (RegSetValueEx(hk,              // subkey handle <br />
           "EventMessageFile",        // value name <br />
           0,                         // must be zero <br />
           REG_EXPAND_SZ,             // value type <br />
           (LPBYTE) pszMsgDLL,        // pointer to value data <br />
           (DWORD) lstrlen(pszMsgDLL)+1)) // length of value data <br />
   {<br />
      printf("Could not set the event message file."); <br />
      return FALSE;<br />
   }<br />
 <br />
   // Set the supported event types. <br />
 <br />
   dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | <br />
        EVENTLOG_INFORMATION_TYPE; <br />
 <br />
   if (RegSetValueEx(hk,      // subkey handle <br />
           "TypesSupported",  // value name <br />
           0,                 // must be zero <br />
           REG_DWORD,         // value type <br />
           (LPBYTE) &dwData,  // pointer to value data <br />
           sizeof(DWORD)))    // length of value data <br />
   {<br />
      printf("Could not set the supported types."); <br />
      return FALSE;<br />
   }<br />
 <br />
   // Set the category message file and number of categories.<br />
<br />
   if (RegSetValueEx(hk,              // subkey handle <br />
           "CategoryMessageFile",     // value name <br />
           0,                         // must be zero <br />
           REG_EXPAND_SZ,             // value type <br />
           (LPBYTE) pszMsgDLL,        // pointer to value data <br />
           (DWORD) lstrlen(pszMsgDLL)+1)) // length of value data <br />
   {<br />
      printf("Could not set the category message file."); <br />
      return FALSE;<br />
   }<br />
 <br />
   if (RegSetValueEx(hk,      // subkey handle <br />
           "CategoryCount",   // value name <br />
           0,                 // must be zero <br />
           REG_DWORD,         // value type <br />
           (LPBYTE) &dwNum,   // pointer to value data <br />
           sizeof(DWORD)))    // length of value data <br />
   {<br />
      printf("Could not set the category count."); <br />
      return FALSE;<br />
   }<br />
<br />
   RegCloseKey(hk); <br />
   return TRUE;<br />
}<br />


From : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/adding_a_source_to_the_registry.asp
QuestionMDI CScrollView? Pin
murali_utr7-Mar-05 16:57
murali_utr7-Mar-05 16:57 
GeneralProblem of Getting image from a window Pin
kokehqyu7-Mar-05 16:05
kokehqyu7-Mar-05 16:05 
GeneralRe: Problem of Getting image from a window Pin
Christian Graus7-Mar-05 17:11
protectorChristian Graus7-Mar-05 17:11 
GeneralRe: Problem of Getting image from a window Pin
kokehqyu8-Mar-05 17:41
kokehqyu8-Mar-05 17:41 
GeneralUsing msado15.dll in VC++ Application Which build DLL ! Pin
lucdt7-Mar-05 13:46
lucdt7-Mar-05 13:46 
GeneralRe: Using msado15.dll in VC++ Application Which build DLL ! Pin
Serge Krynine7-Mar-05 16:02
Serge Krynine7-Mar-05 16:02 
GeneralRe: Using msado15.dll in VC++ Application Which build DLL ! Pin
lucdt7-Mar-05 16:09
lucdt7-Mar-05 16:09 
Question&quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 12:08
Axonn Echysttas7-Mar-05 12:08 
AnswerRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Blake Miller7-Mar-05 12:30
Blake Miller7-Mar-05 12:30 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 20:51
Axonn Echysttas7-Mar-05 20:51 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 21:19
Axonn Echysttas7-Mar-05 21:19 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok7-Mar-05 22:39
ThatsAlok7-Mar-05 22:39 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Anonymous7-Mar-05 23:21
Anonymous7-Mar-05 23:21 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok7-Mar-05 23:37
ThatsAlok7-Mar-05 23:37 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas8-Mar-05 3:37
Axonn Echysttas8-Mar-05 3:37 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok8-Mar-05 18:48
ThatsAlok8-Mar-05 18:48 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas9-Mar-05 1:54
Axonn Echysttas9-Mar-05 1:54 

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.