void CGenInfoFormView::OnNewGUID() { if(MessageBox("Do you want to create a new GUID?","Test",MB_YESNO)== IDYES) { GUID guid; CoCreateGuid(&guid); LPOLESTR pstrGuid; int i = StringFromCLSID (guid, &pstrGuid); CString s(pstrGuid); int j= s.GetLength(); GetDlgItem(IDC_EBOOK_GUID)->SetWindowText(s); if (NULL != pstrGuid) CoTaskMemFree (pstrGuid); } }
{
if(MessageBox("Do you want to create a new GUID?","Test",MB_YESNO)== IDYES)
{
GUID guid;
CoCreateGuid(&guid);
LPOLESTR pstrGuid;
int i = StringFromCLSID (guid, &pstrGuid);
CString s(pstrGuid);
int j= s.GetLength();
GetDlgItem(IDC_EBOOK_GUID)->SetWindowText(s);
if (NULL != pstrGuid)
CoTaskMemFree (pstrGuid);
}
}