C++ :: Enable / Disable Menu Item
Nov 19, 2013
I have ploughed through the exchanges in all the forums, yet I still cannot make it work. The following is a tiny Code::Blocks program, written to isolate the problem:
// resource.h
#define IDR_MYMENU101
#define ID_FILE 102
#define ID_DISABLE103
#define ID_ENABLE 104
#define ID_MESSAGE105
#define ID_EXIT106
[code].....
case ID_ENABLE is similar to case ID_DISABLE above, and neither works. case ID_MESSAGE and case ID_EXIT both works as expected.I have tinkered with EnableMenuItem(), but without success.
View 8 Replies
ADVERTISEMENT
Sep 15, 2014
I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?
Code:
void CDummyView::OnUpdateMenuItem1(CCmdUI* pCmdUI)
{
if(m_bShowMenuItem1) {
pCmdUI->Enable(TRUE);
[Code]....
View 14 Replies
View Related
Jun 22, 2014
i have tried to search on the Internet but haven't found a suitable result that links in with what I want to do, that is to creation a WPF application and when you press a enable button it will enable the LAN and when I click the disable button it will disable the LAN until i click the enable button again. Now I know how to creation a WPF and the buttons, but how would I do the disabling LAN and enabling LAN?
By LAN i mean just the networking adapters, so that the PC cannot connect to a router and then the Internet.
View 14 Replies
View Related
Nov 10, 2014
I have made a menuitem using the combo box, but when I add items in like in the image below:
[URL]
My problem is that when I move my mouse over the item it displays this darker box around the text:
[URL]
This stops me from clicking it and the code from being executed.
View 2 Replies
View Related
Sep 7, 2014
how to create a context menu but none of them discuss how to actually fetch the selected menu item?
if (e.Button == MouseButtons.Right)
{
ContextMenu m = new ContextMenu();
m.MenuItems.Add(new MenuItem("Font Size 8"));
m.MenuItems.Add(new MenuItem("Font Size 9"));
m.MenuItems.Add(new MenuItem("Font Size 10"));
m.Show(listBoxChecklist, new Point(e.X, e.Y));
//tempString = m.?????
}
View 3 Replies
View Related
Aug 6, 2014
I'm using this tutorial for making an owner draw menu. [URL] ...
When I go into the .rc file and remove all of the MENUITEM SEPARATORs all the menu options are squished to the left of the menu as in the screenshot. As long as there is just one MENU SEPARATOR anywhere the menu is fine. If I could make the application without MENU SEPARATORs that would be awesome.
View 7 Replies
View Related
Feb 25, 2015
I know how to add a new item to a folder right-click menu, using the registry, but it won't show up on file right-click menu. give me a link to how this is done? I want this new menu appear on every file R-C menu, file registered with the system or not. Is there a simple way to do this as adding a item to folder R-C menu, or will i have to iterate all the registered file types in registry to do it. I tried google with many search terms, but i can't find a source for this.
View 8 Replies
View Related
Feb 21, 2015
I quite often use an ide written in assembler: RadAsm3[URL] .....
It has a menu item to explore current path. I have used other ide's that have a similar feature but:
The one in RadAsm3 will activate a current Explorer window if the current path is the same as the one requested.
All others open a new Explorer window.
I would like to implement the RadAsm3 approach using Visual Studio 2013 Community c++ as my host compiler for testing.
I tried to get the title of current windows but it appears ShellExecute "explore" does not produce a conventional window???
View 1 Replies
View Related
Aug 19, 2013
I am trying to write a menu program that will be broken down into a series of calls to function for each of the menu items. Two of the menu items will be simple programs which I wrote.
I want two of the functions to run one of the two programs I am trying to include as items in the menu.
So far I am only familiar with variables, loops, if statements, and I just learned how to write functions.
The problem I am have is that I don't quite understand how to write a function that will run one of the two programs. Also I am having a hard time writing the program in away that would allow the user to select the menu items.
View 2 Replies
View Related
Apr 7, 2014
I'm creating a program that is based on a menu system. Basically each menu is its own user-defined function. The problem is at each menu you can input 'b' to go to the previous menu. I just have it call the function of that menu.
However, do the functions need to complete themselves eventually? If I just keep calling functions will I just keep going further and further deeper into ever running functions?
If so how do I avoid this and yet keep the option to go back to a previous menu/function?
View 2 Replies
View Related
Apr 7, 2014
This is what I have so far, it gives me a nice menu to select from and it all works but after I make a selection it closes the program. I tried to return to it but it won't work for me
#include <stdio.h>
int main() {
int choice;
int deposit;
int balance = 500; {
printf(" CHOOSE FROM THE FOLLOWING
[code]....
View 14 Replies
View Related
May 6, 2014
How do i disable the interrupt in this ARM M0 univesity design start program? The design is made for the M0 and echos an inputted char as an integer, it is part of a larger piece of code (which is ommitted for simplicity).Can i do it in the main program(attached) or will i have to edit the assembler code.
Code:
// Cortex-M0 DesignStart C program example
#include <stdio.h>
#include <time.h>
#include <rt_misc.h>
#include <stdlib.h>
}
[code]....
View 2 Replies
View Related
Dec 27, 2014
I want to disable optimization in Visual C++ 2010. In gcc on Linux I could just use the -O0 switch, but in Visual C++ 2010 there are two categories of optimizations, one in the C/C++ pane and the other in the Linker pane:
Attachment 33229
So what settings should I choose to make sure that no optimization is being performed?
View 2 Replies
View Related
May 23, 2012
I have an application in c# that i don't want it to connect to the internet in a virtual environment, like virtualbox, vmware virtual pc and so on. Therefore i though that disabling the virtual network card inside the virtual machine would be a good idea.
View 3 Replies
View Related
May 3, 2012
how to disable selection of 1'st row in dataGridView.
I made it select some other row, but even so when u try to move with arrows on keyboard it'll select 2'nd row(cause 1'st row was selected initially and you can see it's selected on RowHeader-1'st/Left Column)
This is my code for selecting row:
dataGridView1.ClearSelection();
dataGridView1.Rows[BoPrI].Selected = true;
dataGridView1.FirstDisplayedScrollingRowIndex = BoPrI;
BoPrI is int variable that has Index Value
View 6 Replies
View Related
May 22, 2013
working on this code I have encountered a few issues. My program lists the occurrence of each letter but i'm unsure of how to enable numeric variables. how to improve the overall quality of the code.
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char string[100], ch;
int c = 0, count[26] = {0};
printf("Enter a string
[Code]...
View 4 Replies
View Related
Sep 17, 2014
template <typename FIRST, typename... REST, typename std::enable_if<std::is_convertible<FIRST, Base*>::value>::type* = nullptr>
void foo (FIRST first, REST... rest) {}
that successfully allows me to enable the function foo() only if FIRST is convertible to Base*, but I also only want foo() enabled if each type in REST... meets the same condition. What is the syntax for that? If no such syntax exists, how to achieve that effect?
View 7 Replies
View Related
Dec 5, 2012
I have a version of an app in 64bit but the problem is under program files on windows 8 64bit it doesn't have access to the programs files folder... usually virtualization will redirect it to the virtual store but with 64bit exe's this doesn't happen automatically. How do I enable it in code or in the manifest file?
From MSDN:
Virtualization is only enabled for:
32 bit interactive processes
Administrator writeable file/folder and registry keys
Virtualization is disabled for:
64 bit processes
Non-interactive processes
Processes that impersonate
Kernel mode callers
Executables that have a requestedExecutionLevel
View 1 Replies
View Related
Jun 6, 2013
I have created an exam environment for our schools, it comprises of 3 files; a .kix file that says if they are in the examination group run a .vbs file. The .vbs file kills the explorer.exe task so they don't have any taskbar or desktop shortcuts and then opens a .hta file.
The .hta file is a user interface that has icons for apps like Win Word that executes the application when you click on it. There is also a log off button.
Looking for some code that stops the students from being able to close, minimise and resize the window. Looking for code that can lock this down so they literally can't do anything except click the icons inside the window.
View 3 Replies
View Related
Dec 27, 2013
Arrays are by far the most fun to work with and I really need see if its possible to enable an array to count apples, pears, peaches, from a group of three each.
If any of the fruit groups were chosen how might an algorithm be put together to count how many were chosen from each group. But lets take into consideration that these fruit groups are not supposed to be randomly generated, instead they belong as an array with certain amount of chosen occurrences. To show how many fruits were chosen from each group example, 1 from group 1, 2 from group 2, 3 from group 3 the out put is the important part because it shows the group and the occurrence of that group. the algorithm should be able to display the group with an occurrence as well
View 1 Replies
View Related
Nov 26, 2012
The example enable a client to iterate the internal std::vector using being() and end().
Code:
class foo {
public:
typedef std::vector<std::string>const_iterator iter;
iter begin () const;
iter end () const;
[Code] .....
In the future I see the need for this class to be able to control sequence (sorting) and also show a subset of the complete list based on a search parameter.
Using std::sort appear to solve the ability to sort the collection.
How can I return an iterator to the client which only iterates a sub-set of all items in the std::vector?
An example would be, I add this method to the class;
Code:
void find(const std::string& st);
So if the client performs (below) only items in std::vector that contains the character "a" should be possible to iterate.
Code:
foo f;
f.search("a");
One option would be to operate with two collection inside the foo class. One more static containing all items and the other containing the sorted and filtered items. This would lead to some copying but should work. Far from perfect.
View 2 Replies
View Related
Apr 19, 2013
I need to be able to disable the items on a CCheckListBox but I can't change the code that calls AddString. I know I can use the CCheckListBox::Enable function to disable an item if I have an index but I don't have the index which would be provided by AddString.
I've tried intercepting the LB_ADDSTRING message and then looping through the items in the control but the string has not been added at this point so the last item in the list is never disabled.
I used Spy++ to see what messages were being sent and I noticed that LB_GETTEXT was sent so I tried intercepting this message (ugly hack) but this caused my app to hang - I assume because of the number of times the message is sent. Is there a way to disable the items?
View 10 Replies
View Related
Apr 29, 2015
Using C . I have been tasked (for a University assignment) to create a program that will enable a user to upload an image and convert that image into ASCII text using SDL on a Linux system. I've managed to open a window, display an image (non-selected) and convert it into grayscale using
case SDLK_g:
for (int y = 0; y < image->h; y++) {
for (int x = 0; x < image->w; x++) {
Uint32 pixel = pixels[y * image->w + x];
Uint8 r = pixel >> 16 & 0xFF;
Uint8 g = pixel >> 8 & 0xFF;
Uint8 b = pixel & 0xFF;
Uint8 v = (0.212671*r)+(0.715160*g)+(0.072169*B)/>;
pixel = (0xFF << 24) | (v << 16) | (v << 8) | v;
pixels[y * image->w + x] = pixel;
I am absolutely clueless as to how I can get the user to upload an image to the program and then begin the image -> ASCII conversion. I've found seem to be written in C++ or C# to make the conversion I should be using the GetPixelColour command?
View 14 Replies
View Related
May 13, 2013
Perhaps this can be a very popular error,
Code:
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <fstream>// enable writing to and reading from files
#include <cstdlib>
#include <time.h>
using namespace std;
class Person {
[Code] .....
Error list:
Code:
Error 1 error LNK2019: unresolved external symbol "void __cdecl saveperson(void)" (?saveperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 2 error LNK2019: unresolved external symbol "void __cdecl displayperson(void)" (?displayperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 3 error LNK2019: unresolved external symbol "void __cdecl editperson(void)" (?editperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 4 error LNK1120: 3 unresolved externals H:Cry_DevProgrammingC++Using_class_ in_ c++DebugUsing_class_ in_ c++.exe 1
What I can do to fit this problem?
View 14 Replies
View Related
Mar 4, 2014
What the code below is not doing is returning a value for item to my variables (item1, item2, etc..) I'm not sure how I can make a function prototype that will ask for input and basically recycle after going through the program to a new value for each item. I also need to input individual tax for each item. I will also post it in this message:
double tax, item,salesTax;
double cost(double);
double CalcSalesTax(double);
main(){
double total,item1, item2, item3, item4, item5, tax1, tax2, tax3,tax4,tax5;
[Code].....
View 13 Replies
View Related
Aug 17, 2014
I'm having a problem with removing an item from a queue. At first in the debugger I got SIGTRAP but I don't get it anymore but the problem still exists. When you try to remove an item from the queue the first nothing happens. Here's the code below compile it and you see what I'm talking about.
Code:
#include <stdio.h>
#include <stdlib.h>
struct Node {
char let;
struct Node *nextNode;
};
[code]....
View 12 Replies
View Related