Hi, i would like integrate Milestone on a asp.net web site . I need visualize live cam on mi site selecting a specific camera.
I try create a new asp.net web site, add the ActiveX ( EngineManager, ImageViewer ) as References. I can invoke methods and compile code behind without errors, but when i run the site, throw “Catastrophic Failure(Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))”
The error code is not telling much, so I cannot say exactly what is the problem, but have you followed the instructions found in the SDK article “Hosting ActiveX Components” in the Component Integration section?
Also the “Image Viewer (html)” sample might give a hint to what is the problem if you try to compare it to what you have done.
An alternative approach (which would also have the advantage of working on non-Windows computers) would be to use the Mobile Server instead of the ActiveX approach. You can have a look at the “Mobile Server protocol sample” in the Protocol Integration section to get an idea of how this is done.
EngineManagerClass engineManager = new EngineManagerClass();
ImageViewerDotNetClass imageViewer = new ImageViewerDotNetClass();
public string usr;
public string pass;
public string url;
public bool XPCO = false;
public short LoginCount;
protected void Page\_Load(object sender, EventArgs e)
{
try
{
/\*INICIALIZO LOS ACTIVEX\*/
engineManager.Init();
imageViewer.Init();
imageViewer.SetOnConnectResponseReceivedEventStatus(Convert.ToInt16(true));
imageViewer.SetOnImageReceivedEventStatus(Convert.ToInt16(false));
//imageViewer.SetOnAlarmsReceivedEventStatus(true);
imageViewer.SetOnAviInfoReceivedEventStatus(1);
imageViewer.SetOnExportCompletedEventStatus(1);
/\*CONECTO \*/
engineManager.SetAuthentication(Convert.ToInt16(1));
//engineManager.SetAuthentication(authenticationTypeValue);
usr = "Admin";
pass = "admin";
url = "[http://srvvideo](http://srvvideo)";
url = url + "/systeminfo.xml"; // XProtect Enterprise Url
engineManager.QueryEngineAsynchronous(usr, pass, url);
LoginCount = 0;
}
catch(Exception ex)
{
throw ex;
}
}
This is the error details:
THROW EXCEPTION WHEN EXECUTEengineManager.Init();
System.Runtime.InteropServices.COMException was unhandled by user code
HResult=-2147418113
Message=Error catastrófico (Excepción de HRESULT: 0x8000FFFF (E_UNEXPECTED))
Source=mscorlib
ErrorCode=-2147418113
StackTrace:
en axRef.Page\_Load(Object sender, EventArgs e) en [C:\\Users\\esantos\\Documents\\Visual](file:C:/Users/esantos/Documents/Visual) Studio 2015\\WebSites\\TestActveX\\axRef.aspx.cs:línea 57
en System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
en System.Web.UI.Control.OnLoad(EventArgs e)
en System.Web.UI.Control.LoadRecursive()
en System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
If I assume you load the EngineManager on the server side, this will not work. The EngineManager and the ImageViewer are ActiveX components and need to hook up on a handle, e.g. some UI component. So this cannot work on a server implementation. You should use the .Net part of our library : VideoOS.Platform.SDK.dll and consider to either run all requests as same person towards XProtect, or use the MultiUserEnvironment to have each user (not each request!) have his own environment. The initialization part of ASP.NET could be used to initialize the MIPSDK for the selected environment.