I'm working on an app which monitors user selected data sets from various devices, and I'd like to display the data in a CListCtrl. This would be very convenient, but I'm just a little concerned about (1) just how fast can a CListCtrl be populated, and (2) how can i reduce or eliminate screen flicker. To be specific...
1. There will likely be upwards of 100 rows of data, maybe more (probably 5 or 6 columns), and I'm going to have to refresh it all as quickly as possible, perhaps as fast as once per second. I can play games and only refresh a visible rectangle, but how responsive the control would be, having all that data deleted and refreshed continually?
2. You can see why I'd be worried about screen flicker, and I thought I'd likely have to make two identical overlapped controls so I could double buffer as I would with a graphic animation, switching the visibility of one or another control after its updated to give the appearance of sudden complete updates. BUT... I see there is an extended style you can set called "LVS_EX_DOUBLEBUFFER"
I have a CMFCToolbar containing a CMFCComboBoxButton which needs to be updated via a view. The view correctly updates the selection of the ComboBoxButton however the edit window is not updated until the control receives the focus or the entire window is redrawn.
How can I force the redrawing of the control to show the updated selection via the view
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.
I have a ListCtrl on my dailog. It has a report view. In my case I have selected first row with left click of mouse and entire row is displayed in blue color as selection (as per expected) and when I right click the second row of the listctrl it displays the menu which I have added to it and the selection remains with the first row.(as expected). I have already overridden the ListCtrl class.
I want that on the right click of second row the selection should remain with the first row but this second row also should be displayed with dotted line border.
I need a ownerdraw CListBox where I can change the item height during working with the list. The msdn says that I can specify the height in OnMeasureItem when the listbox will be created (ownerdrawfixed) or when an item will be inserted (ownerdrawvariable).
How to change the height e.g. when I click a button?
I made also some tests with CListCtrl. There I can change the height. But there is only one height for all items. How to set individual heights for the items?
I am working on a windows application that is for make a time schedule for all staff. i am using two gridview one for all staff names from employee table , and second is for time schedule, time schedule DGV is like 6to7 , 7 to8...12to1,... 5to6 columns . when user will select like 7to8 , 8to9,9to10, columns with holding ctrl key , thn i have to assign some work beteen these time for 3 hours. So i have to get multiple columns from Gridview.
I am writing a program in Visual C++ 10 with 2 forms.
In the first form I have a textbox and a button. The button opens the second form.
In the second form, I have a button that changes the text in the textbox in form1 to an item from a listbox in form2.
Here is my problem. When I do the code for the button in form2 to change the textbox in form1 I get the errors:
error C2065: 'textBox1' : undeclared identifier error C2227: left of '->Text' must point to class/struct/union/generic type
I thought maybe I should just include the "Form1.h" file but I can't do that because I already included "Form2.h" in form1 in order to be able to open the second form. If I try to include form1 in form2, it says that the code to open form2 is an error now.
My question is, how can I access identifiers such as "textbox1" from other forms and other files when I already used the first form to open the second form? I also want to know how to do this for all identifiers between all files.
how to print the selecteditem from a listbox into a textbox because that doesn't work by just setting them equal either.
Here is my code:
#pragma once #include "Form2.h" namespace Test1 { using namespace System;
I am using a CEdit control as a child in a CListCtrl for purpose of making each column editable. The application is a dialog based app. My problem is... I have overwritten OnOK and OnCancel in the main dialog so the edit control never receives notifications for Escape or Enter whether in OnChar or PreTranslateMessage and I would like to delete the CEdit control after updating the CListCtrl on Enter. What can I do? I have rewritten this code many many times over the past 4 days and nothing is working.
I'm writing a Hotel magmt app. I'm having difficulty on how to implement a hotel attendant selecting/secure multiple rooms(with nos) for a Customer using combobox or listbox or something. How my interface will look like and techniques.
I have a listbox that retrieves a bunch of values. I'm able to selectAll, Select None and Select Individual items. I'm not able to search the ListBox and select based on String value.
I have tried creating a for and if loop, but it will only select a single item (first item) in my ListBox.
private void btnSelectCAD_Click(object sender, EventArgs e) { // Find CAD Line Patterns that Begin with IMPORT: string mySearchString = "IMPORT"; // Search Listbox starting from index -1: int index = lstLinePatterns.FindString(mySearchString, -1);
tell me the EASIEST way to create a button with an image on it.
I am not interested in using the owner draw property with CBitmapButton and then have to create a whole lot of bitmaps for all the different button states.
There must be a way to simply create an ordinary button which displays an image rather than or as well as a caption....?
I have a MFC dialog project, I move all the icons including the IDR_MAINFRAME icon into a resource-only DLL, so there is no icon embedded in the executable file. In the dialog initialization, the dialog loads the icons using LoadIcon(hResdll, MAKEINTRESOURCE(IDI_MYICON))). The icons shows correctly on the dialog.
But in the Windows Explorer, the icon of the .exe file is not the icon of IDR_MAINFRAME, I check the resource file in the resource-only dll project, the ID number of the IDR_MAINFRAME is the lowest one of all icon ID numbers. I also try
I'm developing a software for Windows using MSVC 2010. My employer sent me 2 png files: 16x16 and 32x32 for the icons.
What I would like to do is to use them as a MSVC icon resource and don't use any code hacks. In the past all I had was an ico file and I just included it in the resource (rc) file for Visual Studio and that was it.
Now my question is: how do I make one ico file out of those 2 png files that will be accepted by MSVC? Is there a tool (preferably free) for it or some online service?
how to change the mouse tracking icon during runtime. I wish to emulate the Microsoft Paint app behavior with respect, for example, to click on a toolbar button such as the 'Fill With Color' bucket and have the mouse pointer icon change to a little bucket. I wish to do this in an MFC SDI app.
Here's a bit of code that does nothing that I can tell, although it compiles and runs. (m_hIcon2 is a member HANDLE, IDI_FLOODFILL is an existing icon in the app resources). I have come across numerous other examples that do not work and/or will not compile using VS 2010 Win7(64).
Where in registry the Explorer stores tray icons visibility settings? (Always show, show only notifications, or always hide.)
I know that Microsoft doesn't want us to change these from a program, which may be OK for a home computer, but it becomes a major pain in the ___ for an enterprise environment (as there seems to be no GPO to do this either.) I've seen couple commercial products that were able to do this, so I'm sure there's a "hack" somewhere...
I made a dialog to have a customizable msgbox. (custom icon, custom caption on buttons). This is how I try to display an icon on the dialog but it is not working.
If I don't assign the icon to my executable file (f.e. it's a DOS application), or I have some unknown extension in the file, Windows Explorer assigns the icon to this file.
Is there a way to somehow get this icon? Either from the registry or by any other means.
Is it possible to see what usb devices are connected to a hub?
An example would be:
Onboard usb hub: usb mass storage device webcam imaging device
superspeed hub: Mass storage device Printer MTD device
I am currently able to get a list of all connected devices with ManagementobjectCollection in C# but that doesn't give me any hierarchy (as far as I am aware).
I am not dead set on C#, I assumed that would be fastest way to get this up and running.
I have a program I have been working on where the user selects a date and enters the number of days to be viewed in the Calendar.cshtml view. This input renders another view (Update.cshtml) that contains two date picker boxes, one that should contain the selected date and the second one that should contain the calculated date. I am having an issue getting the date selected in the first view to populate to the first date block on the second view as the default and getting the calculated date to populate the second date block in the Update.cshtml view. In addition given the two dates, I would like to generate a calendar, which is why I chose the date picker approach and setting static dates.
Here is my code:
**CalendarController:**
using System.Web.Mvc; using VanickCalendarApp.Models; using System; namespace VanickCalendarApp.Controllers { public class CalendarController : Controller {
1. Using a CScrollView as the View class type. 2. Using Document/View Architecture. 3. Insert multiple Common Controls such as CEdit, CButton, CListCtrl into the View dynamically. 4. All the Common Controls is base on a template created by user. So I do not know the quantity of the Common Controls.
This is the plan on how to do it:
1. In View OnInitialUpdate(), read the template to get all necessary info on the Common Controls to be create. 2. In View OnInitialUpdate(), create all Common Control. Some Common Control may not have WS_VISIBLE as it may not needed at initial stage. 3. In View OnUpdate(), I need to refresh the Common Control properties such as is its text, position or its visibility. This should happen if Document call UpdateAllView().
My Question: 1. Is this a normal & useable plan? 2. Do I miss other functions for any other messages? 3. Still wondering if I need to involve any coding in OnDraw() for this plan.
How would I go about selecting a subitem in a listview control with just pure Win32 API? I know it's possible with MFC... but I can't use MFC for this project. Right now, when you click on a subitem , it selects only the first column of the row . I used the following by referring internet. But its not working.
HTML Code: iSlected=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED|LVNI_SELECTED); ListView_SetItemState(hList,iSlected,LVIS_FOCUSED|LVIS_SELECTED,0x000F);