Click here to Skip to main content
15,867,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFrame transparent color in animated gif file Pin
includeh109-Aug-11 6:31
includeh109-Aug-11 6:31 
AnswerRe: Frame transparent color in animated gif file Pin
Chris Losinger9-Aug-11 10:45
professionalChris Losinger9-Aug-11 10:45 
QuestionHow to learn DirectDraw since it has been merged with D3D? Pin
Cold_Fearing_Bird9-Aug-11 4:48
Cold_Fearing_Bird9-Aug-11 4:48 
SuggestionRe: How to learn DirectDraw since it has been merged with D3D? Pin
Charles Oppermann9-Aug-11 5:47
Charles Oppermann9-Aug-11 5:47 
GeneralRe: How to learn DirectDraw since it has been merged with D3D? Pin
Chris Losinger9-Aug-11 10:47
professionalChris Losinger9-Aug-11 10:47 
JokeRe: How to learn DirectDraw since it has been merged with D3D? Pin
Charles Oppermann9-Aug-11 10:55
Charles Oppermann9-Aug-11 10:55 
GeneralRe: How to learn DirectDraw since it has been merged with D3D? Pin
Cold_Fearing_Bird9-Aug-11 14:36
Cold_Fearing_Bird9-Aug-11 14:36 
QuestionWhy can't read every value from MRU ? Pin
_Flaviu9-Aug-11 3:15
_Flaviu9-Aug-11 3:15 
I tryid to read every file from MRU ( registry ) with follow code :
C++
void CFileSourcePage::GetKey(HKEY hKey, LPCTSTR lpSubKey, CStringArray& saResult)
{
	if(RegOpenKeyEx(hKey,lpSubKey,0,KEY_READ,&hKey) != ERROR_SUCCESS)return;

	DWORD dwType;
	BYTE bData[4096];
	DWORD cbData = 4096;
	TCHAR    achKey[MAX_KEY_LENGTH];	// buffer for subkey name
	DWORD    cbName;					// size of name string
	TCHAR    achClass[MAX_PATH] = TEXT("");// buffer for class name
	DWORD    cchClassName = MAX_PATH;	// size of class string
	DWORD    cSubKeys = 0;				// number of subkeys
	DWORD    cbMaxSubKey;				// longest subkey size
	DWORD    cchMaxClass;				// longest class string
	DWORD    cValues;					// number of values for key
	DWORD    cchMaxValue;				// longest value name
	DWORD    cbMaxValueData;			// longest value data
	DWORD    cbSecurityDescriptor;		// size of security descriptor
	FILETIME ftLastWriteTime;			// last write time

	DWORD i, retCode;

	TCHAR  achValue[MAX_VALUE_NAME];
	DWORD cchValue = MAX_VALUE_NAME;

	// Get the class name and the value count
	retCode = RegQueryInfoKey(
		hKey,                    // key handle
		achClass,                // buffer for class name
		&cchClassName,           // size of class string
		NULL,                    // reserved
		&cSubKeys,               // number of subkeys
		&cbMaxSubKey,            // longest subkey size
		&cchMaxClass,            // longest class string
		&cValues,                // number of values for this key
		&cchMaxValue,            // longest value name
		&cbMaxValueData,         // longest value data
		&cbSecurityDescriptor,   // security descriptor
		&ftLastWriteTime);       // last write time

	// Enumerate the subkeys, until RegEnumKeyEx fails.

	if(cSubKeys)
	{
		TRACE1("\nNumber of subkeys: %d\n", cSubKeys);

		for(i = 0;i < cSubKeys;++i)
		{
			cbName = MAX_KEY_LENGTH;
			retCode = RegEnumKeyEx(hKey, i,
				achKey,
				&cbName,
				NULL,
				NULL,
				NULL,
				&ftLastWriteTime);
			if(retCode == ERROR_SUCCESS)
			{
				TRACE2("(%d) %s\n",i + 1, achKey);
			}
		}
	}

	// Enumerate the key values.

	if(cValues)
	{
		TRACE1("\nNumber of values: %d\n", cValues);

		for(i = 0,retCode = ERROR_SUCCESS;i < cValues;++i)
		{
			cchValue = MAX_VALUE_NAME;
			retCode = RegEnumValue(hKey, i,
				achValue,
				&cchValue,
				NULL,
				&dwType,
				bData,
				&cbData);
			if(retCode == ERROR_SUCCESS)
			{
				LPSTR pszValue = reinterpret_cast<LPSTR>(bData);
				saResult.Add(pszValue);
			}
		}
	}

	RegCloseKey(hKey);
}


