|
Or post/send message to hwndParent, WM_COMMAND, IDOK, or IDCANCEL.
Truth is the subjection of reality to an individuals perception
|
|
|
|
|
I have created a function display a dialog. When I try to show a previously selected window, it causes error. :(What seems to be the problem? Here’s my code:
void CProjectView::SetSelectedDialog(CDialog* dialog)
{
if(m_pSelectedDialog)
{ //Hide previously selected window
m_pSelectedDialog->ShowWindow(SW_HIDE);
}
if(dialog)
{ // show Selected Window
CRect rect;
GetClientRect( &rect );
m_pSelectedDialog = dialog;
m_pSelectedDialog->MoveWindow(rect, TRUE);
m_pSelectedDialog->ShowWindow(SW_SHOW);
}
}
|
|
|
|
|
romuzu wrote: it causes error
What error ? Be more specific.
|
|
|
|
|
|
|
That depends on how receive collour 7x . Also library in mapped dynamically or equivalent may play part...
Now if you would make your question a bit more comprehensible, the answer you receive might be more comprehensible too...
|
|
|
|
|
Hi all,
How can i set the tabstop property of a control to FALSE from the code ?
Thanx in advance,
Desmo16.
|
|
|
|
|
ModifyStyle(WS_TABSTOP,0,0);
|
|
|
|
|
That's what i needed, thanx but...
How can i re-enable the tabstop ?
|
|
|
|
|
ModifyStyle(0, WS_TABSTOP, 0);
it is this easy
|
|
|
|
|
Hope I understood your question
Did you see TabStop on property window of control
|
|
|
|
|
Hi,
in a loop i refresh items in a grid. Each line will update the screen...
How can i freeze the window before the loop and release it after the loop ?
Thanks
-- modified at 6:21 Tuesday 24th October, 2006
anyone an idea ?
|
|
|
|
|
Did u try SetRedraw() function?
nave
|
|
|
|
|
Works perfectly
Big thanks !
|
|
|
|
|
Hi all,
How can i set the order of navigation among controls when i press TAB ?
Thanx in advance,
Desmo16.
|
|
|
|
|
if you want to set at project creation time then,
(in VS 2003 IDE)
Display the dialog for which controls to set the tab order
then go to menu Format then press TabOrder
after this press the controls in the order you want the taborder set
|
|
|
|
|
You can also open the rc file in a text editor.
Where the dialog is declared, with all its buttons and so on, the order they are in in that text file is the tab order. So just change the order to what you want.
Truth is the subjection of reality to an individuals perception
|
|
|
|
|
Hello,
I implemented design pattern class Singleton using VC++. But my destructor is not call automatically. What's wrong?
Thanks an advance,
Andrew
Listing:
class Singleton
{
static Singleton* _instance;
protected:
Singleton(){printf("\nClass Singleton has created\n");};
public:
virtual ~Singleton(){
printf("Class Singleton has destoying.. ");
delete _instance;
}
static Singleton* Init()
{
if (_instance!=NULL)
{
printf("\nError:Class Singleton already exist\n");
return NULL;
}
else
{
_instance=new Singleton();
return _instance;
};
}
void Proof(){printf(" Hello");
}
};
Singleton* Singleton::_instance=NULL;
void main()
{
Singleton* s1=Singleton::Init();
s1->Proof();
}
|
|
|
|
|
It is because you never destroy your pointer (_instance). There is a new but no delete associated. You need to add a 'destroy' public method to your singleton that will delete the pointer. And you need to call this function at the end of your program (or when you want to delete your singleton).
Another way of doing that (and you won't need to manage the memory yourself) is to use this init method instead (still static method):
Singleton* Singleton::Init()<br />
{<br />
static Singleton Instance;<br />
return &Instance;<br />
}
Of course, you can remove your static pointer.
BTW: when you post code, please use the code or pre tags so that it is more readable.
|
|
|
|
|
Cedric,
Thank you for your explanation.
Andrew
|
|
|
|
|
Hi,
I have created a new window with following method
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_FILE_NEW);
But when I print some data on this window the the data is printed on the
view window alongwith the scroll bar.What should be the problem?
When I press the left mouse button on the area where the scroll bar is
supposed to be then the scroll bar appears until then the scroll bar is
invisible.
Thanks
Pritha
|
|
|
|
|
I think the problem is in the code which creates that new window, or the way you are printing over it. It seem the new window does not know that a scroll bar is there
|
|
|
|
|
Hi,
thanks for your reply
Yes It seems so.
But do I make the window aware that a scroll bar is in this place. Is there any way to do that?
Since I have created the window only with this one method
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_FILE_NEW);
through which I get a new window.
I then get the window pointer and print data on the window with the help of this window pointer.
I have not done anything more than this.
Please Guide
Prithaa
|
|
|
|
|
Do You use MDI
if then what kind of view you are using
|
|
|
|
|
Hi,
Yes I use MDI my view is derived from CSrollView
Thanks
Prithaa
|
|
|
|