Hi everybody,
I am currently trying to evelop a dll which should convert an old VB Images to a VB.NET Picture (both from the Imagebox object). This, I have learned, can be done through the 'System.Windows.Forms.AxHost'.
So, i have created a dll. The code is as follows:
Public Class ConvertImage
Inherits System.Windows.Forms.AxHost
Public Sub New()
MyBase.New("59EE46BA-677D-4d20-BF10-8D8067CB8B33")
End Sub
Public Shared Function ImageToIPicture(ByVal Image As System.Drawing.Image) As stdole.IPictureDisp
ImageToIPicture = GetIPictureFromPicture(Image)
End Function
Public Shared Function IPictureToImage(ByVal Image As stdole.IPictureDisp) As System.Drawing.Image
IPictureToImage = GetPictureFromIPicture(Image)
End Function
End Class
I have tried including the dll in other projects, and it works just fine. However, when trying to make this work in asp.net I get an error:
Compiler Error Message: BC30007: Reference required to assembly 'System.Windows.Forms' containing the base class 'System.Windows.Forms.AxHost'. Add one to your project.
Now, my development machine is not the same as the webserver; could it be that I need to copy some support-files or anything? My previous work seems to run just fine, so I'm not sure what can be wrong.
I am currently trying to evelop a dll which should convert an old VB Images to a VB.NET Picture (both from the Imagebox object). This, I have learned, can be done through the 'System.Windows.Forms.AxHost'.
So, i have created a dll. The code is as follows:
Public Class ConvertImage
Inherits System.Windows.Forms.AxHost
Public Sub New()
MyBase.New("59EE46BA-677D-4d20-BF10-8D8067CB8B33")
End Sub
Public Shared Function ImageToIPicture(ByVal Image As System.Drawing.Image) As stdole.IPictureDisp
ImageToIPicture = GetIPictureFromPicture(Image)
End Function
Public Shared Function IPictureToImage(ByVal Image As stdole.IPictureDisp) As System.Drawing.Image
IPictureToImage = GetPictureFromIPicture(Image)
End Function
End Class
I have tried including the dll in other projects, and it works just fine. However, when trying to make this work in asp.net I get an error:
Compiler Error Message: BC30007: Reference required to assembly 'System.Windows.Forms' containing the base class 'System.Windows.Forms.AxHost'. Add one to your project.
Now, my development machine is not the same as the webserver; could it be that I need to copy some support-files or anything? My previous work seems to run just fine, so I'm not sure what can be wrong.