Possible to interact with a 64-bit COM server (Photoshop) from .NET?

后端 未结 6 896
甜味超标
甜味超标 2021-02-05 22:59

I\'ve been trying to write some code to interact with Photoshop, both by adding a COM reference and by late binding. It took me a while to realise that the code did work, but no

6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 23:51

    Assuming from the little information we have:

    Quoted from: When CoCreateInstance returns 0x80080005 (CO_E_SERVER_EXEC_FAILURE)


    ... If the client fails to call CoRegisterClassObject() from the moment the process was started, or fails to call CoRegisterClassObjects() at all for the given class factory, then the client will receive the CO_E_SERVER_EXEC_FAILURE error in CoCreateInstance(...). This can happen for a variety of reasons:

    1) The machine has a high CPU load and the process takes a long time to start and execute the CoRegisterClassObjects() in less than 120 seconds.

    2) The COM server doesn't register for the right class IDs.

    3) The COM server is currently stopping and there is a race condition between CoCreateInstance and the COM server stopping part.

    4) There is a security problem in the way the COM server is started (this page seems to suggest misspelled passwords or lacking the "Login as Batch Job" privilege for "Run As.." COM servers, but anyway I would suggest re-verifying this information for your specific configuration)

提交回复
热议问题