Answered UccOperationContext in background thread

  • Monday, July 02, 2012 11:56 PM
     
     

    Following simple code complain about an access violation when executed in a background thread. It works fine if executed in an UI thread. Any one know how to fix this?

    UccOperationContext context = new UccOperationContextClass();
    context.Initialize(1, null);
    context.Context.AddProperty(1, session.GetHashCode());

    Or 

    UccOperationContext oc = new UccOperationContext();
    UccContext c = new UccContextClass();
    c.AddNamedProperty(key, value);
    oc.Initialize(1, c);

All Replies

  • Friday, October 26, 2012 9:15 PM
     
     Answered
    This does not work in just background thread because this is COM API and need message loop. Created thread with message loop to avoid issue.
    • Marked As Answer by Ashvin Patel Friday, October 26, 2012 9:15 PM
    •