Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 带外部.ocx控件的Visual basic=>;访问冲突_Vb.net - Fatal编程技术网

Vb.net 带外部.ocx控件的Visual basic=>;访问冲突

Vb.net 带外部.ocx控件的Visual basic=>;访问冲突,vb.net,Vb.net,我是这个网站的新手,我将立即从一个问题开始 目前我正在写一篇论文,但此刻我陷入了困境。我被要求通过Beckhoff Twincat3控制IP摄像机。由于这是基于VisualStudio的,我认为从visual basic开始测试和调试我编写的所有代码可能是一个好主意。我做的每件事都会导致违反 System.AccessViolationException未处理 HResult=-2147467261 消息=尝试读取或写入受保护内存。这通常表示其他内存已损坏。 Source=mscorlib 堆栈

我是这个网站的新手,我将立即从一个问题开始

目前我正在写一篇论文,但此刻我陷入了困境。我被要求通过Beckhoff Twincat3控制IP摄像机。由于这是基于VisualStudio的,我认为从visual basic开始测试和调试我编写的所有代码可能是一个好主意。我做的每件事都会导致违反

System.AccessViolationException未处理 HResult=-2147467261 消息=尝试读取或写入受保护内存。这通常表示其他内存已损坏。 Source=mscorlib 堆栈跟踪: 位于System.RuntimeType.ForwardCallToInvokeMember(字符串memberName、BindingFlags标志、对象目标、Int32[]aWrapperTypes、MessageData和msgData) 在RASplus_watsarlib._DRASplus_watsarl.setCameraMap(Int16 nCamNum、Int16 postKey、String szSiteName、String szAddr、Int16 nHostCam、String szUser、String szPasswd、Int16端口、布尔模式、布尔总线模式、布尔useDvrns、String szDvrnsAddr、Int16 dvrnsPort、Int16音频端口) 在AxRASplus_WatSearLib.AxRASplus_WatSear.setCameraMap(Int16 nCamNum、Int16 postKey、String szSiteName、String szAddr、Int16 nHostCam、String szUser、String szPasswd、Int16端口、布尔模式、Boolean bUseModem、Boolean useDvrns、String szDvrnsAddr、Int16 dvrnsPort、Int16 audioPort) 在activex\u camera.Form1.Button1\u单击C:\Users\BECKHOFF stage\documents\visual studio 2010\Projects\activex camera\activex camera\Form1.vb中的(对象发送者,事件参数e):第41行 在System.Windows.Forms.Control.OnClick(EventArgs e)中 在System.Windows.Forms.Button.OnClick(EventArgs e)中 在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs-mevent)上 在System.Windows.Forms.Control.WmMouseUp(Message&m、MouseButtons按钮、Int32单击) 位于System.Windows.Forms.Control.WndProc(Message&m) 位于System.Windows.Forms.ButtonBase.WndProc(Message&m) 在System.Windows.Forms.Button.WndProc(Message&m)中 在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)中 在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)中 在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd、Int32 msg、IntPtr wparam、IntPtr lparam) 在System.Windows.Forms.UnsafentiveMethods.DispatchMessageW(MSG&MSG)中 位于System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafentiveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID、Int32 reason、Int32 pvLoopData) 位于System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32原因,ApplicationContext上下文) 位于System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32原因,ApplicationContext上下文) 位于System.Windows.Forms.Application.Run(ApplicationContext上下文) 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()上 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()上 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(字符串[]命令行) 在17d14f5c-a337-4978-8281-53493378c1071中的activexèu camera.My.MyApplication.Main(字符串[]Args)处。vb:第81行 位于System.AppDomain.\u nExecuteAssembly(RuntimeAssembly程序集,字符串[]args) 位于System.AppDomain.ExecuteAssembly(字符串汇编文件、证据汇编安全性、字符串[]args) 在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()上 位于System.Threading.ThreadHelper.ThreadStart\u上下文(对象状态) 位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔保存SyncCTX) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态) 位于System.Threading.ThreadHelper.ThreadStart()处 内部异常:

我目前正在尝试连接摄像头,每次都会导致访问冲突

myCam.setCameraMap(i, CShort(0), "10.199.217.144", "10.199.217.144", i, "admin", "", CShort(8016), False, False, False, "dvrnames.net", 10088, 8116)

我希望有人能让我重回正轨。如果需要.ocx或其他文件,请毫不犹豫地与我联系。

我问我的老师是否知道出了什么问题,他提出了以下建议:

在程序中,我使用的是activex控件的“实例”。这导致访问冲突。他用直接控制装置把它修好了

毕竟这是有道理的

诚恳


Giovannivanasse

重新标记,这是VB.Net而不是VBAThank you。我不知道。