.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > Active X Vista X64
 

Active X Vista X64

I'm working on a project that involves an Active X object. When I reference the ocx file in my vb 2008 express project I have no problems. I drop the object from the tool box and it appears on my form and displayes streaming video just fine. The ocx is an ip camera control. The only code running is the form_load however I get an error only in Vista X64:

An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
Source="WindowsApplication2"
StackTrace:
at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at WindowsApplication1.My.MyProject.MyForms.get_Form1()
at WindowsApplication1.My.MyApplication.OnCreateMainForm() in C:\Users\techs\Documents\Visual Studio 2008\Projects\WindowsApplication2\WindowsApplication2\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Runtime.InteropServices.COMException
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 WindowsApplication1.Form1.InitializeComponent() in C:\Users\techs\Documents\Visual Studio 2008\Projects\WindowsApplication2\WindowsApplication2\Form1.Designer.vb:line 47
at WindowsApplication1.Form1..ctor()
InnerException:

I've searched and have concluded the error being thrown is directly related to the x64 registry. I've tried going line by line in the registry but everything looks ok.Theocx is obviously 32bitAny suggestions?
Dstylesunf
You'll have to force your VB.NET app to run in 32-bit mode so the ActiveX control can work. Project + Properties, Compile tab, scroll down, Advanced Compile Options, set Target CPU to x86.
Hans Passant.
nobugz
You'll have to force your VB.NET app to run in 32-bit mode so the ActiveX control can work. Project + Properties, Compile tab, scroll down, Advanced Compile Options, set Target CPU to x86.
Hans Passant.
nobugz
Hello,

I have basically the identical problem, however, my Advanced Compile Options dialog doesn't have a Target CPU selection list. Is this perhaps a limitation of the Express edition of VB?

thanks!
Dave
birds776
It is.
Hans Passant.
nobugz

You can use google to search for other answers

Custom Search

More Threads

• advpack.dll error, different than the other topic.
• Porting ActiveX control to x64
• Run 32 bit .NET app under 64 bit .NET framework
• C# + VS2005 + SmtpClient not working on Win 64 2k3
• AVIMakeCompressedStream - InterOp problems
• Error while trying to run project: Unable to start debugger.
• Did Windows Vista SP1 includes .Net Framework 3.0 sp1 and .Net framework 2.0 sp1
• Problems Exposing .NET class to COM (Excel addin)
• Trouble betweeen xp32 and xp64 within the same vs 2003 app
• quick ?