Click here to Skip to main content
15,909,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: need help with c programming data validation Pin
Matthew Faithfull15-Nov-07 2:24
Matthew Faithfull15-Nov-07 2:24 
GeneralRe: need help with c programming data validation Pin
neodeaths15-Nov-07 4:33
neodeaths15-Nov-07 4:33 
GeneralRe: need help with c programming data validation Pin
DoomedOne15-Nov-07 5:01
DoomedOne15-Nov-07 5:01 
QuestionMDI without Doc/view Pin
CodeMak15-Nov-07 1:30
CodeMak15-Nov-07 1:30 
AnswerRe: MDI without Doc/view Pin
Nelek15-Nov-07 1:35
protectorNelek15-Nov-07 1:35 
GeneralRe: MDI without Doc/view Pin
CodeMak15-Nov-07 1:39
CodeMak15-Nov-07 1:39 
GeneralRe: MDI without Doc/view Pin
CodeMak15-Nov-07 1:44
CodeMak15-Nov-07 1:44 
GeneralRe: MDI without Doc/view Pin
Nelek15-Nov-07 3:03
protectorNelek15-Nov-07 3:03 
This is more or less what I made.

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CMDIChildWnd::PreCreateWindow(cs) )
		return FALSE;

	// Set the configuration for the different Views
	extern CFPSDoc* m_pDoc;
;
	if ((m_pDoc) && (m_pDoc->m_szNewFrameName != ""))
	{	cs.style = WS_SYSMENU | WS_CAPTION | WS_OVERLAPPED;   //This is the main View (CScrollView)
;
                //All following type of views are from CFormView derived
		if (m_pDoc->m_szNewFrameName == "ViewType1")
		{	int nMax = 0;
			if (m_pDoc->m_cmlMyList1.GetCount () >= m_pDoc->m_cmlMyList2.GetCount ())
				nMax = m_pDoc->m_cmlMyList1.GetCount ();
			else
				nMax = m_pDoc->m_cmlMyList2.GetCount ();

			cs.cx = 500;
			cs.cy =  (40 + (25 * nMax));   //Variable Frame height according to number of elements
			m_pDoc->m_szNewFrameName = "This is the Type of view 1 in project \"" + m_pDoc->GetTitle () + "\"";
		}
		else if (m_pDoc->m_szNewFrameName == "ViewType2")
		{	cs.cx = 528;				cs.cy =  322;
			m_pDoc->m_szNewFrameName = "Second type of View in project \"" + m_pDoc->GetTitle () + "\"";
			cs.style = cs.style | WS_MINIMIZEBOX;
		}
		else if (m_pDoc->m_szNewFrameName == "ViewType2_Not_Visible")
		{	cs.cx = 1;				cs.cy =  1;
			m_pDoc->m_szNewFrameName = "";
			cs.style = cs.style | WS_MINIMIZE; //this is to have access to some functions coded in the view of second type, but without having the view itself.
		}
		else if (m_pDoc->m_pObj1 || m_pDoc->m_pObj2)  //if one particular element is selected
		{	cs.cx = 415;				cs.cy = 260;
			cs.style = cs.style | WS_MINIMIZEBOX;
		}
		else if ((m_pDoc->m_pObj3) && (m_pDoc->m_pObj3->m_nType == 0)) //if the other type of element is from one subtype
		{	cs.cx = 517;				cs.cy = 421;
			cs.style = cs.style | WS_MINIMIZEBOX;
		}
		else if ((m_pDoc->m_pObj3) && (m_pDoc->m_pObj3->m_nType == 2)) //if the other subtype
		{	cs.cx = 610;				cs.cy = 435;
			cs.style = cs.style | WS_MINIMIZEBOX;
		}
;
		cs.lpszName = m_pDoc->m_szNewFrameName;  //Assigning the correspondent title to the frame
	}
	return TRUE;
}


This is what I use to configure the different type of views that may be opened. Up to 50 different views in 6 different configurations.

Was that what you were asking for? If not... sorry. I didn't understand what you told me

the ";" are used just to avoid the cancellation of empty lines

Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

Wink | ;)

GeneralRe: MDI without Doc/view Pin
CodeMak15-Nov-07 17:23
CodeMak15-Nov-07 17:23 
GeneralRe: MDI without Doc/view Pin
Nelek15-Nov-07 20:57
protectorNelek15-Nov-07 20:57 
QuestionProblem with registering MFC Activex Control Pin
ashishbhatt15-Nov-07 0:59
ashishbhatt15-Nov-07 0:59 
AnswerRe: Problem with registering MFC Activex Control Pin
Paresh Chitte15-Nov-07 1:36
Paresh Chitte15-Nov-07 1:36 
GeneralRe: Problem with registering MFC Activex Control Pin
ashishbhatt15-Nov-07 18:45
ashishbhatt15-Nov-07 18:45 
GeneralRe: Problem with registering MFC Activex Control Pin
Paresh Chitte18-Nov-07 17:39
Paresh Chitte18-Nov-07 17:39 
GeneralRe: Problem with registering MFC Activex Control Pin
ashishbhatt18-Nov-07 18:34
ashishbhatt18-Nov-07 18:34 
GeneralRe: Problem with registering MFC Activex Control Pin
Paresh Chitte18-Nov-07 19:05
Paresh Chitte18-Nov-07 19:05 
QuestionHandling Windows Messages on Another Application Pin
narayanagvs15-Nov-07 0:41
narayanagvs15-Nov-07 0:41 
AnswerRe: Handling Windows Messages on Another Application Pin
CPallini15-Nov-07 0:58
mveCPallini15-Nov-07 0:58 
QuestionFile Open Dialog Pin
T.RATHA KRISHNAN15-Nov-07 0:40
T.RATHA KRISHNAN15-Nov-07 0:40 
AnswerRe: File Open Dialog Pin
Nelek15-Nov-07 1:33
protectorNelek15-Nov-07 1:33 
QuestionFont size in ListBox?????? Pin
Deepu Antony14-Nov-07 23:58
Deepu Antony14-Nov-07 23:58 
AnswerRe: Font size in ListBox?????? Pin
Naveen15-Nov-07 0:03
Naveen15-Nov-07 0:03 
GeneralRe: Font size in ListBox?????? Pin
Deepu Antony15-Nov-07 0:16
Deepu Antony15-Nov-07 0:16 
GeneralRe: Font size in ListBox?????? Pin
Nelek15-Nov-07 0:27
protectorNelek15-Nov-07 0:27 
GeneralRe: Font size in ListBox?????? Pin
Hamid_RT15-Nov-07 2:59
Hamid_RT15-Nov-07 2:59 

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.