pastebin - collaborative debugging tool
kpaste.net RSS


ffffffffffff
Posted by z0TK on Wed 15th Sep 2010 15:29
raw | new post

  1. 1>configure.cpp
  2. 1>.\configure.cpp(154) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
  3. 1>.\configure.cpp(154) : error C2146: syntax error : missing ')' before identifier 'ComputerNameDnsFullyQualified'
  4. 1>.\configure.cpp(154) : error C3861: 'GetComputerNameEx': identifier not found
  5. 1>.\configure.cpp(154) : error C2059: syntax error : ')'
  6.  
  7. void get_machine_info(char * buffer, size_t len)
  8. {
  9.         char buf[500];
  10.         char buf2[500];
  11.  
  12.         DWORD dwSize = sizeof(buf);
  13.         if (!GetComputerNameEx((COMPUTER_NAME_FORMAT)ComputerNameDnsFullyQualified, buf, &dwSize))
  14.                 sprintf(buf, "%s", "unknown");
  15.  
  16.         FILE * f = fopen("ver.txt.tmp", "r");
  17.         if (f)
  18.         {
  19.                 while (fgets(buf2, 500, f)) { }
  20.                 fclose(f);
  21.                 unlink("ver.txt.tmp");
  22.         }
  23.         else
  24.                 sprintf(buf2, "%s", "unknown");
  25.  
  26.         sprintf(buffer, "%s ", buf);
  27.         //strip newlines
  28.         char* b = buffer + strlen(buf)+1;
  29.         char *b2 = buf2;
  30.         while (*b2)
  31.         {
  32.                 if (*b2 != 10 && *b2 != 13)
  33.                 {
  34.                         *b = *b2;
  35.                         b++;
  36.                 }
  37.                 *b2++;
  38.         }
  39.         *b = 0;
  40. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at