Click here to Skip to main content
15,884,836 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: store procedure Pin
Pete O'Hanlon26-May-09 21:45
mvePete O'Hanlon26-May-09 21:45 
AnswerRe: store procedure Pin
saanj28-May-09 3:03
saanj28-May-09 3:03 
QuestionHow to override the message loop in winforms? Pin
Felix Collins26-May-09 17:56
Felix Collins26-May-09 17:56 
AnswerRe: How to override the message loop in winforms? Pin
Pete O'Hanlon26-May-09 21:39
mvePete O'Hanlon26-May-09 21:39 
GeneralRe: How to override the message loop in winforms? Pin
Felix Collins27-May-09 16:55
Felix Collins27-May-09 16:55 
GeneralRe: How to override the message loop in winforms? Pin
Luc Pattyn27-May-09 17:20
sitebuilderLuc Pattyn27-May-09 17:20 
GeneralRentrant event processing. Was : How to override the message loop in winforms? Pin
Felix Collins27-May-09 18:12
Felix Collins27-May-09 18:12 
GeneralRe: Rentrant event processing. Was : How to override the message loop in winforms? Pin
dybs29-May-09 17:10
dybs29-May-09 17:10 
I've had a similar issue when I try to link controls together, like a textBox and a trackBar, where updating one control should update the other. Here's how I solved it. Keep in mind this only works if it's managed code that you're trying to keep "non-reentrant".

If your code is assuming a single-threaded environment, you could try setting a lock before the DirectShow code gets called, and check that lock at the beginning of the nested events, like so:

bool lock = false;

void SomeEvent(object sender, EventArgs e)
{
  if(!lock){
    lock = true;
    // Some code
    DirectShowCall();
    // more code.
    lock = false;
  }
}

void NestedEvent(object sender, EventArgs e)
{
  if(!lock)
  { 
    // Your code here.
  }
}

The lock check in SomeEvent will prevent your DirectShow code from getting called in a nested fashion.

This method isn't thread-safe. If you need thread-safety, you may want to look at Monitor.TryEnter.[^]

Dybs
GeneralRe: Rentrant event processing. Was : How to override the message loop in winforms? Pin
Felix Collins31-May-09 12:49
Felix Collins31-May-09 12:49 
GeneralRe: Rentrant event processing. Was : How to override the message loop in winforms? Pin
Felix Collins7-Jun-09 16:33
Felix Collins7-Jun-09 16:33 
QuestionNATUPNPLib - Which local IP to use? Pin
Andrey U26-May-09 11:42
Andrey U26-May-09 11:42 
AnswerRe: NATUPNPLib - Which local IP to use? Pin
Dave Kreskowiak27-May-09 7:42
mveDave Kreskowiak27-May-09 7:42 
QuestionEven targeting 3.5, metadata version v2.0.50727 ? Pin
GuimaSun26-May-09 9:17
GuimaSun26-May-09 9:17 
AnswerRe: Even targeting 3.5, metadata version v2.0.50727 ? Pin
Dave Kreskowiak26-May-09 9:23
mveDave Kreskowiak26-May-09 9:23 
GeneralRe: Even targeting 3.5, metadata version v2.0.50727 ? Pin
GuimaSun26-May-09 10:01
GuimaSun26-May-09 10:01 
GeneralRe: Even targeting 3.5, metadata version v2.0.50727 ? Pin
Dave Kreskowiak26-May-09 16:04
mveDave Kreskowiak26-May-09 16:04 
Questioncode for logout button in c# Pin
manjusha s26-May-09 2:27
manjusha s26-May-09 2:27 
AnswerRe: code for logout button in c# [REPOST!!! Please ignore.] Pin
Henry Minute26-May-09 2:50
Henry Minute26-May-09 2:50 
AnswerStop. Desist. Leave now. Pin
Pete O'Hanlon26-May-09 3:08
mvePete O'Hanlon26-May-09 3:08 
Questiondoes .net Framework(2.0 and 3.5) Supports Robotics language VPL Pin
dewana26726-May-09 0:58
dewana26726-May-09 0:58 
AnswerRe: does .net Framework(2.0 and 3.5) Supports Robotics language VPL Pin
Dave Kreskowiak26-May-09 4:16
mveDave Kreskowiak26-May-09 4:16 
QuestionLogout code in C# Pin
manjusha s26-May-09 0:39
manjusha s26-May-09 0:39 
AnswerRe: Logout code in C# Pin
annathor27-May-09 0:57
annathor27-May-09 0:57 
QuestionLogout code in C# Pin
manjusha s26-May-09 0:23
manjusha s26-May-09 0:23 
AnswerRe: Logout code in C# Pin
Henry Minute26-May-09 0:26
Henry Minute26-May-09 0:26 

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.