Closed ghost closed 7 years ago
Hi there, the control requires a window (specifically, a HWND) to output the video steam and if the window has been destroyed (like in your case, I believe), then you have to recreate the control, otherwise you will get an exception.
Regards, Alexander
Hello Alexander,
I think I understand what you're saying, however this is upon exiting the application... there is no exception until I close my application. Creating and destroying the pages do not cause any issues (perhaps a memory leak but I haven't checked that yet).
Are you saying that I, for some reason, need to have the page with WebEye available and in memory upon exiting the application to not get this exception? That would be very strange to me, and I would like a way to invoke the close/release memory/or whatever to manually do that before I exit the application.
These would be the steps I'm doing:
If I do other steps, such as only going to the page with WebEye once or not even opening WebEye the first time, I don't get the exception. I've tested the code and the unload events are firing and I tried forcing garbage collection, neither helped the situation.
Any ideas based on this new information?
Thank you, Michael
Hi Michael,
Do you have a minimal VS project which reproduces the exception?
Regards, Alexander
Hello Alexander,
Here is a stripped down version that causes the exception: WebEyeIssue.zip
Steps to reproduce:
Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'C:\Users\xxx\Documents\Visual Studio 2015\Projects\WebEyeIssue\bin\Debug\Launcher.vshost.exe'.
Additional information: Transition into COM context 0x12e5f50 for this RuntimeCallableWrapper failed with the following error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)). This is typically because the COM context 0x12e5f50 where this RuntimeCallableWrapper was created has been disconnected or it is busy doing something else and cannot process the context transition. No proxy will be used to service the request on the COM component and calls will be made to the COM component directly. This may cause corruption or data loss. To avoid this problem, please ensure that all COM contexts/apartments/threads stay alive and are available for context transition, until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them.
I'm using Visual Studio 2015 with the latest updates, if that makes any difference.
Thank you, Michael
Hi Michael,
I see the issue and have a fix for it, just give me a day.
Regards, Alexander
Remove a reference to the WebEye.Controls.Wpf.WebCameraControl.dll file and add the following nuget package to your solution instead, it should fix the issue. https://www.nuget.org/packages/WebEye.Controls.Wpf.WebCameraControl/
Thank you for all your hard work Alexander, it's no longer crashing! :)
Hello,
When I'm using WebEye, I have put the control in a couple of WPF pages that you can navigate to on demand. However, I have an issue where if I open a page with the WebEye control, leave the page which should unload that previous page completly and then navigate back to the page with the WebEye control and then I close the application I get the following error that is not trappable and is thrown inside of Visual Studio...
I've tried attaching the source code but I cannot identify the location of the issue as I'm not terribly experienced connecting to COM like you are. It feels like an object was created but not cleaned up in the appropriate time.
I hope that you're still reviewing issues and might be able to shed some light on to why this issue is occurring so that I may correct it.
Thank you, Michael