|
Hi
i want use digital pen (or optical pen) in my app which to be written in c#, can anybody help me and give some articles and examples about this issue ?
thanks
|
|
|
|
|
hi
im krishna
did u got any inforamtion or usefull stuffs to
develop an c# application to use the digital pen.
|
|
|
|
|
hi krishna
you can handle mouse_move event.
|
|
|
|
|
Hello to all
How can I use the light pen on the Mvc or the web app?
|
|
|
|
|
I Had to cancel the printing given.
For this I had used
Code Snippet: Sandeep Aparajit playing around with the System.Management.Net namespace.
#region CancelPrintJob
/// <summary>
/// Cancel the print job. This functions accepts the job number.
/// An exception will be thrown if access denied.
/// </summary>
/// <param name="printJobID">int: Job number to cancel printing for.</param>
/// <returns>bool: true if cancel successfull, else false.</returns>
public bool CancelPrintJob(int printJobID)
{
// Variable declarations.
bool isActionPerformed = false ;
string searchQuery;
String jobName;
char [] splitArr;
int prntJobID;
ManagementObjectSearcher searchPrintJobs;
ManagementObjectCollection prntJobCollection;
try
{
// Query to get all the queued printer jobs.
searchQuery = "SELECT * FROM Win32_PrintJob" ;
// Create an object using the above query.
searchPrintJobs = new ManagementObjectSearcher(searchQuery);
// Fire the query to get the collection of the printer jobs.
prntJobCollection = searchPrintJobs.Get();
// Look for the job you want to delete/cancel.
foreach (ManagementObject prntJob in prntJobCollection)
{
jobName = prntJob.Properties["Name" ].Value.ToString();
// Job name would be of the format [Printer name], [Job ID]
splitArr = new char [1];
splitArr[0] = Convert.ToChar("," );
// Get the job ID.
prntJobID = Convert.ToInt32(jobName.Split(splitArr)[1]);
// If the Job Id equals the input job Id, then cancel the job.
if (prntJobID == printJobID)
{
// Performs a action similar to the cancel
// operation of windows print console
prntJob.Delete();
isActionPerformed = true ;
break ;
}
}
return isActionPerformed;
}
catch (Exception sysException)
{
// Log the exception.
return false ;
}
}
#endregion CancelPrintJob
The code line prntJob.Delete() is not executing in other PC's which had .Net framework and all other things same as my Syatem.
What may be the problem? Can anyone say something to solve this?
|
|
|
|
|
Hi,
I have three AsyncCallback delegates. how can i put these three AsyncCallback in three threads, so messages corresponding to the delegate can process at any time even when the other delegate is busy.
eg: I opened three ports. Continous messages will come to these three ports. I create delegates for each ports. All delegates should be ready to recive messages at any time without making a message queue.
How cani do this using multi thread?
Thankyou
YPKI
|
|
|
|
|
I don't know! What exactly do you want? What's wrong with a message queue?
There are async methods (with callbacks) for sockets, is that what you're looking for?
Do you want to start a new thread from the delegate? (could give trouble)
|
|
|
|
|
I am using AsyncCallback, but if the number of message increse the messege queue will go long and the replay get slow.
i want make it fast.
Will the AsyncCallback can handle any number of clients at a time with out delay??
I am trying to use multi thread in delegate for handling messages.
Will it work?
Thankyou
YPKI
|
|
|
|
|
It depends. It's possible to make it work without being delayed by other messages (of course you can not make it take zero time), up to a certain limit of course. The messages you send over the internet will never go in parallel, but the processing of them can. If your callback immediately starts a new async operation and only Then processes the message, that should be OK (I think.. test first)
|
|
|
|
|
Hi,
AFAIK all async callbacks (such as supported by Dns.BeginGetHostEntry) and other async operations (such as SerialPort.DataReceived event) execute on the ThreadPool, which holds a collection of Threads (25 or more) ready to execute your code. You can't (or shouldn't?) modify the behavior of those threads (priority, IsBackground, ...)
If you don't like/trust the ThreadPool, don't use async callback, just create your own threads and let them to whatever it is you need in a synchronous way.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
so you mean async callbacks have its own thread pool(its already work when we use async callbacks...ryt ??? ).. no need to create our own thread
So better, not to create thread for speeding up message queue process..
Thankyou
YPKI
|
|
|
|
|
Not sure you got my drift. AFAIK all callbacks use the existing ThreadPool (which gets created very early in the startup of a .NET app). And using your own threads, so you can control them any way you like, only requires you to create threads once, say one Thread each time you open a SerialPort.
FWIW some info on ThreadPool: http://www.ddj.com/hpc-high-performance-computing/216500409[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Dear sir,
i am Nidish, traineee .NET developer for Forthought pvt Ltd, Bangalore, India. I would like to to know the method to Programmatically send email using outlook Express 6.0. I have the code to access Microsoft outlook but failed to find method to access outlook express 6.0. please be free to send reply to my Email id : nidi2999@gmail.com
|
|
|
|
|
hi, Nidi i'm also searching same thing
|
|
|
|
|
Not very hard it would seem clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I love circular references. I followed the link, then clicked on the first item returned. It was this question.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Oops - it never occurred to me to follow it any deeper, I'm glad there were a few more than just this one.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
one more reason to google before asking here.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
I am doing geocoding using Google Map API but the problem is,
if i pass Lat (25.093369) and Lon (121.5669693) points of Taiwan to Google Map API then it gives me address in following way,
西安里 Neihu District Taipei City Taiwan 114
but i need the whole address in Chinese Language
Can anyone help me?
thanks in advance
|
|
|
|
|
Yeah, Google. They wrote the API and they support it. I suggest dropping them an email or looking for the support forum for it.
|
|
|
|
|
Lets say you have to do 4 things,
void f1()
void f2()
void f3()
void f4()
Alt 1: Run them like this
f1(); f2(); f3(); f4();
Alt 2: Run them each one with a separate thread
Thread t1 = new Thread (f1); t1.Start();
Thread t2 = new Thread (f2); t2.Start();
Thread t3 = new Thread (f3); t3.Start();
Thread t4 = new Thread (f4); t4.Start();
(the functions just read resources, they dont write, so dont worry about threading sync)
Alt 2 should take less time than Alt 1???
I tried to test this but I'm doubting of the results because at the beginning I had one result (threading is faster) and then anoter (same times)
Logically thinking.. the threading solution shouldnt be faster because in reality they arent running at the same time.. they are being switched ( thats why there is only 1 CurrentThread when one calls Thread.CurrentThread static method )
Please help.
|
|
|
|
|
Hi!
This highly depends on what your f1-f4 are doing.
When each one can run through all the time, without having to wait for anything, I'd guess the 2 solutions run equally fast (at least on a 1 processor system and neglecting the overhead of thread creation).
But as soon as one of them has to wait for a result (network, file, ...), the scheduler can assign the waiting thread's time slice to another thread, making the whole program running faster.
Hope this helps...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Adding to mav's response, if you have a multi-core processor, the multi-threading solution may run faster.
But my advice is don't use threads unless there's a convincing reason to do so. They can introduce all sorts of subtle, difficult-to-debug problems.
|
|
|
|
|
That depends on what each of these methods is doing. Creating and starting a new thread is an expensive operation, so if it doesn't take very long to execute the method, just starting one thread can take longer than executing the 4 methods sequentially.
|
|
|
|
|
Hi,
if two or more of the jobs (f1...f4) have an execution time that is (or may be, depending on circumstances) noticeable for the user (i.e. more than 30msec), put them in separate threads/ThreadPool/BackgroundWorker so they can
1) execute in parallel (when your system has hyperthreading, or multiple cores, or multiple processors)
2) self-organize their execution (i.e. when one has to wait some other can continue)
OTOH if you do it all sequentially and your Task Manager shows the CPU is fully loaded (which means there are no waits and the number of cores does not exceed the number of running threads) then you won't gain anything by adding threads.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|