Skip to content

Instantly share code, notes, and snippets.

@mokapyo
Created June 10, 2016 13:39
Show Gist options
  • Save mokapyo/b1acad7dbde05665082349f8985a35f6 to your computer and use it in GitHub Desktop.
Save mokapyo/b1acad7dbde05665082349f8985a35f6 to your computer and use it in GitHub Desktop.
TCHAR buf[MAX_LINE];
FILE *fp;
_tfopen_s(&fp, _T("test.reg"), _T("r"));
// Add processing -----------------
if(_fgettc(fp) == 0xff && _fgettc(fp) == 0xfe){
fclose(fp);
_tfopen_s(&fp, _T("test.reg"), _T("br"));
}
// ----------------------------------
while (_fgetts(buf, MAX_LINE, fp) != NULL) {
TCHAR *p = _tcsstr(buf, _T("{"));
if (p != NULL) {
CString Guid = p;
}
}
fclose(fp);
printf("Guid = %s",Guid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment