|
|
Thanks. I think this will work. Maybe one more thing. If I would not use a Timer, but a background thread, which checks for the same condition, and than goes to sleep for some time, is there any similar way to solve the problem?
Uros
|
|
|
|
|
All Control s have Invoke and BeginInvoke functions that will execute a function on the thread that the control was created on. You could use the watchdog thread to check for your condition and then Invoke some worker function on the main thread if the condition is true and some work needs to be done.
|
|
|
|
|
I guess invoke would work, but my class does not derive from control, so it does not have Invoke or BeginInvoke functions. Here is a simplified example of my class.
public class SomeClass
{
private Thread _workingThread;
public EventHandler SomeEvent;
public SomeClass()
{
_workingThread = new Thread(new ThreadStart(this.checkForCondition));
_workingThread.Start();
}
private void checkForCondition()
{
if(/*Check if condition is met*/)
{
onSomeEvent();
}
System.Threading.Thread.Sleep(5000);
}
private void onSomeEvent()
{
if (SomeEvent != null)
{
SomeEvent(this, new EventArgs());
}
}
}
Uros
|
|
|
|
|
that looks perfectly suited for a timer
|
|
|
|
|
I am using Visual c++ NET 2005 and using for my report CrystallReport.
I didn't yet seen an example for that at C++ or C#. I try to translate VB example but I don't succed. When I display report, I have a screen asking to fill the value of parameters.
I need help, an example of how to fill programmatically parameters and load report in Visual c++ NET or C#
|
|
|
|
|
there aren't many examples on crystal reporting.
i dreamt up a little work around that basically creates a DataTable with my parameters in it. then i add it to the DataSet before i pass it to the report.
i strongly suggest that you buy a book on crystal report's. i did, still waiting for it tho so I'm no crystal expert... YET
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
|
i helped you!?
i gave you two options, so pick one and run with it
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hello every 1,
I am using ToolStrip in one of my projects. I want to get a handle (Intptr)
to ToolStripButton in the Tollstrip.
But the ToolStripButton does not have a handle property.
Can any 1 help me out in this issue.
o O º(`'·.,(`'·., ?,.·''),.·'')º O o°
»·'"`»* *? t4ure4n ?* *«·'"`«
°o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°
modified on Thursday, June 12, 2008 7:07 AM
|
|
|
|
|
And what do you plan on doing with the handle once you found it?
|
|
|
|
|
Actually i want to embedd custom fonts in the app and use them on the clients machine i.e without installing the fonts on their machines.
I use a class that create a bin file from the font file.
To use this font I have a method in my FontEmbedder class
This method requires the handle to the control that contains the text to be shown.
o O º(`'·.,(`'·., ?,.·''),.·'')º O o°
»·'"`»* *? t4ure4n ?* *«·'"`«
°o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°
|
|
|
|
|
Is it possible to target Silverlight using C# 2008 Express yet?
|
|
|
|
|
SP1 AFAIK (or was that just for MVC?).
|
|
|
|
|
Thanks, I'll give it a go and risk the SP1 Beta.
|
|
|
|
|
Can anybody help me how to use HTTP protocol in client server application uisng scoket programming
|
|
|
|
|
Do you have specific problem? Or do you lack the ability to search the Internet?
|
|
|
|
|
Hi All,
I want to generate reports dynamically. Please guide me.
Thanks.
Chanzeb Chaudhary
|
|
|
|
|
myReport.GenerateDynamically();
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi,
Hope every1 is doing fine. i want to read .DTD file programmatically. is there any way to do this in C# 2.0? do DOM provide such facility? i googled alot but could not find any helpfull material.
any kind of help is appriciated...thanks in advance!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
How did you fail to see the same question being asked less than 4 hours ago?
|
|
|
|
|
Hi all,
I am trying a sample program to retrieve second highest element in an array (not arraylist)?
But i am unable to retrieve it,can anyone help me in this?
Thanks
AKP
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
yadlaprasad wrote: I am trying a sample program to retrieve second highest element in an array (not arraylist)?
Then you need to sort the array (descending oder, i.e. highest to lowest), then take the second element.
|
|
|
|
|
or loop through the array after sorting to check if the value arr[n] is different from arr[o] and take that value.
It depends if you can guarantee uniqueness of items
|
|
|
|
|
Hi Guys,
has anyone ever done anything like interact between two programs?
I have one program that authenticates people based on their biometric data written in MFC (one EXE).
Now i'm writing another program for medical records. (Another EXE).
How do i know when the biometric authenticating program has finished authenticating, and its result, i.e: true or false.
I need to run the first program, then based on its results, run the second. Any help please. I'm stuck!
Help!
He who goes for revenge must first dig two graves.
|
|
|
|