Visual C++ :: Disable CCheckListBox Items Without Access To Code That Calls AddString

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


ADVERTISEMENT

C++ :: Menu Program Broken Down Into Series Of Calls To Function For Each Of Menu Items

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

C/C++ :: Code That Recursively Calls Itself And Prints Given Digits In Ascending Order

Mar 15, 2015

I'm trying to implement a code that recursively calls itself and prints the given digits in ascending order, i.e. if the number is 5, then the function will print 1 2 3 4 5. I cannot use loops in any way!

The problem I have is with keeping my variable i at a set value each time the function calls itself.

void print_ascending(int n){
int i = 1;
if(i < n) {
printf("%d", i);
i++;
print_ascending(n);
}
}

Of course, the problem with this code is it will re-initialize the variable i to 1 every single time and infinitely loop to print 1.

View 11 Replies View Related

Visual C++ :: How To Disable Optimization

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

Visual C++ :: Disable Controls And Change Window Size

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

Visual C++ :: How Many Items Exist In A Dialog Box

Sep 11, 2013

I was wondering how can we know how many items exist in a dialogbox? If there any way that i can get the items ID in a dialogbox by having just the dialogbox's object or handler? Or any way that we can get a dialogbox content by coding.

View 6 Replies View Related

Visual C++ :: Control For Owner-drawing Items With 1 Or 2 Columns?

Jan 22, 2014

I want to show a list of graphical items in 1 or 2 columns (user selected). I will draw the items (owner-draw). I tried many hours today to find a solution with clistctrl. Is it possible to make it with clistctrl?

View 14 Replies View Related

Visual C++ :: Finding Items (strings) In Multiple Lists

Mar 12, 2013

Im working on a script compiler and i need to handle different types of data. Actually different categories of items.

Let's say i have two categories: cat's and bird's. They are different and stored in different lists. And let's say there is a simple command: GIVE_FOOD_TO(animal_type, food_type) Animal type here can be either from birds category or cat's category.

And also let's say user gives command: GIVE_FOOD_TO(cat1, fish)
and also for example: GIVE_FOOD_TO(bird1, birdfood)

Variable names could be anything, but im storing each variable name in std::map so later i can figure out with what animal current command is used.

When im parsing the script then i must know if user supplied either cat or bird. If i just would have cat's or bird's category then i would have only 2 lists and not a big problem to loop through either cats list or birds list and find out in what list the "cat1" is or in what particular list the "bird1" is. It would be in one or another.

But i have a lot of categories and looping through all of these lists (or std::maps) is slow and doesn't seem like a good. Just to find out in what list it's stored. I can't rely on variable names, they could be anything.

Big picture atm:

1) I have one BIG box which stores all of the categories

2) When i need to find out to which category the variable (animal_type) point's to i must get it quickly, dunno, std::map in std::map or something?

What i need basically is: I have different lists (each one is just a category for either birds or cats in this example) And when i have variable name, i must find out quickly in what particular category this item is stored. So i can work with it.

View 4 Replies View Related

Visual C++ :: Design Class Objects To Support Outlining Of Collection Of Items

Sep 9, 2013

I am struggling with how to efficiently design my class objects to support the outlining of a collection of items. The collection would be sorted but would also have the ability to indent and outdent individual items representing a Parent and Child relationship (see attached).

An item could indent up to 5 levels deep. A summary level would be considered a Parent while items below the summary level would be consider as children.

View 6 Replies View Related

Visual C++ :: How To Use CListCtrl For Show Multiple DialogBoxs Like Items In Icon View

Jan 15, 2014

i can write a mfc program to make a Thumbnail view with image but can not this when change image with CDialogBox.

Thumbnail view with image(chart) like this:

for (int i=0;i<10;i++) {
CChartContainer *cc = new CChartContainer();
if(cc->m_frmWin->Create(_T(""),
WS_CHILD|WS_VISIBLE|SS_BITMAP, rc,
this,idDyn)) {
}
}

how can i write mfc program to make a Thumbnail view of CDialogBoxs?

do i can use CListCtrl for show multiple DialogBoxs?

View 13 Replies View Related

Visual C++ :: Enable / Disable Menu Item 2 In OnUpdate Handler Of Menu Item 1?

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

Visual C++ :: Tool Tips Not Showing - Toolbar Menu Items Disabled / Inactive

Jan 8, 2014

My problem is ToolTips are not shown if any of the tool-bar menu items is disabled/inactive.

They are shown when all tool bar menus are active/enabled.

I am using TTS_ALWAYSTIP while creating Tool-Bar.

What to do to enable/display tool-tips always.

View 5 Replies View Related

C :: Disable Interrupt In ARM M0 Program

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

