Foxtable(狐表)用户栏目专家坐堂 → [求助]AfterOpenProject 错误提示


  共有2022人关注过本帖树形打印复制链接

主题:[求助]AfterOpenProject 错误提示

帅哥哟,离线,有人找我吗?
zcgmxf
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1652 积分:14691 威望:0 精华:0 注册:2014/6/6 8:42:00
[求助]AfterOpenProject 错误提示  发帖心情 Post By:2016/2/22 15:25:00 [只看该作者]

老师,我的项目以前发布后使用没问题。前天整合论坛里图片管理器增加拍照扫描功能的实例成功,发布后再本机上使用没问题,但在其它电脑上使用出现以下错误提示。请分析一下原因。谢谢!

 

.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2015.12.22.1
错误所在事件:项目,AfterOpenProject
详细错误信息:
“UserCode”的类型初始值设定项引发异常。
No devices of the category

 

他的项目全局代码如下:

'Public Scan As  AxScanlibctl.aximgscan   '定义图像扫描控件


'拍照事件
Public Sub LinkLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 Forms("拍照").Open
End Sub
'扫描事件
Public Sub LinkLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim frm As WinForm.Form = Forms("图片管理器")
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim imageFile As WIA.imageFile
Dim cdc As  New WIA.CommonDialogClass()

Try
    imageFile = cdc.ShowAcquireImage(WIA.WiaDeviceType.ScannerDeviceType, WIA.WiaImageIntent.TextIntent, WIA.WiaImageBias.MaximizeQuality, "{00000000-0000-0000-0000-000000000000}", True, True,False)
    If  imageFile IsNot Nothing Then
        Dim path As String = ProjectPath & "Attachments\sm" & Format(Date.Now,"yyyyMMddHHmmss") & ".jpg"
        imageFile.SaveFile(path)
        piv.AddFile(FileSys.GetName(path))
    End If
Catch generatedExceptionName As System.Runtime.InteropServices.COMException
    MessageBox.Show("您的扫描仪尚未准备好!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
End Try
End Sub

'左转90
Public Sub LinkLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim zp As String = piv.SelectedItem
If zp IsNot Nothing Then
    Dim bmp As New bitmap(zp)
    bmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
    bmp.save(zp)
    Dim obj As object = piv.basecontrol.Controls(0)
    Dim pic As Object = obj.panel1.controls("PictureSplitContainer").Panel1.controls("panel2").controls("C1PictureBox1")
    pic.Image = bmp
End If

End Sub

'右转90
Public Sub LinkLabel3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim zp As String = piv.SelectedItem
If zp IsNot Nothing Then
    Dim bmp As New bitmap(zp)
    bmp.RotateFlip(RotateFlipType.Rotate270FlipNone)
    bmp.save(zp)
    Dim obj As object = piv.basecontrol.Controls(0)
    Dim pic As Object = obj.panel1.controls("PictureSplitContainer").Panel1.controls("panel2").controls("C1PictureBox1")
    pic.Image = bmp
End If
End Sub

'打印
Public Sub LinkLabel4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
If piv.SelectedItem IsNot Nothing Then
    Dim doc As New PrintDoc '定义一个报表对象
    Dim rm As New prt.RenderImage '定义一个图片对象
    rm.Image = getImage(piv.SelectedItem)
    doc.Body.Children.Add(rm) '将图片对象加入报表
    Doc.Preview() '预览
End If
End Sub


'摄像头
Public _Cap As DCap.Capture
Public _Cams As DCap.Filters = New DCap.Filters()
Public _Cam As DCap.Filter
Public _CamList As New List(Of String)
Public _CamIndex As Integer


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/2/22 15:27:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
zcgmxf
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1652 积分:14691 威望:0 精华:0 注册:2014/6/6 8:42:00
  发帖心情 Post By:2016/2/22 16:16:00 [只看该作者]

谢谢!

 回到顶部