Acabo de desarrollar un control ActiveX muy simple (utilizando el asistente de VS.NET, ni siquiera cambiar una línea), y lo compilé. Después de ejecutar "regsvr32 ax1.ocx", creé un nuevo proyecto C# WinFrom y arrastré el control ActiveX al formulario. A continuación, voy a construir y ejecutarlo, el error dice:incrustando un control ActiveX simple tiene Clase no registrado error
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
dentro de la línea:
((System.ComponentModel.ISupportInitialize)(this.axax11)).EndInit();
La función entera es:
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);
}
Por cierto, me estoy ejecutando en 64 bits Windows 7 –
Actualización: si descomiento la línea de EndInit() (que es la línea que causa la excepción), entonces no hay ninguna excepción. No sé por qué. –