Loading and freeing core.dll and pxc_inst successively in different threads
Posted: Wed Feb 27, 2019 2:06 pm
Hey,
I am working on a Wrapper of your IPXC_Document class.
When the first document is created in my program, I load the Core dll and instantiate the IPXC_INST in an abstract Manager class.
Afterwards I keep track of the number of documents that are reachable. When this count becomes zero, I finalize the IPXC_INST and call FreeLibrary on the dll. So far so good.
Now, I have discovered some curious behaviour. When i create my first document in a Task (main thread is STA), do some work on it and dispose of it afterwards, the IPXC_INST is finalized and the dll is freed as desired (still in the same thread).
But if I proceed by creating a new instance of my document class in the main thread, the new IPXC_INSTANCE throws the following Exception, when I try to call methods on it:
0x80004002 (E_NOINTERFACE) (no such interface supported)
this does not happen, if I create and dispose documents in the main thread only (no matter how often I reload the library).
Do you have any idea, why this is?
best regards,
Kutusow
I am working on a Wrapper of your IPXC_Document class.
When the first document is created in my program, I load the Core dll and instantiate the IPXC_INST in an abstract Manager class.
Afterwards I keep track of the number of documents that are reachable. When this count becomes zero, I finalize the IPXC_INST and call FreeLibrary on the dll. So far so good.
Now, I have discovered some curious behaviour. When i create my first document in a Task (main thread is STA), do some work on it and dispose of it afterwards, the IPXC_INST is finalized and the dll is freed as desired (still in the same thread).
But if I proceed by creating a new instance of my document class in the main thread, the new IPXC_INSTANCE throws the following Exception, when I try to call methods on it:
0x80004002 (E_NOINTERFACE) (no such interface supported)
this does not happen, if I create and dispose documents in the main thread only (no matter how often I reload the library).
Do you have any idea, why this is?
best regards,
Kutusow