Closed ante75 closed 6 years ago
From the error message I guess your class H264_DVR_DEVICEINFO
needs a [Serializable]
attribute on top. The error message is not related to out parameters.
Kind Regards, Franz
Thanks for the help,
I added [Serializable]
Now the mistake became this
System.Runtime.Serialization.SerializationException:
'End of stream reached before the analysis is complete.'
Hi, can you paste some details of the Exception (stacktrace, message, etc)?
I copied the exception details, can you understand something?
Si è verificata l'eccezione System.Runtime.Serialization.SerializationException
HResult=0x8013150C
Messaggio=Fine del flusso raggiunta prima del termine dell'analisi.
Origine=mscorlib
Analisi dello stack:
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at LegacyWrapperClient.Client.WrapperClient.Invoke[T](String function, Object[] args) in D:\Programmierung\CSharp\LegacyWrapper\LegacyWrapperClient\Client\WrapperClient.cs:line 75
at TestVideo.XMSDK.WrapperH264_DVR_Login(String sDVRIP, UInt16 wDVRPort, String sUserName, String sPassword, H264_DVR_DEVICEINFO& lpDeviceInfo, Int32& error, SocketStyle socketstyle) in C:\Users\Operatore\Desktop\ZDIR\TEST VIDEO\TestVideo\TestVideo\XMSDK.cs:line 595
at TestVideo.MainWindow.Window_Loaded(Object sender, RoutedEventArgs e) in C:\Users\Operatore\Desktop\ZDIR\TEST VIDEO\TestVideo\TestVideo\MainWindow.xaml.cs:line 131
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Interop.HwndTarget.OnResize()
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Looking for the HResult code with this link tells me that A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.
So can you check all your type definitions for your delegate match the function in your dll?
this is the original call:
H264_DVR_DEVICEINFO dvrdevInfo = new H264_DVR_DEVICEINFO(); int nError; int nLoginID = XMSDK.H264_DVR_Login(ip, port, User, Password, out dvrdevInfo, out nError, SocketStyle.TCPSOCKET);
I can not understand what it refers to the error COR_E_SERIALIZATION 0x8013150c A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.
Have you got a proper API description of your desired function and its parameters at hand?
I try to find some information
For the moment thank you
Hello everyone I chiamao Alex, I'm trying to use WrapperClient but I have a problem I get an error by doing this:
ERROR: System.Runtime.Serialization.SerializationException: 'Il tipo 'TestVideo.H264_DVR_DEVICEINFO' nell'assembly 'TestVideo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' non è contrassegnato come serializzabile.'
THE PROBLEM IS IN Out H264_DVR_DEVICEINFO lpDeviceInfo ???
who can help me? thank you all