I've only programmed a bit in VB.Net 2005 after 15 years of VB 2 through 6. The transition hasn't been too bad, but I really get stuck on some of the errors generated when trying to convert VB6 code to VB.Net. The paragraph below means nothing to me.
The error happens on the line "aspTiff.Picture = thmb.ARGBData.Picture(w, h)"
aspTiff is a PictureBox
thmb is WIA.ImageFile (Windows Image Acquisition Library)
VB 2005 added several of the "UPGRADE_WARNING: Couldn't resolve default property of object w. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'"
The "Click for more" does nothing because they aren't really links. Very frustrating. The code worked perfectly in VB6. Any help is appreciated.
Greg
Unable to cast COM object of type 'System.__ComObject' to class type 'System.Drawing.Image'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
VB.NET:
Dim w As Integer
Dim h As Integer
If Not img Is Nothing Then
While (prcs.Filters.Count > 0)
prcs.Filters.Remove(1)
End While
prcs.Filters.Add(prcs.FilterInfos("Scale").FilterID)
prcs.Filters(1).Properties(1).let_Value(aspTiff.Width * 2)
prcs.Filters(1).Properties(2).let_Value(aspTiff.Height * 2)
thmb = prcs.Apply(img)
If Not thmb Is Nothing Then
If thmb.FrameCount = img.FrameCount Then
thmb.ActiveFrame = img.ActiveFrame
End If
'UPGRADE_WARNING: Couldn't resolve default property of object w. Click for more:
'ms-help://MS.VSCC.v80/dv_commoner/local/
redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
w = thmb.Width
h = thmb.Height
'UPGRADE_WARNING: Couldn't resolve default
property of object w. Click for more:
'ms-help://MS.VSCC.v80/dv_commoner/local/
redirect.htm?keyword=
"6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
aspTiff.Picture = thmb.ARGBData.Picture(w, h)
End If
End If
If img.FrameCount > 1 Then
lblImgCount.Text = img.FrameCount & " pages in the fax."
hscFrame.Minimum = 1
hscFrame.Maximum = (img.FrameCount + hscFrame.LargeChange - 1)
hscFrame.Value = img.ActiveFrame
hscFrame.Visible = True
Else
hscFrame.Visible = False
lblImgCount.Text = "One page in the fax."
End If
aspTiff is a PictureBox
thmb is WIA.ImageFile (Windows Image Acquisition Library)
VB 2005 added several of the "UPGRADE_WARNING: Couldn't resolve default property of object w. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'"
The "Click for more" does nothing because they aren't really links. Very frustrating. The code worked perfectly in VB6. Any help is appreciated.
Greg
Last edited by a moderator: