Click here to Skip to main content
16,008,469 members
Home / Discussions / C#
   

C#

 
QuestionDrag and Drop FROM a ListBox to the desktop Pin
eggsy8412-Nov-07 5:39
eggsy8412-Nov-07 5:39 
AnswerRe: Drag and Drop FROM a ListBox to the desktop Pin
Skippums12-Nov-07 9:26
Skippums12-Nov-07 9:26 
GeneralRe: Drag and Drop FROM a ListBox to the desktop Pin
eggsy8412-Nov-07 22:44
eggsy8412-Nov-07 22:44 
GeneralRe: Drag and Drop FROM a ListBox to the desktop Pin
eggsy8412-Nov-07 22:45
eggsy8412-Nov-07 22:45 
GeneralRe: Drag and Drop FROM a ListBox to the desktop Pin
Skippums13-Nov-07 4:58
Skippums13-Nov-07 4:58 
GeneralRe: Drag and Drop FROM a ListBox to the desktop Pin
eggsy8413-Nov-07 5:23
eggsy8413-Nov-07 5:23 
QuestionMultithreaded windows service Pin
Vijay Kulavade12-Nov-07 5:35
Vijay Kulavade12-Nov-07 5:35 
AnswerRe: Multithreaded windows service Pin
Guinness4Strength12-Nov-07 6:52
Guinness4Strength12-Nov-07 6:52 
I would be surprised if anyone would be able to post code for this type of request. I have written a few multithreaded services and can give you some pointers.

1. I usually put all of the code used by the thread in its own DLL, that way you can basically insantiate an instance of you class for each thread and limit the race conditions which can occur between threads.
2. Create a single public method in your class which can be the starting point for your thread, populate class properties with initial values in the Service code then use the ThreadStart or ParameterizedThreadStart methods to start the thread. Once the Thread has started (you can use ManualResetEvents to monitor this) add the Thread instance to an array in the Service code so all of the running threads canbe managed from the service. Doing so will allow you to stop the threads in the event that the service must stop.
3. I've found that .NET remoting is especiall handy with M-threaded Windows Services for sending control / command requests to the threads.

Here is an example of starting a thread:

try
                    {
                        m_ThreadStarted.Reset();
                        //ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessADTThread), DR);
                        Thread ADTThread = new Thread(new ParameterizedThreadStart(ProcessADTThread));
                        ADTThread.IsBackground = true;
                        m_MasterThreadList.Add(ADTThread);
                        ADTThread.Start(DR);
                        m_ThreadStarted.WaitOne(-1, false);
                        Lines.Append(DR["ClientName"].ToString() + " Started\r\n");
                    }
                    catch (Exception Err)
                    {
                        m_ServiceLog.WriteEntry("Start Service WaitEvent Exception: " + Err.Message, EventLogEntryType.Error);
                    }

QuestionProblems in .net socket Pin
nayabsiddiqi12-Nov-07 4:51
nayabsiddiqi12-Nov-07 4:51 
AnswerRe: Problems in .net socket Pin
Justin Perez12-Nov-07 5:13
Justin Perez12-Nov-07 5:13 
GeneralRe: Problems in .net socket Pin
nayabsiddiqi12-Nov-07 5:39
nayabsiddiqi12-Nov-07 5:39 
AnswerRe: Problems in .net socket Pin
Ennis Ray Lynch, Jr.12-Nov-07 6:41
Ennis Ray Lynch, Jr.12-Nov-07 6:41 
GeneralRe: Problems in .net socket Pin
nayabsiddiqi13-Nov-07 1:19
nayabsiddiqi13-Nov-07 1:19 
AnswerRe: Problems in .net socket Pin
Guinness4Strength12-Nov-07 7:08
Guinness4Strength12-Nov-07 7:08 
GeneralRe: Problems in .net socket Pin
nayabsiddiqi13-Nov-07 1:22
nayabsiddiqi13-Nov-07 1:22 
QuestionUser located controls Pin
Ron Modesitt12-Nov-07 4:29
Ron Modesitt12-Nov-07 4:29 
AnswerRe: User located controls Pin
Guinness4Strength12-Nov-07 7:05
Guinness4Strength12-Nov-07 7:05 
GeneralRe: User located controls Pin
Ron Modesitt12-Nov-07 8:33
Ron Modesitt12-Nov-07 8:33 
Questionleft panel Pin
md_refay12-Nov-07 3:37
md_refay12-Nov-07 3:37 
AnswerRe: left panel Pin
leppie12-Nov-07 3:52
leppie12-Nov-07 3:52 
AnswerRe: left panel Pin
Justin Perez12-Nov-07 5:40
Justin Perez12-Nov-07 5:40 
Questionundo and redo realization Pin
Seraph_summer12-Nov-07 3:30
Seraph_summer12-Nov-07 3:30 
AnswerRe: undo and redo realization Pin
leppie12-Nov-07 3:50
leppie12-Nov-07 3:50 
AnswerRe: undo and redo realization Pin
Russell Jones12-Nov-07 7:22
Russell Jones12-Nov-07 7:22 
QuestionC# - Accessing SMB shares Pin
wbjohnson12-Nov-07 3:25
wbjohnson12-Nov-07 3:25 

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.