Unmanaged IPictureDisp To Managed Object

0

I'm working Api call dll for Excel with VB.Net. (Robert Giesecke' s unmanaged exports) Standard types (numeric, strings) are working. But, when try with object type return error.

Error message is: "Unknown name. (HRESULT exception returned: 0x80020006 (DISP_E_UNKNOWNNAME))"

My function is (Error is IPictureDisp To Bitmap):


Public Function GetTextQR_FromPicture(ByVal pictureDisp As IPictureDisp) As [MarshalAs(UnmanagedType.BStr)] String
      'IPictureDisp
      Return _qrDec.decode(New QRCodeBitmapImage(PicHelper.GetPictureFromIPictureDisp(pictureDisp)), Encoding.UTF8)
End Function

My helper class:



Friend Class PicHelper
   Inherits System.Windows.Forms.AxHost

   Friend Sub New()
      MyBase.New(Nothing)
   End Sub

   Friend Shared Shadows Function GetIPictureDispFromPicture(image As Image) As Object
      Return System.Windows.Forms.AxHost.GetIPictureDispFromPicture(image)
   End Function

   Friend Shared Shadows Function GetPictureFromIPictureDisp(picture As IPictureDisp) As Image
      Return System.Windows.Forms.AxHost.GetPictureFromIPictureDisp(picture)
   End Function
End Class
vb.net
dll
unmanaged
asked on Stack Overflow Dec 2, 2018 by Zeki Gürsoy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0