Is it possible to reuse the com object that I just released with: Marshal.ReleaseComObject(obj)
When ever I try the following:
dim obj as ObjectType = New ObjectType
Marshal.ReleaseComObject(obj)
obj = nothing
obj = New ObjectType
I get the error: COM object that has been separated from its underlying RCW cannot be used.
Why do I want to do this? - I got the periphery (Xenta payment terminal) that is connected with a com-port & I use a com object to talk with it. - I want to reinitialize the object without restarting the program. A normal: obj = nothing doesn't work. When I try to start the payment I get the following exception: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
I was wondering if there was any possibility that I can do that? Or any other suggestions on how to reinitialize my object?
Thanks!
User contributions licensed under CC BY-SA 3.0