Click here to Skip to main content
15,905,913 members
Home / Discussions / C#
   

C#

 
QuestionObject reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 21:22
Ice_Freez0520-Apr-10 21:22 
AnswerRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 21:47
mveOriginalGriff20-Apr-10 21:47 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 22:10
Ice_Freez0520-Apr-10 22:10 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 22:22
mveOriginalGriff20-Apr-10 22:22 
GeneralRe: Object reference not set to an instance of an object [modified] Pin
Ice_Freez0520-Apr-10 22:48
Ice_Freez0520-Apr-10 22:48 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 22:59
mveOriginalGriff20-Apr-10 22:59 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 23:04
Ice_Freez0520-Apr-10 23:04 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 23:33
mveOriginalGriff20-Apr-10 23:33 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 23:47
Ice_Freez0520-Apr-10 23:47 
Questionfreeing a variable Pin
AnirbanChak 20-Apr-10 20:47
AnirbanChak 20-Apr-10 20:47 
AnswerRe: freeing a variable Pin
Stanciu Vlad20-Apr-10 21:04
Stanciu Vlad20-Apr-10 21:04 
GeneralRe: freeing a variable Pin
AnirbanChak 20-Apr-10 23:06
AnirbanChak 20-Apr-10 23:06 
GeneralRe: freeing a variable Pin
Stanciu Vlad20-Apr-10 23:11
Stanciu Vlad20-Apr-10 23:11 
AnswerRe: freeing a variable Pin
Ice_Freez0520-Apr-10 21:06
Ice_Freez0520-Apr-10 21:06 
AnswerRe: freeing a variable Pin
OriginalGriff20-Apr-10 21:08
mveOriginalGriff20-Apr-10 21:08 
QuestionSend multiple SMS problem using Skype API Pin
Tridip Bhattacharjee20-Apr-10 20:13
professionalTridip Bhattacharjee20-Apr-10 20:13 
Questionauto update Pin
Member 59031020-Apr-10 19:53
Member 59031020-Apr-10 19:53 
AnswerRe: auto update Pin
Calla20-Apr-10 20:18
Calla20-Apr-10 20:18 
QuestionHow get USP device serial no Pin
anishkannan20-Apr-10 19:50
anishkannan20-Apr-10 19:50 
AnswerRe: How get USP device serial no Pin
sanforjackass20-Apr-10 21:52
sanforjackass20-Apr-10 21:52 
AnswerRe: How get USP device serial no Pin
Kythen21-Apr-10 6:18
Kythen21-Apr-10 6:18 
QuestionWaitOne won't wakeup Pin
doubleclick2d20-Apr-10 14:58
doubleclick2d20-Apr-10 14:58 
Hi,
I've created the following code:

AutoResetEvent CheckQ = new AutoResetEvent(false);

public void Q_Insert( QEntry entry )
{
lock( My_Q )
{
My_Q.Enqueue( entry );
CheckQ.Set();
}
}

public QEntry Q_Pop()
{
lock ( My_Q )
{
if( My_Q.Count > 0 )
return (QEntry) My_Q.Dequeue();
}

CheckQ.Reset();
CheckQ.WaitOne();

lock ( My_Q )
{
if( My_Q.Count > 0 )
return (QEntry) My_Q.Dequeue();
}
}

Basically, if there is nothing in the queue, it will just wait until something comes into the queue.

However, my code never wakes up from CheckQ.WaitOne even though CheckQ.Set() was called. I later check the Handle ID in "CheckQ" from both function Q_Insert and Q_Pop, found out that the same variable has different Handle IDs ( as well as WaitHandle ID ) in 2 different functions. That might be the reason that WaitOne never wakes up, but my question is: how did this happen ? I only created one variable CheckQ in the file. I am so puzzled. Really appreciated if someone can explain this. Thanks in advance !
AnswerRe: WaitOne won't wakeup Pin
Luc Pattyn20-Apr-10 15:41
sitebuilderLuc Pattyn20-Apr-10 15:41 
Questionunresolved hashtable problem [modified] Pin
Jassim Rahma20-Apr-10 12:55
Jassim Rahma20-Apr-10 12:55 
AnswerRe: unresolved hashtable problem Pin
Luc Pattyn20-Apr-10 14:10
sitebuilderLuc Pattyn20-Apr-10 14:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.