C# :: Delete Image That Was Previously Shown In ItemsControl
Dec 22, 2014
On line 128 I'm attempting to delete an image file that was previously shown in an ItemsControl, but was removed by line 126. So the image is not being shown in the program at the time I'm wanting to delete the file.
Error:Additional information: The process cannot access the file 'c:StudioExit PopupKeith Sketch.png' because it is being used by another process.
My Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
I'm using web cam to save,update the image in base directory folder.I can save the image but, while attempting to update the image..I caught an error!!
C#.Net: The process cannot access the file 'C:..~..inDebugcustomer_photos10.jpg' because it is being used by another process.
I am currently taking a C# class. Our current assignment has us entering a player name, and number of hits and displaying these in one set of labels. I have coded everything for the primary function of this program and it works. However, I also have to have a second set of labels that show the highest number of hits entered (if I enter 44, the first and second labels change to 44; if I then enter 27, the first label changes to 27 and the second stays at 44; and if i enter 55, the first label changes to 55 and the second label changes to 55) and the corresponding player name. I have tried searching and reading and I can't seem to figure out how this is done.
I have a question about memory allocation.I have a function that calls a lot of object constructors, which in return these constructors will allocate a lot of memory.Now, in my program I am sure that if I first call this function , say it will call the constructor of 100 object.If I call this function again and again, I am sure that it will only call the constructor 100 times again, and thus I am sure that the memory allocated in the first call can be reused again.
How can I reuse the memory allocated in the first call?Can I use something like boost:object_pool so that I can tell the pool to restart from the begining and do not allocate extra memory, just use what you already have?
I have a small questions in the behavior of Structure, I have declare a structure with 10 components. Some of the components in the structure has already their value but when I use
The structure components in a function DLL function those value I set previously has been deleted or empty. I don't know what is the problem...
The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).
I'm having trouble reading my data from a .txt file into a structure of the format shown in my code. I've made my student database in the program below based on user input and I didn't have a problem with that, but now it's come to input from a file it's making it difficult.
My three tasks are:
(1) A table containing 1 row per student, containing the student ID number and all of the student's marks.
(2) Another table, containing 1 row per student, containing the student ID number and the average mark obtained by that student.
(3) The average mark for each subject.
The assumptions to be made are: The student ID can begin with a zero, and should therefore be read in as a string.The test data will contain 20 students but the program should be able to deal with up to 100 students.Assume there are no more than 4 different subjects.
So based on the first assumption I've arranged the data in the file in an order in which the student ID begins with a zero:
...for twenty students, 80 lines of data. Now, on the assumption they must be read in as strings, this is what's making it tricky to store in the structure because, I've got 80 ID numbers but 20 repeat themselves 4 times. Once I've got this data in the structure below the tasks I won't have a problem with because I can just base it on a user input program but the data's already stored instead.
Below is my code for user input associated with task (1). In this example the IDs are stored as ints but for the file they will be strings. It compiles fine, displays the data as shown in the assignment sheet, but I don't know how to get the data into my structure. I can store the data in a structure of three arrays using fscanf() no problem, but it's not very "workable" for what I need to do with it.
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 have to manage a Clinic. I need to delete a booking (for example, if John said he's coming on March 22nd at 15:30 but then he say he's not going to come, I have to delete that booking so another person can use it).
idSearched: the id of the person that is not going to come. I have a lot of specialties and each one has a list. So I ask for the speciality to delete the node (the node contains John's booking). If I don't find it, I return (-1). searchSpecByID return a pointer to the list where the speciality is. So head will point to the first node of the list. In nodeToDelete I have the node I want to delete.
The program detects OK when is the first in the list and when not, but it doesn't delete the node.
btnStatusPlr1.Image SHOULD come back as True.Then I realized it might not be the same as setting the buttons image in the properties (Which is what i did to get the original image (the one being compared to))
I do have a feeling ive done something wrong here (Yes im a noob /> )
Variable active, is the same image as the buttons default (Well should be)
I am beginner with C++ and I want to know. When do I use new and delete keywords? And what can I use them to do? Only thing I know about the new keyword and delete is that you can do this:
Code: int Size = 5; int *ptr = new int(Size); cout << *ptr << endl; delete ptr; And more . . .
But when do you use this keywords? I am just curios about them and want to now if them can be really effective to use.
int NextPixel(int antIndex, int currentPixel , Ant *ant , IplImage *edgeImg) { int left = currentPixel - 1 ; int right = currentPixel + 1 ; int up = currentPixel - edgeImg->widthStep ; int down = currentPixel + edgeImg->widthStep ;
[[Code] ....
if those lines are uncommented , program gives heap error.Why?
How would I delete a row in a datagridview (and in the database) if the datagridview control does not show the primary key? ie the SELECT statement we used to load the DataGridView does not include the primary key column (since it is not relevant to the user)
I'm writing a sorted vector implementation and trying to do it as simply as possible.
Right now, I'm declaring the sorted vector with a protected subclass of vector, then using the "using" keyword to explicitly inherit all methods that aren't related to adding new elements to the vector (so I can control the order).
Eg:
Code: template<typename T, class Cmp = std::less<T>> class sorted_vector : protected std::vector<T>{ public: typedef typename std::vector<T>::iterator; using std::vector<T>::operator=; using std::vector<T>::assign; using std::vector<T>::get_allocator; using std::vector<T>::at; using std::vector<T>::operator[]; //... };
Obviously, this is annoyingly redundant. So what I'd like to do is something using the new "delete" keyword from C++11. Is there any quick, expressive way of deleting specific methods?
Also, it's pretty annoying to have to typedef base_class::type type to inherit a type from a base class. Is there a shorter way to do that?
here's the problem. I want to delete the objects within a vector, although I'm not sure whether I should clear the vector afterwards. Is it really necessary?
Code:
for (i = 0; i < allSales.size(); i++) delete allSales[i];
int *buildTrail(int antIndex, int start, double *pheromones) { int *trail = new int[tabu]; bool *visited = new bool[tabu]; trail[0] = start; visited[start] = true;
[Code] ....
If I comment all lines includes visited word , no exception occurs , Otherwise , exception throws.
Simply put , How can i delete visited parameter as long as its role has been finished? . . . delete visited ; return trail;
how to delete an element(s) from an array; suppose I have an array x[10] = {1,2,3,4,5,6,7,8,9,10}, and I want to delete array{5} so that the values of the array become {1,2,3,4,5,7,8,9,10}; how do I go about this? This is not the same as setting the value of array{5} to null; but completely eliminating it so that it does not get printed alongside the other elements of the screen.
I'm experimenting with a custom memory-pool for my application, and I initially planned to override the global new and delete operators to allocate memory in this pool. But since I'm using QT, this will apply to all the QT-related stuff as well. Should I instead just override the new and delete operators per class?