Click here to Skip to main content
16,019,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Scanf problem [modified] Pin
Aescleal27-Jul-10 21:49
Aescleal27-Jul-10 21:49 
GeneralRe: Scanf problem Pin
sagargulhane28-Jul-10 23:23
sagargulhane28-Jul-10 23:23 
AnswerRe: Scanf problem Pin
«_Superman_»27-Jul-10 22:31
professional«_Superman_»27-Jul-10 22:31 
Questionpdb VC++ Pin
VVVimal27-Jul-10 19:47
VVVimal27-Jul-10 19:47 
AnswerRe: pdb VC++ Pin
Sauro Viti27-Jul-10 20:52
professionalSauro Viti27-Jul-10 20:52 
AnswerRe: pdb VC++ Pin
ARopo28-Jul-10 6:22
ARopo28-Jul-10 6:22 
AnswerRe: pdb VC++ Pin
Abhi Lahare30-Jul-10 8:20
Abhi Lahare30-Jul-10 8:20 
Questiona prob with HKEY Pin
Krauze27-Jul-10 16:18
Krauze27-Jul-10 16:18 
BOOL checkExistence(HKEY *hKey, LPCTSTR lpszAppName)
{
	CRegKey regKey;
	
	if( regKey.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
					KEY_READ) != ERROR_SUCCESS )
		return FALSE;

	DWORD dwIndex = 0;
	DWORD cbName  = 128;
	TCHAR szSubkeyName[128];

	CString strSubkeyName;

	int nHasAllItems = 0;

	while( regKey.EnumKey(dwIndex, szSubkeyName, &cbName) != ERROR_NO_MORE_ITEMS )
	{
		dwIndex++;
		cbName = 128;

		// TCHAR->CString
		strSubkeyName.Format(_T("%s"), szSubkeyName);
		if( strSubkeyName.Compare(lpszAppName) )
		{
			nHasAllItems++;
			continue;
		}
		else
			break;
	}

	regKey.Close();
	
	if( nHasAllItems == dwIndex )
		return FALSE;
	else
	{
		*hKey = regKey.m_hKey;// this causes debug assertion failure:m_hKey!=0
		return TRUE;
	}
}

I wrote this funx to check whether there's a particular installed app in the registry. After calling this funx, hKey is expected to be assigned the registry handle. But prob occurs as Ive indicated above.
QuestionRe: a prob with HKEY Pin
David Crow27-Jul-10 17:13
David Crow27-Jul-10 17:13 
AnswerRe: a prob with HKEY Pin
Krauze27-Jul-10 17:49
Krauze27-Jul-10 17:49 
QuestionRe: a prob with HKEY Pin
David Crow28-Jul-10 2:29
David Crow28-Jul-10 2:29 
AnswerRe: a prob with HKEY Pin
Krauze28-Jul-10 15:33
Krauze28-Jul-10 15:33 
AnswerRe: a prob with HKEY [modified] Pin
Cool_Dev27-Jul-10 19:20
Cool_Dev27-Jul-10 19:20 
AnswerRe: a prob with HKEY Pin
KarstenK28-Jul-10 2:47
mveKarstenK28-Jul-10 2:47 
QuestionDifferent usage of CWinFormsControl Pin
cppmfcnewbie27-Jul-10 13:22
cppmfcnewbie27-Jul-10 13:22 
AnswerRe: Different usage of CWinFormsControl Pin
Cool_Dev27-Jul-10 18:46
Cool_Dev27-Jul-10 18:46 
GeneralRe: Different usage of CWinFormsControl Pin
cppmfcnewbie28-Jul-10 9:11
cppmfcnewbie28-Jul-10 9:11 
QuestionAssociating a file type with your MFC app Pin
Keith Vitali27-Jul-10 13:11
Keith Vitali27-Jul-10 13:11 
AnswerRe: Associating a file type with your MFC app Pin
Krauze27-Jul-10 16:22
Krauze27-Jul-10 16:22 
AnswerRe: Associating a file type with your MFC app Pin
Cool_Dev27-Jul-10 18:56
Cool_Dev27-Jul-10 18:56 
AnswerRe: Associating a file type with your MFC app Pin
Richard MacCutchan27-Jul-10 22:23
mveRichard MacCutchan27-Jul-10 22:23 
AnswerRe: Associating a file type with your MFC app Pin
David Crow28-Jul-10 3:13
David Crow28-Jul-10 3:13 
QuestionC++ saveFileDialog Pin
mmagill027-Jul-10 10:47
mmagill027-Jul-10 10:47 
AnswerRe: C++ saveFileDialog Pin
Luc Pattyn27-Jul-10 11:26
sitebuilderLuc Pattyn27-Jul-10 11:26 
AnswerRe: C++ saveFileDialog Pin
Richard MacCutchan27-Jul-10 11:27
mveRichard MacCutchan27-Jul-10 11:27 

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.