the problem with my code is that trace toggle can only be turn on, not off and trace does not demarcate the (substring) in progress. how do i fix this?
Am developing windows forms application where in my form am fetching data into list from some object which takes around 2 minutes to complete processing so meantime i want to show progress bar before starting process till it ends with percentage. I have return a code to do multitasking but it is throwing error as "Cross-thread operation not valid: Control 'listOrg' accessed from a thread other than the thread it was created on".
private void btnOrg_Click(object sender, EventArgs e) { try { // To report progress from the background worker we need to set this property backgroundWorker1.WorkerReportsProgress = true;
I am running a windows forms project. on the form there is a datagridview, a progress bar, a textbox and two 2 buttons.
The two buttons are used to navigate through the records(one for next record and the other for previous record) the textbox displays the record that is being currently viewed.
How can I link the progress with the database or in this case the datagridview and when the next button is pressed it increments and when the previous button is clicked it decrements and also the progress to be fully filled when the last record is reached ?
For a project I'm working on, I need to be able to download a file from an FTP server and store it to a predetermined location with a predetermined name. No user interaction should be needed. Because the file is rather large, and I need the main program to remain responsive, this is going to need a progress dialog.
I could write all this myself and use the MFC wininet wrappers (CInternetSession et al) to do the downloading, but... Explorer already has this, and IE has such a dialog also. It doesn't seem unreasonable to assume those dialogs are available via some API.
Is a "FTP download with dialog" available as a windows API, or do I really need to write all this myself ?
I'm having problems with progress bar when using a big number in set range. For numbers below 50000 it works very well but for big numbers like 100.000 it doesn't work, it makes 2-3 rounds of animation
Code: int number= 50000; // 50k works well but if i put 100k it won't work (it will animate 2-3 rounds instead of complete one) progressbar1.SetRange(0, number); progressbar1.SetStep(1); for (int i = 0; i < number; ++i) { listcontrol1.InsertItem(i, _T("whatever")); progressbar1.StepIt(); }
I'm making a quiz game in c++. I've already completed it. But now I've thought of creating a profile and saving the progress for the user so when he enters his name the game continues frm where he had saved it.
I have a module that pings the network to find available devices using threading.
the money line:
var valids = range.AsParallel().AsOrdered().Where(ip => ip.Ping()).ToList();
The problem is, I need to display a progress bar while this function runs. I have the progress bar implemented with a background worker, but it won't update while the ping module is executing. I *think* it's because I'm using the available threads for the ping module.
When the user clicks a button, I need the ping module to run while the progress bar updates, or even just set IsIndeterminite to true. What would be the best way to accomplish this?
According to my project instructions, I have to make a "validation on the delete button, that before a record can be deleted it will check to see if the count of "In-Progress" orders for that product is 0. If it is greater than zero, it should not allow this record to be deleted."
The professor said I have to: "As for getting the count, check your notes and book, specifically looking at SQL and the Aggregate functions. There is a function we talked about in class called "Count(OrderID)" and set the where clause to check for the productID.
What is the traditional way to monitor a blocking subroutine that is using a file stream as its input? That is, what is the traditional way to make a progress meter in the console?
Say I have a function that takes in a filestream and works with it. Suppose this file stream has a position and length property like in C# FileStream:
Code:
void sub (filestream file) { //read a bit of the stream, which advances stream cursor position //do something //repeat until all of file stream has been used up }
Presumably the function is chomping along the file stream as it is doing some calculations serially on the file stream.Because the function is blocking, there is no way to access the file streams position and length in this thread. So naturally it seems like the best thing to do to monitor the progress of that function is to make another thread and pass it the file stream object as a parameter, and in this separate thread, monitor the distance between filestream's position and length to determine how much of the file stream has been used up, and every second or so output the amount of file stream used onto the console.
Let's say I have unsigned char test[10] = "HELLO!!!"; How would I go about circularly shifting this to the right? Inline assembly instructions would be ok too
Any algorithm or function to rotate a displayed circle. To turn it 360 degrees like a car-tire. (It's needed to turn a turn-table in a model-railrod control program) .....
It's compiling but it's not working, it enters in stack overflow. It's a Doubly Linked List I'm compiling in Visual Studio. I think there's nothing wrong with this declaration, but there's just might be it:
class ListItem; class List { public: ListItem *firstItemRef;
I need to create such a function that the content of the first is put into the second, the content of the second into the third and the content of the third into the first.
For example, output should be like this 3 2 1 But the code below prints out: 1 2 2 Where am I making a mistake?
I am stuck with how to make a circular queue that are based on a struct. Have been reading about the implementation but cant really understand it fully. Here is what i got so far.
Code: #define SIZE 10 typedef struct { char reg; char brand; int modelyear; int mileage;
Today I faced a problem where I had circular dependency in my template arguments. I was trying to make a class hierarchy similar to:
template<class BType> class A_base { public: BType* getB(); };
[Code] .....
Basically I had objects that were of type A<B<A<B<...
Basically I have a tree like structure of heterogeneous types that must facilitate two-way interactions where A's can call B's and B's can call A's. This structure is useful in many contexts the difference is the methods A and B provide are different in each of these contexts. Instead of adding the getA and getB and all the other connectivity methods in every version of A and every version of B, I wanted to create a base class that managed this automatically.
Another piece of advice was break up your code so there is a forward-only and backwards-only dependent types. This is not a complete solution because the two cannot know about the other and this does not really facilitate arbitrary two-way communication (where A calls B then B calls A back). It also makes the code more complicated in that I have two sets of objects and interfaces.
So the solution was to make the template arguments specific to the things I wanted to be flexible. The connectivity interface of A_base and B_base should be constant. Hence that cannot be in the template parameter. It was merely the traits that I wanted to make flexible so... I came up with this solution:
#include <iostream> template<class aTraitType,class bTraitType> class A; template<class aTraitType,class bTraitType> class B;
[Code] ....
Now this compiles and works great. The problem is that aObj and bObj cannot call their opposite within a trait method because print() does not know anything about the connectivity. So the solution there was to make traits an abstract base class. Then magically everything works!
#include <iostream> template<class aTraitType,class bTraitType> class A_base; template<class aTraitType,class bTraitType> class B_base;
[Code] .....
So this outputs the following. Clearly there is two-way communication!
Class A is not connected to B Class B is not connected to A Class A at 0x7fff25d1aa10 reporting for duty Class B at 0x7fff25d1aa00 reporting for duty Class B at 0x7fff25d1aa00 reporting for duty Class A at 0x7fff25d1aa10 reporting for duty Class A at 0x7fff25d1aa10 reporting for duty Class B at 0x7fff25d1aa00 reporting for duty
I've been making a project that requires different files to have access to objects declared in other files such that circular dependencies are created. I've done some research and discovered that pointers and forward declarations should be able to fix this.
Example:
File 1 declares variable x, must edit x and y
File 2 must edit x and y, declares variable y
I know this isn't the best example, as you could probably declare x and y in the same file, but please suffice it to say that I'm unable to do that in my project.
I have this program. I am trying to do this Circular List but i think something going wrong. The first of all is the list.The second is if my code for delete and select function are correct and the third i would like my program getting a "n" number of names and then make the circural list then print it and then when i select a number delete every node until give us the only one left.
Now the problem is in the core 1. Here I am unable to read the values from the specific memory location. I am getting garbage value. Where I am doing some stupid error.. I did not understand
Code: (front->ptr) = (unsigned int *) memory_location;
When I print the (front->ptr) it shows correct memory address but inside the De-queue function in core 1, I am getting wrong value..
Code: int deq(int buf[n]) { front1 = front; printf("Val %d ", front->info); // showing wrong value if (front1 == NULL) { printf("
Error: Trying to display elements from empty queue"); return 0;