|
I can guess that you have in other part of your program a code to "ungray" the item. Check that.
Other fact to check. Are other menu items grayed that you see grayed? maybe is only a display problem.
Jaime
|
|
|
|
|
I solved the problem and I'm very happy for that!!
ok.. forget the function mapped to UPDATE_COMMAND_UI - delete it! Somewhere outside do this to switch between enabled and disabled menu items - nothing else
Item3Enable = !Item3Enable;<br />
<br />
UINT fGray = Item3Enable ? 0 : MF_GRAYED|MF_DISABLED;<br />
CMenu *hMenu; <br />
hMenu = GetMenu(); <br />
CMenu *sub; <br />
sub = hMenu->GetSubMenu(1); <br />
sub->EnableMenuItem(ID_SETTINGS_ITEM3, MF_BYCOMMAND|fGray);
|
|
|
|
|
Hi all,
I would like to know that "how to hide dialog box" on pressing the command button.
rajesh
|
|
|
|
|
|
Actually this is not working in my program.
I would like to explain my question.
I insert three dialog box(d1,d2 and d3) and also make their
classes for each dialog box(CD1,CD2 and CD3), derived from CDialog.
d1 contains two botton "Back and Next".On Clicking on the "Next" button, it calls d2(second dialog box).d2 also contains two button "Continue and Cancel".Again I press the "Continue" button, it calls d3(third dialog box).
Now I want to do that when I click on "Continue" button,it calls d3 and dismiss(hide) the both dialog box(d1 and d2)simultaneously.
I wrote code something like that:
void CD1::OnNext()
{
CD2 dlg2;
dlg2.DoModal();
}
............
..............
void CD2::OnContinue()
{
CD3 dlg3;
dlg3.DoModal();
}
Please help me
How to write code on the "Coninue" button so that d1 and d2 will be hide together?.
rajesh
|
|
|
|
|
void CD1::OnNext()
{
CD2 dlg2(this);
ShowWindow(SW_HIDE);
dlg2.DoModal();
}
void CD2::OnContinue()
{
CD3 dlg3(this);
ShowWindow(SW_HIDE);
dlg3.DoModal();
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Can anyone suggest any resource that describes the contents of the dev studio workspace file?
|
|
|
|
|
Have you tried opening the file in Notepad? It's not a binary file so you should be able to go through it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I got that far.
What I was wondering was...
Is there a way of setting variables with a workspace scope, so that all the individual projects can see them?
|
|
|
|
|
someone plz suggest how to write a custom GINA.dll for Windows XP for Voice Based Login System
thanks in advance
Anshuman
|
|
|
|
|
how to bind a edit control in a ADO to a combo box control ?
which class in MFC will help,
|
|
|
|
|
What do you mean by binding an edit control to a combobox control?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
it means a current Record set called as a ADO Data bound dialog , where i have all static and edit boxs as default ,i need to place a new combobox to call the data of a field from second record set of database
|
|
|
|
|
So are you wanting to populate a combobox with the results of a recordset query?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes,i want to place a combobox on a ADO data dialog with a result of a recordset query to get only a selected field from the table in this combobox as a dropdown, Please help me this
|
|
|
|
|
Asha Rams wrote:
...a ADO data dialog...
I've never heard of one of these. What is it?
In any case, perhaps this article will help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am having problems trying to capture the HDN_ITEMDBLCLICK message of a HeaderCtrl of a ListCtrl. MSDN docs refer to seting HDS_BUTTONS style for the HeaderCtrl. I have tried doing this during the ListCtrl:OnCreate procedure. It appears to be changing the style and when you left click on a header column, it depresses like a button control would.
Any help would be appreciated.
Thank you.
|
|
|
|
|
Hi,
I have been using a wrapper class around IXMLDOMDocument to save to an XML file. (Available here on CP)
How can i save the type of encoding in that XML file?
Best regards,
Jens
|
|
|
|
|
I am using a list control, where i am displaying around 5 columns and 25 rows. I want to update only the 2nd and 3rd column items values for every second. This is working by updating it in OnTimer function. To reflect the changes Invalidate(TRUE) is used. But the problem is, the control is FLICKERING every second when it is updated.
Is there any way to update/refresh the control without flickering?
Please let me know ASAP.
vidya
|
|
|
|
|
InvalidateRect() can be used to identify the area of the window/control that requires repainting. The entire window is always repainted. BUT, using InvalidateRect allows you to specify which parts of the window are erased before repaint. The flickering is caused by the erasing/repainting method. If the unchanged areas of the window/control are not erased before a repaint, they will not flicker, but will remain the same.
A plain english example: Take a paper and a pen. Draw a line on the paper. Now, if you used Invalidate , you'd first erase the line, then draw it again. If you used InvalidateRect and specified an empty section of the paper, you'd draw the same line again over the previous one without erasing it first, thus avoiding the flicker effect.
This is a valid approach as long as the other columns do not change. If they do, the entire window must be erased before repainting, otherwise it will paint over the previous display, resulting in incorrectly drawn text or other cell contents.
To get the rectangles, you can either test different kinds of values which suits the situation best, or you can get each cell in the 2nd and 3rd column independently and use GetClientRect to fetch their rectangles. Easier way is, of course, to fit a rectangle to cover the two columns just by testing different values. It takes time, and patience, though.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi nnvidya,
Try this: http://www.codeproject.com/vcpp/gdiplus/what_is_a_basename_.asp
In my experience, this works. Also check out the article by Keith Rule that the author mentions.
Good luck,
Mick
|
|
|
|
|
hi ! thru : bool CreateMsgService(LPTSTR lpszService, LPTSTR lpszDisplayName)
we can create a service , but that pops up a property sheet page thru which user has to enter data to create the service.How can we fill in the information programatically ? I have seen a lot of applications automatically add services.I thought of two possible ways.One is that they might be an option using some other API or modified version of this one, or else use Inter process communication to send a WM_MINIMIZe to the property sheet page , and then using SetWindowText( ) after retrieveing the windows handle and detecting the fields.This is theoritically possible but sounds a bit clumsy isn't it ? I am sure it is possible somehow...you have any idea ?
Can you also explain to me the usage of ConfigureMsgService ? I could not find the proper docs in MSDN..
Thanks in advance
Regards
Kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason ,huh ?"
|
|
|
|
|
HI ,
Can any one tell me how can i send data to paralle port . n how can i recive from it
i think there is also a difference to send and recive on windows 98 and on NT n XP
is it
plz send me any sample
thanx
|
|
|
|
|
Hi,
You can use platform SDKs File Storage operations also for writing and reading data from communication resources (such as parallel and serial ports).
Check out CreateFile() , WriteFile() and ReadFile() from MSDN.
Cohen
|
|
|
|
|
Why do MS prefer to provide a new function, CWnd::CreateEx, rather than override CWnd::Create()?
|
|
|
|