views:

157

answers:

1

In an attempt to try to confirm another SO posters suggestion for key handling in an ActiveX control hosted on a winforms window, I tried making a bare-bones MFC ActiveX control, then placing it on a windows form. In design time the control showed up with no troubles.

When running the application the dreaded "Class not registered exception." dialog appears.

Both projects are in VS 2008. The Winforms app is a .Net 3.5 framework application.

I've tried running through the debugger, from explorer (elevated privileges in both cases) and nothing seemed to work. I even ensured I manually registered the OCX with both the 64 bit and 32 bit regsvr32 executables.

This has me puzzled as I wouldn't expect this to not run. I've done similar experiments at work (32 bit Windows XP box) with no troubles.

My VS configuration is as follows:

  • Microsoft Visual Studio 2008
  • Version 9.0.30729.1 SP
  • Microsoft .NET Framework
  • Version 3.5 SP1

    The most confusing bit is that the ActiveX control seems to show up in design time. Any answers, suggestions, or thoughts will be appreciated.

A: 

I needed to change the output of the .Net host to x86 instead of "Any Platform." This is needed because the application is being JITTED to x64 which the ActiveX Control was not compiled for. D'oh! The app ran just fine after the change to ActiveX host project.

Jason D