방금 VS.NET 마법사를 사용하여 선을 변경하지 않고 매우 간단한 ActiveX 컨트롤을 개발하고 컴파일했습니다. "regsvr32 ax1.ocx"를 실행 한 후 새 C# WinFrom 프로젝트를 만들고 ActiveX 컨트롤을 폼으로 끌어옵니다. 그럼 구축 및 실행 오류는 말한다 :간단한 ActiveX 컨트롤 임베드 클래스가 등록되지 않았습니다. 오류
((System.ComponentModel.ISupportInitialize)(this.axax11)).EndInit();
전체 기능은 다음과 같습니다 : 라인 내에서
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.axax11 = new Axax1Lib.Axax1();
((System.ComponentModel.ISupportInitialize)(this.axax11)).BeginInit();
this.SuspendLayout();
//
// axax11
//
this.axax11.Enabled = true;
this.axax11.Location = new System.Drawing.Point(103, 90);
this.axax11.Name = "axax11";
this.axax11.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axax11.OcxState")));
this.axax11.Size = new System.Drawing.Size(100, 50);
this.axax11.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.axax11);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.axax11)).EndInit();
this.ResumeLayout(false);
}
그런데 64 비트 Windows 7에서 실행 중입니다. –
업데이트 : EndInit()의 줄을 주석 처리하지 않은 경우 (이는 예외의 원인 인 줄입니다), 예외가 전혀 없습니다. 나는 이유를 모른다. –