2009-12-01 2 views
8

방금 ​​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); 

    } 
+0

그런데 64 비트 Windows 7에서 실행 중입니다. –

+0

업데이트 : EndInit()의 줄을 주석 처리하지 않은 경우 (이는 예외의 원인 인 줄입니다), 예외가 전혀 없습니다. 나는 이유를 모른다. –

답변

12

내가 가정합니다 당신이 당신의 ActiveX 컨트롤을 썼다 비 관리 C++ 코드 이 컨트롤의 64 비트 버전을 만들거나이 컨트롤을 사용하는 .NET 프로그램을 강제로 32 비트 모드로 실행해야합니다. 후자는 Project + Properties, Build 탭, Platform Target = x86과 같이 더 빨리 수정되었습니다.

+0

고마워, 그거 멋지다! –

+0

그건 내 자신의 문제/질문을 해결하기 위해 무엇을했는지입니다. –

+1

@nobugz, 원래 질문을 올렸을 때 로그인하지 않으 셨다면 시간을 절약 해 주셨을 것입니다. :-) –

관련 문제