Click here to Skip to main content
15,898,036 members
Home / Discussions / C#
   

C#

 
QuestionRe: DateTime.TryParse Pin
Kjetil Svendsen21-May-08 22:41
Kjetil Svendsen21-May-08 22:41 
AnswerRe: DateTime.TryParse Pin
DaveyM6922-May-08 11:08
professionalDaveyM6922-May-08 11:08 
GeneralRe: DateTime.TryParse Pin
Kjetil Svendsen23-May-08 0:37
Kjetil Svendsen23-May-08 0:37 
QuestionProgressBar beginners question Pin
NewToAspDotNet21-May-08 4:53
NewToAspDotNet21-May-08 4:53 
AnswerRe: ProgressBar beginners question Pin
Giorgi Dalakishvili21-May-08 5:00
mentorGiorgi Dalakishvili21-May-08 5:00 
QuestionExecuting delegate in a different thread Pin
Artur Löwen21-May-08 4:17
Artur Löwen21-May-08 4:17 
AnswerRe: Executing delegate in a different thread Pin
Laddie21-May-08 4:30
Laddie21-May-08 4:30 
GeneralRe: Executing delegate in a different thread Pin
Artur Löwen21-May-08 4:58
Artur Löwen21-May-08 4:58 
How does it work? Can you give me a sample? As you see I tried something but it doesn't work.

my code:

class IPCMsgHandler
{
	private Thread listenThread = new Thread(ListeningThreadFunc);

...

	public void Start()
	{
		listenThread.Start(this);
	}

	private static void ListeningThreadFunc(object data)
	{
		IPCMsgHandler helper = data as IPCMsgHandler;

		...

		//helper.OnMessage(); doesn't work...staying in current thread context

		MethodInvoker mi = new MethodInvoker(helper.OnMessage);
		mi.Invoke();

		...
	}
}

public class AutoCADApplication : IExtensionApplication
{
	IPCMsgHandler helper = null;

	public void Initialize()
	{
		// I have the right execution-context here
		this.helper = new IPCMsgHandler("AutoCAD-IPCServer", new IPCMsgHandler.MessageHandler(this.OnIPCMessage));
		this.helper.Start();
	}
	private void OnIPCMessage()
	{
		// I have the WRONG execution-context here
		return;
	}

GeneralRe: Executing delegate in a different thread Pin
Peter Josefsson Sweden21-May-08 5:33
Peter Josefsson Sweden21-May-08 5:33 
GeneralRe: Executing delegate in a different thread Pin
Bekjong21-May-08 5:38
Bekjong21-May-08 5:38 
GeneralRe: Executing delegate in a different thread Pin
Peter Josefsson Sweden21-May-08 13:00
Peter Josefsson Sweden21-May-08 13:00 
QuestionRead USB device names Pin
kristofvanderhaeghen21-May-08 3:35
kristofvanderhaeghen21-May-08 3:35 
AnswerRe: Read USB device names Pin
Giorgi Dalakishvili21-May-08 3:44
mentorGiorgi Dalakishvili21-May-08 3:44 
QuestionStringBuilder Speed Question Pin
Reelix21-May-08 3:11
Reelix21-May-08 3:11 
AnswerRe: StringBuilder Speed Question Pin
Guffa21-May-08 4:00
Guffa21-May-08 4:00 
QuestionRe: StringBuilder Speed Question Pin
buchstaben21-May-08 4:01
buchstaben21-May-08 4:01 
AnswerRe: StringBuilder Speed Question PinPopular
Colin Angus Mackay21-May-08 4:07
Colin Angus Mackay21-May-08 4:07 
AnswerRe: StringBuilder Speed Question Pin
Reelix21-May-08 4:25
Reelix21-May-08 4:25 
GeneralRe: StringBuilder Speed Question Pin
Mike Dimmick21-May-08 6:28
Mike Dimmick21-May-08 6:28 
Questionread sql messages Pin
Peterpod21-May-08 3:09
Peterpod21-May-08 3:09 
AnswerRe: read sql messages Pin
Peter Josefsson Sweden21-May-08 4:34
Peter Josefsson Sweden21-May-08 4:34 
QuestionHow to Cancel KeyDown event ? Pin
hdv21221-May-08 2:38
hdv21221-May-08 2:38 
AnswerRe: How to Cancel KeyDown event ? Pin
Giorgi Dalakishvili21-May-08 3:26
mentorGiorgi Dalakishvili21-May-08 3:26 
GeneralRe: How to Cancel KeyDown event ? Pin
hdv21221-May-08 3:37
hdv21221-May-08 3:37 
QuestionHow to get custom property name of docx file using IFilter? Pin
Prazwol21-May-08 1:43
Prazwol21-May-08 1:43 

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.