C# :: How To Disable And Enable LAN Connection In WPF

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

C# :: Detect And Disable Network Cards

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

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 View Related

C Sharp :: How To Disable Selection Of 1st Row In DataGridView

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

C# :: DB Calls Via Tasks?

Jan 6, 2015

I have a multi-thred piece of code that should be fast. As I have to update a Database from time to time, I wonder if I do it in a prpoer manner with calls like this:

Task.Factory.StartNew(()=>update_execution_to_db(exec));

Those are my sporadic updates, my ongoing update have a queue and a dispatcher thread reading from the Q, I just don't want to use this overhead for the sporadic updates.

View 6 Replies View Related

C++ :: Calls From Ancestor

Mar 7, 2012

Code:
class A {
virtual method1() { };
};
class B : public A {
method1() { }
}

Code:
A* a = new A();
a->method1(); // call B's method1?

Is it possible to call B's method1 in this case?

View 8 Replies View Related

Visual C++ :: How To Access IHTMLDialog

Aug 17, 2013

I am writing a program to auto login to a website. But when password is wrong a dialog box appears.

I am not able to quit the Internet explorer. How to access the dialog box and if possible access the DOM of the dialog box

View 3 Replies View Related

C :: Way Recursive Calls Actually Works

Apr 27, 2013

This is simple recursive solution of Fibonacci number:

Code:

int fibo(int n)
{
if(n<=1)
return 1;
else
return fibo(n-1)+fibo(n-2);
}

Now the recursion will generate a large recursion tree, like if n=5, 5 will call (5-1), (5-2) or 4,3 . What I want to know is, will fibo(n-1) will be called 1st go all the way to the base case 1, then do the summation or fibo(n-2) will be called right after fibo(n-1) ?

View 6 Replies View Related

Visual C++ :: Access From CDocument To CMDIChildWnd?

Nov 25, 2012

I'm developing an MDI(MFC) application (with MSDEV 2010) that creates few pairs of doc-view.

From the CDocument object I want to access the CMDIChildWnd object to update the status BAR.

How can I do it ?

View 5 Replies View Related

Visual C++ :: How To Access Argv Strings

Dec 22, 2012

I have:

int _tmain(int argc, char* argv[])
{
printf("drive name: %s
", argv[1]);

It displays only the first character of the first argument on the command line.

Yet the following works as expected:

static char* myArg[2] = {"first arg","second arg"};
printf("drive name: %s
", myArgv[1]);

That displays the entire string "second arg".

So what's wrong with my reference to argv[1]?

View 4 Replies View Related

C++ :: Cancel Destructor Calls In Operator

Apr 18, 2014

Let's start with something from the c++ reference:

... delete[] is an operator with a very specific behavior: An expression with the delete[] operator, first calls the appropriate destructors for each element in the array (if these are of a class type) ...

I was wondering if I can tell delete[] to not call destructors, for example if I already know that the delete[] statement should be delete without []. That would be very useful for memory management/memory leak detection.

View 12 Replies View Related

C/C++ :: Multiple Malloc Calls On One Variable?

Feb 13, 2013

I'd like to know what happens if I use multiple calls to malloc() on one pointer (without free) in a single function. Here is the example:

void *data_thread(void *sockfd_ptr) {
  int sockfd = *(int *) sockfd_ptr;
  const int BUFSIZE = 5;
  char recvmessage[BUFSIZE];
  char *headerstr = NULL;
  char *newheaderstr = NULL;

[code]....

what happens with newheaderstr every time malloc() is called. There isn't a realloc() or anything. I didn't think it looked right to keep using malloc() like that.

View 4 Replies View Related

C++ :: Lines Without Semicolon - Function Calls?

Aug 28, 2013

The below code is taken from open source filezilla project

(FileZilla_3.7.3_srcfilezilla-3.7.3srcinterfacebookmarks_dialog.cpp)

Code:
#include <filezilla.h>
#include "bookmarks_dialog.h"
#include "sitemanager.h"
#include "ipcmutex.h"
#include "themeprovider.h"
#include "xmlfunctions.h"
BEGIN_EVENT_TABLE(CNewBookmarkDialog, wxDialogEx)
EVT_BUTTON(XRCID("wxID_OK"), CNewBookmarkDialog::OnOK)
EVT_BUTTON(XRCID("ID_BROWSE"), CNewBookmarkDialog::OnBrowse)
END_EVENT_TABLE()

I'm unable to understand what are these lines after the #include. They don't end in semicolons. Looks very much like function calls.

Are BEGIN_EVENT_TABLE, EVT_BUTTON and END_EVENT_TABLE function calls? Function calls should end with semicolons right?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved