|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
add message OnCtlColor
and add this code inside:
<br />
switch(pWnd->GetDlgCtrlID())<br />
{<br />
case IDC_LIST1: <br />
pDC->SetBkColor(RGB(0,0,0)); <br />
hbr = ::CreateSolidBrush(RGB(0,0,0)); <br />
pDC->SetTextColor(RGB(0,255,102)); <br />
return (HBRUSH)hbr;<br />
break;<br />
}<br />
then you are there where you wanted;)
|
|
|
|
|
Hi,
I am using ON_COMMAND_RANGE_HANDLER(ID_FIRST,ID_LAST,Onmenuitemselected)
The problem is When the user logs in as admin all the menu items are displayed and hence proper menu id gets invked.
If the user logs in to the application as operator, he does not have proper privileges , hence some of the menu items will not be displayed.
At this time, when the user clicks , third item in the menu (ID_FOURTH),ID_THIRD gets passed as wid.
Is there any way to handle this?
Regards,
Anitha
|
|
|
|
|
Menu IDs should stay the same whether the option itself is displayed or not.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It does not when he assembles the menu entirely "by hand".
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Why would that make any difference? Whether the menu is "designed" at design time or at run time, the IDs should all be known ahead of time.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No, Menu id's are same they r defined in header file like
ID_FIRST 2001
ID_SECOND 2002
But when some menu items are not displayed, the ON_COMMAND_RANGE_HANDLER takes the menu items in sequence.hence , wrong functionality gets invoked.
|
|
|
|
|
If ON_COMMAND_RANGE_HANDLER() (which I was not able to find on MSDN or Google) is not working, try using:
ON_COMMAND(ID_FIRST, Onmenuitemselected)
ON_COMMAND(ID_SECOND, Onmenuitemselected)
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You are probably better off when you use a menu resource with the maximum of entries and then disable/hide some depending in the OnUpdate...() handler, depending on the application state.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi. I have a CTreeCtrl menu, and every once and a while I refresh the tree by calling DeleteAllItems() then re-adding all nodes. How can I prevent display updates of the the control until all items are added? Right now when the tree is refilled, you can see it all being deleted then filled up. All happens in a flash, but you can still see it refresh and I'd like to get rid of that if possible. Thanks!
|
|
|
|
|
Use the SetRedraw() method.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks! I knew it was something simple, I just couldn't find the method.
|
|
|
|
|
class A {};
class B { public: B (A a) {} };
int main()
{
A a;
B b=a;// this statement gives no error! How? please explain
}
|
|
|
|
|
Sakthi_Vel wrote: B b=a;// this statement gives no error! How? please explain
Because this statement calls the constructor directly, it's equivalent to...
B b(a);
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Sakthi_Vel wrote: B b=a;// this statement gives no error! How? please explain
Have you set a breakpoint in B 's constructor?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I just want to know how may i be able to get the source of a generated page inside Microsoft WebBrowser?
I just cant find a way to get the source of the generated page once the page has finished downloaded.
Thank you very much
-Ruperts-
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
I haven't used any of the VC++ 2008 betas, but the addition of multi-threaded compilation and improved debugging for multi-threaded programs has me interested. I currently use Visual Studio 2005 Standard (with SP1 and Intellisense hotfix), but am considering downloading the free VC++ 2008 Express, and then just copying all the files/folders from the VC\bin folder to the VC 2005 program folder.
I'm also having problems with the Document Explorer from VS2005 crashing consistently on XP x64 SP2, so am also downloading the VS2008 MSDN beta, hoping this will fix my problems.
For completeness, I'll also probably download the latest Platform SDK (as I'm still using the VS2005 one).
Has anyone else tried this ?
Is VC++ 2008 suitable for production code ?
Is it as easy as I make out ?
|
|
|
|
|
In what circumstances dynamic_cast is used?
|
|
|
|
|
Here[^] is a nice article that discuss about that.
|
|
|
|
|
|
I have a small doubt on edit box. i am making a dialog based application. i have three edit boxes in the screen.
1.want to know how to set a range(eg 1-10) if i enter 11 it should pop a message.
2.i want to set the final value of the first edit box as the minimum value of the third edit box and the final value of the second edit box as the final value of the third edit box.
hope the query is understood.
|
|
|
|
|
to restrict an edit to a given range, you could attach it a spin control.
for the second point, where are you stuck ? getting/setting an editbox value ? or the calculation behind that ?
|
|
|
|
|
extremely sorry for again putting the query in the forum.. well i wanted to know how to set the third edit box value.
|
|
|
|
|
Chandrasekharanp wrote: extremely sorry for again putting the query in the forum..
no problem mate
Chandrasekharanp wrote: well i wanted to know how to set the third edit box value
like this for instance:
CEdit* pEdit = (CEdit)GetDlgItem(IDC_MY_EDIT);
pEdit->SetWindowText(_T("Hello World"));
|
|
|
|