Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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 8: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 at 24-Aug-12 17:38pm
It works
Espen Harlinn at 25-Aug-12 4:24am
That's good :-D
Lesha Dubenko at 1-Oct-12 10:50am
Espen Harlinn at 1-Oct-12 10:56am
You're welcome :-D
MehranMsba at 4-Oct-12 11:49am
Pritesh Aryan at 10-Nov-12 1:53am
Thanks it helps me.....
real_teddy at 25-Dec-12 0:55am
I had the same problem, and the solution worked for me.
yeng thao at 15-Feb-13 0:09am
It work... Thanks
Espen Harlinn at 15-Feb-13 3:46am
Brilliant :-D
Parity Bit at 27-Feb-13 2:51am
Thanks, I have spent hours trying to figure out what's wrong. This worked flawlessly
masi sh at 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 at 22-Apr-13 3:44am
It's in the same place - it probably reads 'Any CPU' at the moment ...
masi sh at 28-Apr-13 0:34am
tnx Espen
Sergey Alexandrovich Kryukov at 25-Apr-13 19:04pm
Good catch, a 5.
Espen Harlinn at 25-Apr-13 19:05pm
Thank you, Sergey :-D
Kavitha le at 2-May-13 6:43am
I tried this . It is not working is there any other solutions?
Espen Harlinn at 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 at 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
0 OriginalGriff 390
1 Maciej Los 205
2 Peter Leow 140
3 Suvendu Shekhar Giri 134
4 Abhinav S 126
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 8,895
2 Peter Leow 5,044
3 Kornfeld Eliyahu Peter 3,333
4 Maciej Los 2,561

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 6 Mar 2014
Copyright © CodeProject, 1999-2015
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