Click here to Skip to main content
13,088,711 members (53,583 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Friends,

We developed one windows application using VS 2005 with framework 2.0. This application is running perfectly on 32 bit Operating System. Now we need to give support for 64 bit OS.

While working with 64 bit Operating System we are getting the below error message.

"Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))".

Following is the code block

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Driver));

this.axDriver = new AxCCNAccess.AxDriver();




// axDriver


axDriver .Enabled = true;

axDriver .Location = new System.Drawing.Point(241, 211);

axDriver .Name = "axDriver ";

axDriver .OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axDriver .OcxState")));

axDriver .Size = new System.Drawing.Size(41, 42);

axDriver .TabIndex = 0;


// Driver


AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

ClientSize = new System.Drawing.Size(292, 266);

Controls.Add(axDriver );

Name = "DriverContainer";

Text = "DriverContainer";



((System.ComponentModel.ISupportInitialize)(axDriver )).EndInit();


catch (Exception ex)


string sss = ex.Message;



Getting issue in the try block.

Please help


Posted 16-Aug-11 7:23am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You are trying to embed a 32-bit ocx in a 64-bit application.

Your application will probably run just fine if you force to run as a 32-bit application on a 64-bit OS ... project properties -> build -> Platform Target = x86

Best regards
Espen Harlinn
gutierrezfdo 24-Aug-12 17:38pm
It works
Espen Harlinn 25-Aug-12 4:24am
That's good :-D
Lesha Dubenko 1-Oct-12 10:50am
Espen Harlinn 1-Oct-12 10:56am
You're welcome :-D
MehranMsba 4-Oct-12 11:49am
Pritesh Aryan 10-Nov-12 1:53am
Thanks it helps me.....
real_teddy 25-Dec-12 0:55am
I had the same problem, and the solution worked for me.
yeng thao 15-Feb-13 0:09am
It work... Thanks
Espen Harlinn 15-Feb-13 3:46am
Brilliant :-D
Parity Bit 27-Feb-13 2:51am
Thanks, I have spent hours trying to figure out what's wrong. This worked flawlessly
masi sh 22-Apr-13 2:37am
i can't find platform target in visual studio 2010, please help me, i'm really in need!!!!
Espen Harlinn 22-Apr-13 3:44am
It's in the same place - it probably reads 'Any CPU' at the moment ...
masi sh 28-Apr-13 0:34am
tnx Espen
Sergey Alexandrovich Kryukov 25-Apr-13 19:04pm
Good catch, a 5.
Espen Harlinn 25-Apr-13 19:05pm
Thank you, Sergey :-D
Kavitha le 2-May-13 6:43am
I tried this . It is not working is there any other solutions?
Espen Harlinn 2-May-13 6:48am
Yes, the typelibrary/activex constrol may actually not be registered on the target system.

Regsvr32,, can sometimes be used to fix this, but you need to have the access rights required to register the typelibrary/activex constrol on the target system.
manish78 6-Mar-14 9:05am
Awesome, I was struggling with this issue and finally read this. It works.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can find the solution here:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 6 Mar 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100