and in OnInitDialog() I try :
C++
CStringArray saMRU;
CString sFile = theApp.GetProfileString(_T("Settings"),_T("File"));
GetKey(HKEY_CURRENT_USER,_T("Software\\MyPlace\\Application\\Recent File List"),saMRU);


but altought I have 3 files there :
C++
C:\eeeeeeeeeeeeeee.xyz
E:\Flaviu\VC++\MDI\Application\aaaaaaaaaaaaaa
E:\Flaviu\VC++\MDI\Application\gbdhfdfgf

is reading only first and last file in CComboBox .... why ? What I'm doing wrong ? Thank you.
QuestionRe: Why can't read every value from MRU ? Pin
David Crow9-Aug-11 3:49
David Crow9-Aug-11 3:49 
AnswerRe: Why can't read every value from MRU ? [modified] Pin
_Flaviu9-Aug-11 5:16
_Flaviu9-Aug-11 5:16 
AnswerRe: Why can't read every value from MRU ? Pin
Richard MacCutchan9-Aug-11 4:53
mveRichard MacCutchan9-Aug-11 4:53 
GeneralRe: Why can't read every value from MRU ? [modified] Pin
_Flaviu9-Aug-11 5:29
_Flaviu9-Aug-11 5:29 
QuestionDebug Assertion Failed Error ! Help me please. Pin
Nguyen Huy Tuan8-Aug-11 22:13
Nguyen Huy Tuan8-Aug-11 22:13 
AnswerRe: Debug Assertion Failed Error ! Help me please. Pin
Code-o-mat9-Aug-11 0:29
Code-o-mat9-Aug-11 0:29 
QuestionRe: Debug Assertion Failed Error ! Help me please. Pin
David Crow9-Aug-11 4:01
David Crow9-Aug-11 4:01 
AnswerRe: Debug Assertion Failed Error ! Help me please. Pin
Nguyen Huy Tuan10-Aug-11 20:47
Nguyen Huy Tuan10-Aug-11 20:47 
QuestionHow to extract only text information from html file? Pin
Le@rner8-Aug-11 20:03
Le@rner8-Aug-11 20:03 
AnswerRe: How to extract only text information from html file? Pin
ThatsAlok8-Aug-11 21:12
ThatsAlok8-Aug-11 21:12 
GeneralRe: How to extract only text information from html file? Pin
Le@rner8-Aug-11 21:32
Le@rner8-Aug-11 21:32 
GeneralRe: How to extract only text information from html file? Pin
ThatsAlok9-Aug-11 2:01
ThatsAlok9-Aug-11 2:01 
Question[solved]Still trying to hunt down a runtime error in VS 2010, need suggestions [modified] Pin
AndrewG12318-Aug-11 9:35
AndrewG12318-Aug-11 9:35 
QuestionRe: Still trying to hunt down a runtime error in VS 2010, need suggestions Pin
Albert Holguin8-Aug-11 10:19
professionalAlbert Holguin8-Aug-11 10:19 
AnswerRe: Still trying to hunt down a runtime error in VS 2010, need suggestions Pin
AndrewG12318-Aug-11 10:48
AndrewG12318-Aug-11 10:48 
GeneralRe: Still trying to hunt down a runtime error in VS 2010, need suggestions Pin
Richard MacCutchan8-Aug-11 21:18
mveRichard MacCutchan8-Aug-11 21:18 
QuestionRe: Still trying to hunt down a runtime error in VS 2010, need suggestions [modified] Pin
AndrewG12319-Aug-11 7:10
AndrewG12319-Aug-11 7:10 

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.