Click here to Skip to main content
15,907,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: "Changing Editbox color" Pin
Hamid_RT13-Mar-07 21:19
Hamid_RT13-Mar-07 21:19 
AnswerRe: "Changing Editbox color" [modified] Pin
_AnsHUMAN_ 13-Mar-07 22:47
_AnsHUMAN_ 13-Mar-07 22:47 
AnswerRe: "Changing Editbox color" Pin
ThatsAlok15-Mar-07 0:32
ThatsAlok15-Mar-07 0:32 
AnswerRe: "Changing Editbox color" Pin
prasad_som15-Mar-07 2:15
prasad_som15-Mar-07 2:15 
QuestionI need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh13-Mar-07 20:15
G Haranadh13-Mar-07 20:15 
AnswerRe: I need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh13-Mar-07 23:11
G Haranadh13-Mar-07 23:11 
GeneralRe: I need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh14-Mar-07 7:01
G Haranadh14-Mar-07 7:01 
QuestionCString: Heap Vs Stack? Pin
devvvy13-Mar-07 19:52
devvvy13-Mar-07 19:52 
Does CString allocate memory on the heap or on the stack?
<br />
#include "stdafx.h"<br />
<br />
#include <afxwin.h>      // MFC core and standard components<br />
#include <afxext.h>         // MFC extensions (including VB)<br />
#include <afxtempl.h><br />
<br />
#include "TestCString.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// The one and only application object<br />
<br />
CWinApp theApp;<br />
<br />
using namespace std;<br />
<br />
<br />
void SomeFunc(CList<CString, CString> &oList) {<br />
	CString strOriginal = L"ABCDEF";<br />
	CString strNewString; << Local variable declared on Stack but seems like it allocates on heap since it can be called from "Main".<br />
<br />
	strNewString = strOriginal.Mid(2);<br />
	oList.AddTail(strNewString);<br />
<br />
	return;<br />
}<br />
<br />
<br />
<br />
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])<br />
{<br />
	int nRetCode = 0;<br />
<br />
	// initialize MFC and print and error on failure<br />
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))<br />
	{<br />
		// TODO: change error code to suit your needs<br />
		cerr << _T("Fatal Error: MFC initialization failed") << endl;<br />
		nRetCode = 1;<br />
	}<br />
	else<br />
	{<br />
		CList<CString, CString> oList;<br />
		CString strString;<br />
<br />
		SomeFunc(oList);<br />
		strString = (CString) oList.GetHead();<br />
<br />
		printf("%s", strString);<br />
	}<br />
	<br />
	return nRetCode;<br />
}<br />

AnswerRe: CString: Heap Vs Stack? Pin
Michael Dunn13-Mar-07 20:05
sitebuilderMichael Dunn13-Mar-07 20:05 
AnswerRe: CString: Heap Vs Stack? Pin
prasad_som13-Mar-07 21:18
prasad_som13-Mar-07 21:18 
Questioncancel dialog Pin
deeps_cute13-Mar-07 19:17
deeps_cute13-Mar-07 19:17 
AnswerRe: cancel dialog Pin
Parthi_Appu13-Mar-07 19:23
Parthi_Appu13-Mar-07 19:23 
GeneralRe: cancel dialog -- ok then how Pin
deeps_cute13-Mar-07 21:22
deeps_cute13-Mar-07 21:22 
AnswerRe: cancel dialog -- ok then how Pin
Parthi_Appu13-Mar-07 21:30
Parthi_Appu13-Mar-07 21:30 
GeneralRe: cancel dialog -- ok then how Pin
deeps_cute13-Mar-07 21:37
deeps_cute13-Mar-07 21:37 
GeneralRe: cancel dialog -- ok then how Pin
Parthi_Appu13-Mar-07 21:46
Parthi_Appu13-Mar-07 21:46 
GeneralRe: cancel dialog Pin
deeps_cute13-Mar-07 21:54
deeps_cute13-Mar-07 21:54 
GeneralRe: cancel dialog Pin
Parthi_Appu13-Mar-07 21:57
Parthi_Appu13-Mar-07 21:57 
GeneralRe: cancel dialog Pin
deeps_cute13-Mar-07 23:06
deeps_cute13-Mar-07 23:06 
GeneralRe: cancel dialog Pin
Parthi_Appu13-Mar-07 23:45
Parthi_Appu13-Mar-07 23:45 
GeneralRe: cancel dialog Pin
deeps_cute13-Mar-07 23:58
deeps_cute13-Mar-07 23:58 
GeneralRe: cancel dialog Pin
Parthi_Appu14-Mar-07 0:16
Parthi_Appu14-Mar-07 0:16 
GeneralRe: cancel dialog Pin
deeps_cute14-Mar-07 0:38
deeps_cute14-Mar-07 0:38 
GeneralRe: cancel dialog Pin
Parthi_Appu14-Mar-07 0:59
Parthi_Appu14-Mar-07 0:59 
Generalthe problem is Pin
deeps_cute14-Mar-07 1:50
deeps_cute14-Mar-07 1:50 

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.