Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: getting complete file path Pin
Rajesh R Subramanian5-May-09 23:52
professionalRajesh R Subramanian5-May-09 23:52 
GeneralRe: getting complete file path Pin
MahaKh5-May-09 23:58
MahaKh5-May-09 23:58 
AnswerRe: getting complete file path Pin
«_Superman_»5-May-09 23:56
professional«_Superman_»5-May-09 23:56 
GeneralRe: getting complete file path Pin
MahaKh6-May-09 0:02
MahaKh6-May-09 0:02 
GeneralRe: getting complete file path Pin
Divyang Mithaiwala6-May-09 1:55
Divyang Mithaiwala6-May-09 1:55 
QuestionInconstitent CTreeCtrl due to Modal Dialog [modified] Pin
__GJ__5-May-09 23:46
__GJ__5-May-09 23:46 
AnswerRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
Stuart Dootson6-May-09 2:30
professionalStuart Dootson6-May-09 2:30 
GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
__GJ__6-May-09 4:56
__GJ__6-May-09 4:56 
I set a timer in CMainFrame. In the OnTimer function it checks whether or not it should activate the dialog. I call DoModal in the same thread as the UI.

Cleared out the zip file(removed the debug directory) it now only 114kb. Code

With "no other option" i meant filefactory, since I don't have a server available. But that's besides the point, I don't really know where the problem lies, I think it has something to do with a Modal dialog interupting a message sequence from the TreeCtrl, but that's just guessing. Other than setting the timer I just used a default program setup generated by Visual Studio 2008.

It could be that it does not create the view or treectrl properly.

This is how the generated code from Visual Studio 2008 creates the View windows.
The CDockablePanes are created in the function CreateDockingWindows in CMainFrame
// Create class view
	CString strClassView;
	bNameValid = strClassView.LoadString(IDS_CLASS_VIEW);
	ASSERT(bNameValid);
	if (!m_wndClassView.Create(strClassView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_CLASSVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
	{
		TRACE0("Failed to create Class View window\n");
		return FALSE; // failed to create
	}


This leads to the onCreate of the FileView (also generated code)
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Create view:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("Failed to create file view\n");
		return -1;      // fail to create
	}

	// Load view images:
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* Is locked */);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// All commands will be routed via this control , not via the parent frame:
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// Fill in some static tree view data (dummy code, nothing magic here)
	FillFileView();
	AdjustLayout();

	return 0;
}



The timer, onAbout does DoModal (added by me)
void CMainFrame::OnTimer(UINT_PTR nIDEvent)
{
	switch(nIDEvent)
	{
	case IDT_MAINTIMER:
		{
			KillTimer(IDT_MAINTIMER);

			CTreeBugTestApp* pApp = (CTreeBugTestApp*) AfxGetApp();

			pApp->OnAppAbout();

			SetTimer(IDT_MAINTIMER, 2000, NULL);
			break;
		}
	}	
}


The generated OnAppAbout function
void CTreeBugTestApp::OnAppAbout()
{
	CAboutDlg aboutDlg;
	aboutDlg.DoModal();
}

GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
Stuart Dootson6-May-09 6:44
professionalStuart Dootson6-May-09 6:44 
GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
__GJ__6-May-09 20:44
__GJ__6-May-09 20:44 
GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
__GJ__8-May-09 3:56
__GJ__8-May-09 3:56 
QuestionStatic variable in header file Pin
neupane.keshab5-May-09 23:17
neupane.keshab5-May-09 23:17 
AnswerRe: Static variable in header file Pin
«_Superman_»5-May-09 23:42
professional«_Superman_»5-May-09 23:42 
AnswerRe: Static variable in header file Pin
CPallini5-May-09 23:48
mveCPallini5-May-09 23:48 
GeneralRe: Static variable in header file Pin
neupane.keshab6-May-09 1:34
neupane.keshab6-May-09 1:34 
GeneralRe: Static variable in header file Pin
CPallini6-May-09 1:44
mveCPallini6-May-09 1:44 
AnswerRe: Static variable in header file Pin
Stuart Dootson6-May-09 1:47
professionalStuart Dootson6-May-09 1:47 
AnswerRe: Static variable in header file Pin
neupane.keshab6-May-09 1:59
neupane.keshab6-May-09 1:59 
Questionhow to remote access to ad Pin
ljz8886665555-May-09 23:07
ljz8886665555-May-09 23:07 
AnswerRe: how to remote access to ad Pin
ljz8886665555-May-09 23:10
ljz8886665555-May-09 23:10 
GeneralRe: how to remote access to ad Pin
Hamid_RT5-May-09 23:17
Hamid_RT5-May-09 23:17 
GeneralRe: how to remote access to ad Pin
ThatsAlok5-May-09 23:30
ThatsAlok5-May-09 23:30 
GeneralRe: how to remote access to ad Pin
Cedric Moonen5-May-09 23:55
Cedric Moonen5-May-09 23:55 
AnswerRe: how to remote access to ad Pin
ThatsAlok5-May-09 23:15
ThatsAlok5-May-09 23:15 
GeneralRe: how to remote access to ad Pin
ljz8886665555-May-09 23:25
ljz8886665555-May-09 23:25 

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.