T
thought.contagion
I am having trouble figuring out why some of this VB.NET code does not
work on 64-bit OS.
Basically, we use MS' interop to speak to the OWC. I have a form
(ctlPivot) that holds a pivot table and during the initialization of
the form, we do the BeginInit and EndInit methods to initialize the
pivot table control:
CType(Me.MyPivotTable,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.MyPivotTable.OcxState=CType(resources.GetObject("MyPivotTable.OcxState"),System.Windows.Forms.AxHost.State)
' at the end:
CType(Me.MyPivotTable,
System.ComponentModel.ISupportInitialize).EndInit()
When that last line is called, it gives me this error:
System.Runtime.InteropServices.COMException occurred
ErrorCode=-2147221164
Message="Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG))"
Source="System.Windows.Forms"
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 ctlPivot.InitializeComponent()
Now, I am not sure if the stack trace is the same path even when it
works on 32-bit OS. Are the CreateWithoutLicense and
CreateWithLicense methods a clue that maybe something is wrong with
the license or does it go through this path no matter what? I can
start Excel but I can not activate it as it is a VLK and I think all
the keys got used up (the person who set it up is supposed to fix that
but for now I am trying to figure out if that matters or if there is
something else).
If not, what Class is not registered?
Any help would be appreciated. All of this works on 32-bit OS so I am
not quite sure what could be wrong if it is not the license.
Thank you.
work on 64-bit OS.
Basically, we use MS' interop to speak to the OWC. I have a form
(ctlPivot) that holds a pivot table and during the initialization of
the form, we do the BeginInit and EndInit methods to initialize the
pivot table control:
CType(Me.MyPivotTable,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.MyPivotTable.OcxState=CType(resources.GetObject("MyPivotTable.OcxState"),System.Windows.Forms.AxHost.State)
' at the end:
CType(Me.MyPivotTable,
System.ComponentModel.ISupportInitialize).EndInit()
When that last line is called, it gives me this error:
System.Runtime.InteropServices.COMException occurred
ErrorCode=-2147221164
Message="Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG))"
Source="System.Windows.Forms"
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 ctlPivot.InitializeComponent()
Now, I am not sure if the stack trace is the same path even when it
works on 32-bit OS. Are the CreateWithoutLicense and
CreateWithLicense methods a clue that maybe something is wrong with
the license or does it go through this path no matter what? I can
start Excel but I can not activate it as it is a VLK and I think all
the keys got used up (the person who set it up is supposed to fix that
but for now I am trying to figure out if that matters or if there is
something else).
If not, what Class is not registered?
Any help would be appreciated. All of this works on 32-bit OS so I am
not quite sure what could be wrong if it is not the license.
Thank you.