|
It shoudl work. The problem is not with EnableWindow but probably that GetDlgItem(btnCtr) doesn't find the specific window and thus returns NULL.
To be sure, just try that:
CWnd* pWindow = GetDlgItem(btnCtr);
And check the value of pWindow with your debugger.
|
|
|
|
|
Like a Resource ID duplication of the Number.
Regards,
FarPointer
|
|
|
|
|
try
m_Button3.EnableWindow(0);
|
|
|
|
|
WhiteSky wrote: m_Button3.EnableWindow(0);
This requires to make a Control-variable (of the type of the DialogItem), but yes, this is the way to go.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 2:51 Friday 31st March, 2006
|
|
|
|
|
Hi All,
Iam working with a ListControl whose parent is a dialog.want to place a tree control on a particular cell on the listcontrol,which on doubleclicking should open up(ie: the width & height of this tree control exceeds the dialog boundary).
Like in ComboBox control, where the list visible, goes beyond the dialog boundary.
Tried somethings like
treeControl.SetOwner(GetDesktopWindow();
treeControl.ModifyStyle(WS_CHILD,WS_OVERLAPPED);
Everything works fine apart from 1 problem.I can see the newly created window(the treecontrol) on my taskbar.
wHAT should I do to avoid that...
Regards,
P
|
|
|
|
|
Pazzuzu wrote: treeControl.ModifyStyle(WS_CHILD,WS_OVERLAPPED);
I guess this line is causing the trouble. Why are you removing WS_CHILD style. And why WS_OVERLAPPED ?
Nibu thomas
Software Developer
|
|
|
|
|
Okay,that was a mistake.
Tried as follows.
treeControl.ModifyStyle(WS_BORDER,WS_POPUP);
but the window is still there in the taskbar.Guess some of the styles are not added to the Control,though I use a modify style.
What could be done...
|
|
|
|
|
Pazzuzu wrote: treeControl.ModifyStyle(WS_BORDER,WS_POPUP);
Why WS_POPUP ?? And why removing WS_BORDER ?? Let it remain as it is!
Set the parent to desktop!
Nibu thomas
Software Developer
|
|
|
|
|
Iam not modifying any style now.Iam keeping it as it is .
treeControl.SetParent(GetDesktopWindow());
Still window is visible.
|
|
|
|
|
Have seen that my call to
treeControl.ShowWindow(true);
pops up this window.But if I comment out this statement,the control is not popping up on double clicking
|
|
|
|
|
What about WS_EX_TOOLWINDOW ? Add this style using ModifyStyleEx .
Nibu thomas
Software Developer
|
|
|
|
|
Check this out :-
WS_EX_TOOLWINDOW
Regards,
FarPointer
|
|
|
|
|
Thanks Nibu & Farpointer.It worked...
Thanks one again
|
|
|
|
|
Would you be kind enough to say how you made it to work.
Regards,
FarPointer
|
|
|
|
|
Hello all,
How to trap/catch system calls from an application.
say for Ex: A File I/O Program,in which file open & close system calls needs to
trapped.
I have some utilities to monitor the system calls generated from an application.
But,I need to do it programmatically(in VC++). A Sample code for doing the same will be more helpful!!.
Thanks in Advance
Rane
|
|
|
|
|
|
Hello,
How to get the recordview pointer thru which I will get the recordset pointer, if I have put on a tree view, and a list view in my MFC application with database? It's because the record view is not the default view in this application, how to get this recordview pointer so as to get the recordset pointer contained in it? Please help.
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|
|
Have you derived a class from CRecordset ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all,
I have a very special case: a skin dilog (without thick frame, without title bar), movable from anywhere you klick ( OnNcHitTest returns HTCAPTION if the parent reterns HTCLIENT). Furthermore has rounded corners
CRgn rgnWindowRegion;
rgnWindowRegion.CreateRoundRectRgn(0, 0, Rect.Width(), Rect.Height(), 4, 4);
SetWindowRgn(rgnWindowRegion,TRUE);
This dilog is not resizable, but it must be one if the user clicks on a special button, and drags the mouse with the left button down. Has anyone an idea how can I do this? May be a similar example?
For any suggestion thanks in advance.
Regards,
Emanuil
|
|
|
|
|
You mean to say that it should become resizable after the user clicks the button then handle the wm_size set a boolean flag(On button click) and if its true send the message to the default implementation else discard it.
Regards,
FarPointer
|
|
|
|
|
Yes, the dialog should be resiable, but only during the click on the button. So the user clicks the button and with LBUTTONDOWN resizes the dialog as you do on the margine. When LBUTTONUP, then the dialog is on the final size and no more resizable (of course until the next click on button).
Code like:
LONG lSTYLE = GetWindowLong(m_hWnd, GWL_STYLE);
lSTYLE &= ~WS_THICKFRAME;
lSTYLE |= WS_THICKFRAME;
SetWindowLong(m_hWnd, GWL_STYLE, lSTYLE);
makes a nasty border, and after I reset the region with rounded corner the window do not invalidates the border regions.
I guess I must do something special (what ?) and send WM_SIZE by myself to the window. The button can be also a special region, e.g. where a bitmap is shown. Important: the window must be redrawn from another place than the window border.
THANKS,
Emanuil
-- modified at 1:58 Friday 31st March, 2006
|
|
|
|
|
CStringArray myclass::getStr()
{
CStringArray csa;
csa.Add("str1");
csa.Add("str2");
return csa;
}
I got this error
what to do?
error C2558: class 'CStringArray' : no copy constructor available
How to return two dimensional array?
JAYARAJ
|
|
|
|
|
Rather than returning the value, pass the paramter as a reference.
void myclass::getStr(CStringArray& csa)
{
csa.Add("str1");
csa.Add("str2");
}
|
|
|
|
|
This is my code snippet, and it does not work, since CStringArray does not implement a copy constructor (meaning that this probably fails to compile:
CStringArray csa=getStr();
Do as suggested above, pass the CStringArray as an argument to the function.
~RaGE();
|
|
|
|
|
maybe it is some helpful to you
////h File////////////
CStringArray *a();
CStringArray* CAnswer::a()
{
CStringArray* a;
a=new (CStringArray);
a->Add("123");
a->Add("12");
return a;
}
if you check count then return ->2
CStringArray *b;
b=a();
int cb=b->GetCount();
|
|
|
|