I develop a wpf user control derived from a MIPLibrary template and I put it into a Winform Host User control. However, at runtime the text “…Control implementation not loaded” appears and the streaming is not visible.
What you describe is not something I have experienced or seen described before.
We would need to have more information. Please describe more on what you have, how it behaves and what troubleshooting you have already done.
Does it matter if the WPF control has MIP content? It could be an issue not caused by the MIP SDK use.
A stack trace might give us good clues, so please include it also.
I done this:
-
I created a WPF .Net Framework 4.7.2 x64 WPF User Control Library Project
-
I added the MilestoneSystem.VideoOS.Platform.SDK version 25.2.3 from NuGet
-
I added the control to the xaml: ( <platformClient:ImageViewerWpfControl x:Name=“_imageViewer”)
-
I added a WindowsForm .Net Framework 4.7.2 project in which I inserted this WPF control into a Windows.form.integration.ElementHost control
-
In design mode and runtime the control displays the error “ImageViewerWpfControl implementation not loaded”
If I use the wpf control directly into a wpf app is working but my Main Application is in Winform and at this moment I can’t convert to WPF
We can offer a guess: We think this will happen if you do not initialize correctly. Please see if you have:
VideoOS.Platform.SDK.Environment.Initialize();
VideoOS.Platform.SDK.UI.Environment.Initialize();
It works! Thanks
But I have another problem: I want to load dynamically my dll from an external app. I need that the DLL is in a folder separated by the application that load it, but thus generated this error: "Could Not Open File ‘CoreToolkits.dll’. If instead the application is in the same DLL folder it works, however I need it to be in an external folder.
This is not easy.
The MIP SDK will need the unmanaged dll files to be present. It might be theoretically possible to change the ‘current working directory’ before loading the MIP SDK.
We have article that outlines a possible workaround, the article is specifically for IIS applications but does also fit the scenario you describe.
I forced the current directory on DLL and now it works.
Thank you very much!
I found this better solution:
Environment.SetEnvironmentVariable(“PATH”, Environment.GetEnvironmentVariable(“PATH”) + “;” + dlldir);
It’s better because doesn’t change current directory so does not affect then main program execution.