Hello,
I'm currently starting to work with the Inventor API and trying to create an DLL via VB and the API Help (Inventor 2014, VS 2012)
At the moment I'm creating a costumized Ribbon-Interface using the "Customizing the User Interface" example from the help.
The example introduces a conversion class:
<System.ComponentModel.DesignerCategory("")> _ Friend Class PictureConverter Inherits System.Windows.Forms.AxHost Private Sub New() MyBase.New(String.Empty) End Sub Public Shared Function ImageToPictureDisp( _ ByVal image As System.Drawing.Image) As stdole.IPictureDisp Return CType(GetIPictureDispFromPicture(image), stdole.IPictureDisp) //this line causes the error End Function End Class
I wondered y the Add-In did'nt work properly (it starts without error message though). So I've started debugging and I've been receiving the following error message (in the marked line above):
Unable to cast COM object of type 'System.__ComObject' to interface type 'MYProjectVB.stdole.IPictureDisp'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{51452490-C779-3F1E-8DEA-19DAC8EBDFE2}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
I googled a lot, but no solution (of similar problems) helped me. Any Ideas or Suggestions? That'd be great!