Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Artur Lowen

@Artur Lowen
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Executing delegate in a different thread
    A Artur Lowen

    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;
    }
    
    C# help question csharp sysadmin

  • Executing delegate in a different thread
    A Artur Lowen

    I have a problem while trying to execute a delegate in a different thread. I have my application and autocad that has loaded my .net-dll. I created a named-pipe-server (in an own thread in the dll for autocad) and send messages to it from my application. The thread with the server watis for the messages and executes a delegate on receiption. The method in my class (in the dll) is called and I can show it with a messagebox. Till here everything is fine. But now I want to open a new file for autocad and I try to use the regarding method-call (AcadApp.Application.DocumentManager.Open(file)). But here is the problem. I get an exception about internal error or wrong context. I'm still in the thread-context of my listening server and I think that is the problem. But how can I execute a function in the autocad-thread? My initialization-function that creates the listening-thread is executed in the autocad-thread-context so I can get Thread-object or whatever is needed.

    C# help question csharp sysadmin

  • problem with Left$-Function in VB6
    A Artur Lowen

    hi, I did VB6 a very long time ago...nearly forgot about it, but now I have to do a project in vb. My problem is I get the following error when using the Left$-Function: Type-declaration character doesn't match declared data type. Here is my code: Public Sub Main() Dim s As String s = Left$("test", 2) End Sub What can it be ? As far as I remember it should work like this. It is also explained in the MSDN like this. Thanks for help Azrah

    Visual Basic help regex question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups