none
64 Bit Windows 7 RRS feed

  • Question

  • Hi Experts

    I have window forms application currently working fine on 32 Bit Application and i am investigation so we can install it on a 64 bit computer but getting on lauching the application as below.

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

    The error is located on AxInterop.MSScriptControl.dll - is there a copy of this dll available for download that can work on both 32bit and 64bit computer.

    Any help will be highly appreciated.

    Thanks


    Bhavesh

    Tuesday, February 21, 2012 3:02 PM

Answers

  • If it ONLY lives in C:\Windows\SysWOW64, then your .Net application cannot run in 64-bit mode.  Make sure you compile it for x86 instead of Any CPU.  Then you'll be able to use it in 64-bit Windows, but it will be a 32-bit process.

    Jose R. MCP

    • Marked as answer by brvaland Tuesday, February 21, 2012 5:10 PM
    Tuesday, February 21, 2012 5:01 PM

All replies

  • The error "Class not registered" means that you are trying to use an ActiveX control that is not registered.  In 32-to-64-bit migrations, that may signify that the ActiveX control is only available for 32-bit platforms.  So question:  Is your ActiveX control available for 64-bit platforms too?  If yes, have you registered it?  What kind of shell does this ActiveX have (DLL or executable)?


    Jose R. MCP

    Tuesday, February 21, 2012 3:55 PM
  • Thanks for your quick reply.

    The ActiveX we are using is Microsoft Com Interop (Dependencies\Microsoft\InteropWrapper\AxInterop.MSScriptControl.dll). Is there a 64Bit version for the dll?


    Bhavesh

    Tuesday, February 21, 2012 4:08 PM
  • That is not the ActiveX.  That is the Interop DLL that is used to import the ActiveX into the .Net realm.  As you can see from that subdirectory, it is a wrapper dll.  So which ActiveX is it?

    Jose R. MCP


    • Edited by webJose Tuesday, February 21, 2012 4:11 PM
    Tuesday, February 21, 2012 4:11 PM
  • How can i figure that out as visual studio throws at the below line.

    ((System.ComponentModel.ISupportInitialize)(this.sctMain)).EndInit();

    Complete Error Message as below.

    System.Runtime.InteropServices.COMException occurred
      Message=Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
      Source=System.Windows.Forms
      ErrorCode=-2147221164
      StackTrace:
           at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
           at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
           at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
           at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
           at System.Windows.Forms.AxHost.CreateInstance()
           at System.Windows.Forms.AxHost.GetOcxCreate()
           at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
           at System.Windows.Forms.AxHost.CreateHandle()
           at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
           at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
           at System.Windows.Forms.AxHost.EndInit()
           at xxxx.Forms.frmMain.InitializeComponent() in frmMain.cs:line 1498
      InnerException:


    Bhavesh

    Tuesday, February 21, 2012 4:23 PM
  • The stack trace doesn't have information on the identity of the ActiveX.  But your project references should.  If you open the Add Reference dialog box and then go to the COM tab, do you have any already-selected items?  Which ones?

    Jose R. MCP

    Tuesday, February 21, 2012 4:26 PM
  • I have references added to the project but when right click on References folder and click on Add reference and navigate to Com tab there is nothing selected.


    Bhavesh

    Tuesday, February 21, 2012 4:37 PM
  • In the form designer file, there's probably a variable of some type coming from the wrapper dll.  If you hit F12 while having the caret over the type, it should show you the definition of that type.  That is probably an interface type with a CoClass GUID in one of the attributes.  If you can get the GUID, then you can find out the ActiveX.

    Jose R. MCP

    Tuesday, February 21, 2012 4:42 PM
  • I went to form designer file and when i right click on the control "sctMain" and there is ActiveX - About and this is "Microsoft Script Control, Version 1.0".

    Does this help ?


    Bhavesh

    Tuesday, February 21, 2012 4:46 PM
  • According to my Win7 32-bit PC, that is the ActiveX inside the file msscript.ocx, a dll.  Does this dll exist in Windows 7 64-bit?  If yes, where?  If it is in C:\Windows\SysWOW64, then it is the 32-bit version; if it is under C:\Windows\System32 then it is the 64-bit version.

    Jose R. MCP


    • Edited by webJose Tuesday, February 21, 2012 4:52 PM
    Tuesday, February 21, 2012 4:51 PM
  • The file msscript.ocx does exist in Windows 7 64-bit and as you said correctly - it is located in C:\Windows\SysWOW64.

    How can i fix my application to work on Windows 7 - 64bit ?


    Bhavesh

    Tuesday, February 21, 2012 4:56 PM
  • If it ONLY lives in C:\Windows\SysWOW64, then your .Net application cannot run in 64-bit mode.  Make sure you compile it for x86 instead of Any CPU.  Then you'll be able to use it in 64-bit Windows, but it will be a 32-bit process.

    Jose R. MCP

    • Marked as answer by brvaland Tuesday, February 21, 2012 5:10 PM
    Tuesday, February 21, 2012 5:01 PM
  • Thanks it worked.

    Bhavesh

    Tuesday, February 21, 2012 5:10 PM
  • Hi Jose

    A last question - as this is Microsoft ActiveX control. is there anything available as a replacement for "Microsoft Script Control, Version 1.o."

    Please advise?


    Bhavesh

    Tuesday, February 21, 2012 5:19 PM
  • Examining the type library in OLEView, I see that it has the following objects:  Procedure, Procedures, Module, Modules, Error and ScriptControl.  It seems that this control is used to control VBScript (and JScript?).  I am unaware of any replacement for this.  Google it up.

    Jose R. MCP

    Tuesday, February 21, 2012 5:49 PM