Solved

Control.Created question

Posted on 2006-11-04
3
160 Views
Last Modified: 2010-04-16
Right now I'm messing around with the DirectX SDK and there is a program in it which it get mouse data.  The question I have has nothing to do with DirectX, but with a part of code I dont seem to understand.  The function below is called from a delagate.

        public void MouseEvent()
        {
            // This is the Mouse event thread.
            // This thread will wait until a
            // Mouse event occurrs, and invoke
            // the delegate on the main thread to
            // grab the current Mouse state and update
            // the UI.
            while(Created)                
            {
                eventFire.WaitOne(-1, false);
               
                try
                {
                    applicationDevice.Poll();
                }
                catch(InputException)
                {
                    continue;
                }
                this.BeginInvoke(new UIDelegate(UpdateUI));
            }
        }

The part I don't understand is the while(Created).  I've done some web searches on it and it's pretty vague.  If this function is executed on  a different thread so what Control is it referring to?  Also, if I were to create a separate mouse class, how would I refer to this control?

Thanks!
0
Comment
Question by:bramsquad
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17875904
Created property belongs to class where MouseEvent function is placed. If this is Control-derived class, this is Control.Created property. While loops continues pooling while control exists, and exits when control is destroyed.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question