我winform画面上添加我自定义的控件时,为什么会会报个"动态链接库(DLL)初始化失败"的错误啊,急死我了~!!!
我那个控件注册过了,COM组件里也添加过了,但是我把控件拖到我画面上的时候就报个"动态链接库(DLL)初始化失败"错误,拖不上去,然后我电脑重起了下之后又可以拖上去了,但是运行的时候又报错.代码如下:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents AxReceiptXFS1 As AxRECEIPTXFSLib.AxReceiptXFS
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.AxReceiptXFS1 = New AxRECEIPTXFSLib.AxReceiptXFS
CType(Me.AxReceiptXFS1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(128, 112)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 0
Me.Button1.Text = "打开打印机"
'
'AxReceiptXFS1
'
Me.AxReceiptXFS1.Enabled = True
Me.AxReceiptXFS1.Location = New System.Drawing.Point(112, 24)
Me.AxReceiptXFS1.Name = "AxReceiptXFS1"
Me.AxReceiptXFS1.OcxState = CType(resources.GetObject("AxReceiptXFS1.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxReceiptXFS1.Size = New System.Drawing.Size(100, 50)
Me.AxReceiptXFS1.TabIndex = 2
Me.AxReceiptXFS1.TabStop = False
Me.AxReceiptXFS1.Visible = False
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.AxReceiptXFS1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.AxReceiptXFS1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
运行到上面红的那句的时候就报错了,还是报那个"动态链接库(DLL)初始化失败",为什么啊,我的系统是XP的.高手都来帮我一下啊