Page 1 of 1

SafeArrayTypeMismatchException on SendBinary-Function

Posted: Fri Jan 05, 2007 9:52 am
by Heffer42
I am using the GflAx.dll library in a Visual Web Developer 2005 Express Edition Project.
Everything works fine until the SendBinary-Function is executed. A SafeArrayTypeMismatchException is thrown and the execution stops.

Here my code:
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Const AX_TIFF = 5
Dim Ctrl As GflAx.GflAx
Ctrl = New GflAx.GflAx

With Ctrl
.LoadBitmap(Server.MapPath(Nothing) & "\img1.tif")

Dim itest As Integer
itest = Ctrl.NumberOfPages

Dim myPage As String
Dim wantedPage As Integer
myPage = Request.QueryString("imgPage").ToString
If myPage.Length > 0 Then
wantedPage = CInt(myPage.ToString)
Else
wantedPage = 0
End If

If wantedPage > 0 And wantedPage <= itest Then
Ctrl.Page = wantedPage
End If

.FontName = "arial"
.FontSize = 13
.TextOut(.About, 2, 2, RGB(255, 255, 255)) 'Write library version on the picture
.SaveFormat = AX_TIFF

Response.ContentType = "image/tiff"
Response.BinaryWrite(.SendBinary())

End With
Ctrl = Nothing

Response.Flush()
End Sub
End Class

What could be the problem ?