Click here to Skip to main content
Rate this: bad
good
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();
 
((System.ComponentModel.ISupportInitialize)(axDriver)).BeginInit();
 
SuspendLayout();
 
//
 
// 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";
 
try
 
{
 
((System.ComponentModel.ISupportInitialize)(axDriver )).EndInit();
 
}
 
catch (Exception ex)
 
{
 
string sss = ex.Message;
 
}
 
ResumeLayout(false);
 

 
Getting issue in the try block.
 

 
Please help
 

 
Regards,
 
Nidheehs
Posted 16-Aug-11 8:23am
Rate this: bad
good
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
  Permalink  
Comments
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
   
thanks!
Espen Harlinn at 1-Oct-12 10:56am
   
You're welcome :-D
MehranMsba at 4-Oct-12 11:49am
   
Thanks....
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.
—SA
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, http://technet.microsoft.com/en-us/library/bb490985.aspx, 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
good
Please Sign up or sign in to vote.

Solution 2

You can find the solution here:
http://support.esri.com/en/knowledgebase/techarticles/detail/33000
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


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