以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  dll这样写为什么错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=145519)

--  作者:goldenfont
--  发布时间:2020/1/28 1:03:00
--  dll这样写为什么错误
老师,我写了个dll,是用来在单元格里点击,跳出对话框,然后把选中的文件拷贝到固定的目录里的,但是会出错,请帮忙看一下
dll里的代码
Imports F oxtable
Imports System.Windows.Forms
Public Class ImageEditor
    Public c As D ataCol
    Public r As D ataRow
    
    Public Function Show(r1 As D ataRow, c1 As D ataCol) As Object
        r = r1
        c = c1
        Dim dlg As OpenFileDialog
        Dim name As String = Nothing
        Dim path As String = Nothing
        dlg.Filter = "所有图像文件 (*.bmp*.gif*.jpg*.jpeg*.png)|*.bmp;*.gif;*.jpg;*.jpeg;*.png|位图文件 (*.bmp*.ico)|*.bmp;*.ico|图元文件 (*.emf*.wmf)|*.*"
        If (dlg.S howDialog = D ialogResult.OK) Then
            path = dlg.F ileName \'path是含路径的文件名
        Else
            Return Nothing
        End If
        name = F ileSys.GetName(path) \'name是只有文件名
        Dim file As String = P rojectPath & "Images\\" & name \'file是在projectpath\\Images\\文件名
        \'接下来判断,如果选择的path和在file里不匹配,也就是从别的地方选择的图片,那么要把它拷贝到images下面
        If Not F ileSys.FileExists(file) Then
            F ileSys.CopyFile(path, file, True)
        End If
        r(c.Name) = name \'在表格中是只存文件名的
        Return Nothing
    End Function
End Class

编译没问题,然后在cellbuttonclick中使用
dim a as new dll.ImageEditor
a.Show(row,col)
可是为什么说提示找不到这个Show这个方法啊

--  作者:程兴刚
--  发布时间:2020/1/28 1:14:00
--  
第一行F后面那一个空格的作用是什么?还有F ileName、F ileSys.GetName、P rojectPath、dlg.S howDialog、D ialogResult.OK……等等,为什么第一个大写字母后面都要加一个空格?其他的我也不懂!
--  作者:程兴刚
--  发布时间:2020/1/28 1:15:00
--  
还有 D ataColD ataRow
--  作者:有点蓝
--  发布时间:2020/1/28 10:25:00
--  
vs开发的dll?命名空间是什么?添加引用了吗?http://www.foxtable.com/webhelp/topics/1936.htm

源项目发上来看看