|
A quick google using your subject line as the search term gave this at MSDN: How to detect display type : CRT or LCD ?[^] as the top link, which includes full source code.
Perhaps you should consider improving your Google-Fu?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
yes, i google it.the answer's development is vs2008,and i try to tranlate it to vs2005
but failed.but i think it should use the code just i pasted.
|
|
|
|
|
That code shouldn't be too difficult to convert down into a 2005 project/class. If you have specific problems related to this, perhaps you could post those issues to the Q&A section for specific answers which are much more difficult to present here in the forum.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
scoket wrote: i find some source like this
You "found" source? At what site have you uncovered it?
I are Troll
|
|
|
|
|
just a joke.i have update my content.
|
|
|
|
|
HI, Thanks in Advance.
In Our project we need to send SMS for alert . but default we can acheive send sms through some Gateway using internet. but in our case we need to send without internet connection . our application use only with in the network ( LAN ). Please give me some idea if u have . can we done using GPRS connection. please give some more idea ...
Thanks...
|
|
|
|
|
|
|
I'm having trouble understanding how to declare events inside interfaces so that the event handler receives my objects that are sent when I raise the events.
The documentation makes it look as if I am limited to using EventArgs as my args parameter. Is this true?
What if I want my args parameter to be my own derived object?
public interface IDrawingObject
{
event EventHandler OnDraw;
}
public class Shape : IDrawingObject, IShape
{
event EventHandler PreDrawEvent;
event EventHandler PostDrawEvent;
}
public class Subscriber1
{
public Subscriber1(Shape shape)
{
IDrawingObject d = (IDrawingObject)shape;
d.OnDraw += new EventHandler(d_OnDraw);
}
void d_OnDraw(object sender, EventArgs e)
{
Console.WriteLine("Sub1 receives the IDrawingObject event.");
}
}
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
Oh I see. I can declare my own args class derived from EventArgs, and then use that with the EventHandler<> form.
Thanks, I think that solves the problem for me.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello,
I'm implement some UI application.
The problem i have is how to fire events between two threads ?
Thread A (ui main window/wpf) launch thread B (console app project) with the logic of the app. here i have some recursive algorithm, which generate some question to the user.
Then by event i fire this question to the main ui window and update the ui with the relevant question <b>(any other way to do it ?)</b>
After the user see the question he needs to insert some answer, and according to this input the recursive algorithm continue it's execution.
The problem is how to idle the recursive execution (while the user decide what to answer...)
I was thinking to use background-worker/busy waiting, but is it possible to fire events between threads ?
Thanks for help
|
|
|
|
|
I haven't done any WPF yet, however I use BGW a lot in WinForms. A BackgroundWorker has a ReportProgress method, which is fine for reporting information back to the user. Seems to fit what you are looking for.
|
|
|
|
|
if i understand you correctly, i update my ui by using backgroundWorker.ReportProgress and in order to send user's response, i idle my algorithm with busy waiting ?
|
|
|
|
|
Sorry, I clearly wasn't paying attention here. ReportProgress() will cause the OnProgressChanged event to be fired on the main thread, however it basically is an output method, and it will not wait for anything, so it isn't what you want. As others have pointed out, your overall design seems cumbersome.
|
|
|
|
|
but why is that ?
i started to implement some algo as a console for user interactive.
As i already stated, the algo is recursive, each recursion iteration, i get an input from the user, and according to this input algo decide if it should stop or to be executed once again...
now i want to switch the console user interaction with ui.
then how i can referred already written algo to the new ui project ?
Thanks for help
|
|
|
|
|
maybe you should look into the yield keyword, it offers a way to return results from a method while allowing said method to continue execution later on. Not sure how well it fits recursive methods, I read it would work fine but my very first experiment (long ago) failed.
FWIW: if all you need is some kind of continue/cancel input, you can organize that by having the main thread taking care of the user interface (buttons, checkboxes, ...) and setting some variable(s) to reflect what the user did, and your background calculation simply reading those variables whenever it feels like it.
|
|
|
|
|
The first question is why must you use a console application? Can't you extract the logic into a separate assembly and call it from the main app?
It seems you are making a relatively simple process much more complicated than it needs to be. Your background process needs to take some input and return a result. Why does it need to continue processing after returning results as indicated by your need to idle it? Perhaps even consider using a workflow.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
it continue processing because it run in different thread.
any other ideas ?
|
|
|
|
|
It continues to run because you don't stop it obviously. You are in complete control of the code, stop the execution, exit the thread.
Why is it recursive? IMO, from what you have described it doesn't need to be. Accept the user input, complete the search, exit and repeat as necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i cant stop the execution...
I implement application which is based on decision tree.
you may have progress in breadth and in depth.
The main idea is to ask some question, if the answer is wrong, then the progress is in breadth (another question with the same difficulty level), here comes the recursion.
if the answer the user provide is correct, the progress is to the deeper level (higher difficulty level), this part works by loop.
i cant stop the recursion part in the middle of the progress.
when i started to implement it using console, it was easy, i just waited to user's input by Console.ReadLine() .
But now, i execute the algorithm from the ui, and after some question was generated, the ui updated, but the algorithm continue to run...
How do you think I can solve it ?
Thanks
modified on Sunday, December 5, 2010 5:26 PM
|
|
|
|
|
|
I yield to your yield
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
One can only hope you're unique then; two non-yielders would be a recipe for trouble.
|
|
|
|