|
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
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;
}
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();
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;
}
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 );
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);
m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
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();
}
|
|
|
|
|
I'm still not entirely sure what the problem is - OK, the tree-view loses focus. That's easily solved, with this (I've commented the lines I've added to your code):
void CTreeBugTestApp::OnAppAbout()
{
CWnd* pFocusWnd = CWnd::GetFocus();
CAboutDlg aboutDlg;
aboutDlg.DoModal();
if (pFocusWnd) pFocusWnd->SetFocus();
}
Any other issues?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Tried it and it didn't work.
Problem is that if you click a lot on the tree, while waiting for the dialog to pop up. And if you time it right, clicking at the exact time to the dialog popups up. It is possible to get the tree to think that the last clicked node should be displayed as selected.
In that case the tree keeps jumping back to the last clicked tree-node. Meaning you last clicked node1 in the tree before the dialog pops up, you close the dialog and click node 2. That node 2 is displayed as selected as long as your mouse button is pressed, but as soon as you release it jumps back and displays node 1 as selected. But it should display node 2 as selected!
|
|
|
|
|
I think I finally found it.
If I call SelectDropItem(NULL) in the OnNMClick, it seems to fix the problem.
|
|
|
|
|
I have program like this
#include <iostream>
using std::ios;
using std::endl;
class A : public B
{
public:
static bool abool;
static std::ostream xyz;
}
#include <iostream>
#include "header.hh"
using std::ios;
using std::endl;
bool A::abool;
std::ostream A::xyz;
Here, while compilng i get error saying that
undefined reference to A::xyz
but there is no error with A::abool ??
Can anyone explain why this error is there and how to remove it ??
Thanks.
|
|
|
|
|
Have you actually taken the snippet of your working code.
I don't see a ; after the class declaration.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I get a quite different error:
error C2512: 'std::basic_ostream<_Elem,_Traits>' : no appropriate default constructor available
That, after all, looks quite reasonable.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yes this is a part of my working code
and i have just pasted the part where i am having error
|
|
|
|
|
I suppose you're replying to the wrong reply...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I don't get your error with VC++ or gcc, either when I add a semi-colon to the end of the class definition or not. I get other errors, but not the one you've got. You're likely not posting sufficient of your code to expose the error.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
actually, above code was just a part of the actual code
and i just wanted to know how to use static variables defined in header files in .cpp files
posting actual code isn't possible as it is very long and this code is then used by another library...
so i just pasted the part where i was having error...
i found the error that ostream doesn't have any constructor that takes no parameters...
now i am guessing that code is OK but there might be some linking problems...
thanks all for your help
|
|
|
|
|
I have write a program ,which can run on local computer .but it can't access to remote ad.
this is my first question ,please help me.thank you
|
|
|
|
|
|
Becuase we are human not robot and you need to wait.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: Becuase we are human not robot and you need to wait.
I am working on Hamid Version 2.0 Robot, who will watch for question coming on vc++ forum and answer it instantly....
But i don't know how to create it hand
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ljz888666555 wrote: why no one help me?
After 3 minutes ? C'mon, this is not a chat, it is a forum.
And if you want to increase your chances of getting an answer, I suggest you read the posting guidelines at the top of this forum.
|
|
|
|
|
actually we don't understand your question, briefly describ actually what do you want?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sorry,I have writen a progma.It can runs on service computer which have installed AD.
But ,if it runs other computer ,it can't access the service's AD.
|
|
|
|
|
What is AD?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Do you know ldap ? AD is active directory
|
|
|
|
|
I know what is LDAP, also AD. but dude you have let me know you are working on AD i.e. Active Directory.
anyways, does you application reside on remote computer or you running application on your computer and trying to access remote computer through it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ljz888666555 wrote: but it can't access to remote ad.
Why not? Is this supposed to be a helpful question? What have you done to isolate the problem?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all. I'v got a problem like this:
I have a array(BYTE* pData) with a dozen of 0 and 1,now,I want to send this data to the soundcard and play!
What can I do?
Do I have to set the format(44kHz16BitStereo)? Is the function of waveOutOpen will do?
Thanks!
|
|
|
|
|
you have to do a lot of stuff. Use the search boc for further details...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Well you have first to pack the data as a WAV file (see for instance [^]) and then you may use the PlaySound function [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|