|
sorry,
i put FALSE only,now i changed in my post.
even if false was put not working
shakumar
|
|
|
|
|
In which function are you trying to do this?
-Saurabh
|
|
|
|
|
thanks for u'r reply
at run time i want to disable the button , it may be from thread or any other class.
shakumar
|
|
|
|
|
I understand that you want to disable the button at run time but where exactly are you adding the code to do that. It seems that you are adding the code before the view is created.
-Saurabh
|
|
|
|
|
i want to disable the menu bar button at run time from thread.
Disable may be happen from some thread function.
from thread means i want the Menu Bar Button handle.
i can do the Normal Button like this, by getting the handle,but for this menu bar button icant get,if do like the normal button it crash the application.
CButton* but=((CButton*)GetDlgItem(ID_FILE_NEW));
but->EnableWindow(FALSE);
shakumar
|
|
|
|
|
simply add ON_UPDATE_COMMAND_UI event handler for that menu item.
and disable menu item. like pCmdUI->Enable(FALSE);
For eg: in your view class in message map add:
ON_UPDATE_COMMAND_UI(ID_FILE_NEW,Test);
and define test as Test(CCmdUI* pCmdUI); in the header file.
in the cpp file for your view use
CMyView::Test(CCmdUI* pCmdUI)
{
pCmdUI->Enable(false);
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Friday, June 13, 2008 1:44 AM
|
|
|
|
|
Thanks for u'r Reply
its working fine.
but my requirement is I want to disable the File or Edit button from the another class ie : by getting the button handle, through that i have to disable from another class.
regards
shakumar
shakumar
|
|
|
|
|
Then get a pointer/handler to your view and call the methode from the other place.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
A menu isn't a dialog, calling GetDlgItem() on a menu is meaningless. UPDATE_COMMAND_UI is what you use to disable commands in the menu and toolbar.
|
|
|
|
|
Hi!
I'm working in a VC++ Project under VC++ 2005. In Release mode,it runs fine. It shows me an exception only under Debug mode. Here it is:
Unhandled exception at 0x00448b61 in test1.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
When I break this exception, the pointer goes to a file ref_ptr which is not defined by me. It's a Delta3D Engine's(Simulation Engine)file. What to do to resolve this exception?
|
|
|
|
|
This mean you are trying to access a pointer that has been deleted. Since this is happening in external library code it might mean either there is a bug in the library or more likely you program has a bug.
-Saurabh
|
|
|
|
|
What to do make the program run,
(i)if the problem is with external library?
(ii)if my program has a bug?
Regards,
Rathakrishnan.T
|
|
|
|
|
T.RATHA KRISHNAN wrote: (i)if the problem is with external library?
Report it to the library vendor (if there's a scope) or if you have the source code for that library, fix it yourself. If you don't have the library code, well, try to dodge this bug; find out how this issue occurs and if there's a way to prevent this bug from crashing your program.
T.RATHA KRISHNAN wrote: (ii)if my program has a bug?
Fix it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Simplest way is to step through your program and check where is the crash. Then try to find out why a pointer was used after it was deleted.
-Saurabh
|
|
|
|
|
T.RATHA KRISHNAN wrote: When I break this exception, the pointer goes to a file ref_ptr which is not defined by me. It's a Delta3D Engine's(Simulation Engine)file. What to do to resolve this exception?
Open the call stack. That will help you locate the problem in your code. Then, you'll be able to put breakpoints a bit before the crash occurs in your code and check if everything looks as expected.
|
|
|
|
|
how to add a integer value in a listbox???
Raja
|
|
|
|
|
CString strTemp;
strTemp.Format("%d",iValue);
m_ListBox.AddString(strTemp);// Or m_ListBox.InsertString(-1,strTemp);
Regards,
Sandip.
|
|
|
|
|
is it possible to add strings horizontally???
for example,
event 2000 3000
name 4000 3000
Raja
|
|
|
|
|
See replies to your previous question here[^]
Regards,
Sandip.
|
|
|
|
|
I think its better you try to it then you can see its possible or no?
|
|
|
|
|
Adding can be added if you concatenate the strings for every line, but you are not going to be able to select the different "sub strings" only the whole line. If you want to make every "sub string" able to be selected, you should better use the CListCtrl in report mode
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
how to use clistctrl???what method should be used for adding strings horizontally??
Raja
|
|
|
|
|
Take a look into codeproject to have an idea about how it works is better than if I give you the solution.
Rows are ITEMS, columns are SUBITEMS.
You have to create the CListCtrl and determine how many columns are going to be there, for that... take a look into function SetExtendedStyle (...), struct LV_COLUMN, functions DeleteColumn (), InsertColumn ()...
then you have to insert the contents of each subitem (column) in one item (row), and when you have it, then add the row to the control, for that take a look into the struct LVITEM and function SetItem (), DeleteItem () or DeleteAllItems ().
Hope it helps
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
TCHAR tch[10];
_itot(33, tch, 10);
m_list.AddString(tch);
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
1.In my application, i have a window which shows the image of clock and as per the system timing the needle in the clock image is moving by using Lineto() function.
2.I used one dialog that by presssing button in that dialog im displaying system time for every second in List ctrl.
My problem is..When the button is pressed, the clock shows the correct needle position..But when Listctrl showing system timings reached 55 seconds, the needles in clock in the main window get distorted and drawing needle line somewhere else in the clock image.
Im using OnTimer() for clock class(View class) for displaying clock with needle and for Button(Dialog class) fro diplaying timins in listctrl.
I dont know why this get crashed.Its all seperate OnTImer function.
Anu
|
|
|
|