Hi,
I have developoed a .Net dll(Autocad plugin) in which it tries to create a task on another thread.
The task lauches another instance of Autocad via COM interop and sends commands. But this throws exceptions at different points like SendCommand(...).
I know .Net APIs are not multithread, but here no .Net APIs are called in this new thread, and all COM object methods
are being called in the same thread(the newly created one) that the new Autocad instance is created(via COM).
Dose anyone know what the problem is ?
Many thanks
aligili wrote:...The task lauches another instance of Autocad via COM interop and sends commands. But this throws exceptions at different points like SendCommand(...). ...
What exceptions are throwing?
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thanks for your reply,
this exception is thrown :
the message filter indicated that the application is busy
HRESULT: (RPC_E_SERVICECALL_RETYLATER)
acAcadApp.BeginCommand += new _DAcadApplicationEvents_BeginCommandEventHandler(acSeperateApp_BeginCommand);
acAcadApp.EndCommand += new _DAcadApplicationEvents_EndCommandEventHandler(acSeperateApp_EndCommand);
acAcadApp.BeginOpen += new _DAcadApplicationEvents_BeginOpenEventHandler(acSeperateApp_BeginOpen);
acAcadApp.EndOpen += new _DAcadApplicationEvents_EndOpenEventHandler(acSeperateApp_EndOpen);
either at
-acAcadDoc.SendCommand(cmd);
or at the time of registering application events :
-AcadApplication acAcadApp = new AcadApplication();
if (acAcadApp == null) return false;
acAcadApp.BeginCommand += new _DAcadApplicationEvents_BeginCommandEventHandler(acSeperateApp_BeginCommand);
acAcadApp.EndCommand += new _DAcadApplicationEvents_EndCommandEventHandler(acSeperateApp_EndCommand);
acAcadApp.BeginOpen += new _DAcadApplicationEvents_BeginOpenEventHandler(acSeperateApp_BeginOpen);
acAcadApp.EndOpen += new _DAcadApplicationEvents_EndOpenEventHandler(acSeperateApp_EndOpen);
acAcadApp.Visible = false;
I also removed registering the events for the COM object but did not change anything.
@aligili wrote:
Thanks for your reply,
this exception is thrown :
the message filter indicated that the application is busy
HRESULT: (RPC_E_SERVICECALL_RETYLATER)
Maybe RPC_E_SERVERCALL_RETRYLATER ?
Try this solution: http://through-the-interface.typepad.com/through_the_interface/2010/02/handling-com-calls-rejected-b...
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn