要是你能说得更明白一点就好了!
它会反复调用一个函数,这函数你dll自己的,还是你程序里的?加条件就行了!
设置一个switch啊。呵呵,只有在符合要求的时候才执行。if (condition=1) then
'Your code
else
'Your code
end if

解决方案 »

  1.   

    那个dll控件所调用的函数是不是你在VB里面自定义的?
    看起来应该不是吧?
    如果不是的话那就没有办法了,因为那个函数你是无法控制的。
    如果是的话那就在这个函数中进行判断吧
      

  2.   

    谢谢楼上两位的回答
    其实我用了别人写的一个解压缩dll,代码如下
    Sub VBUnzip(fname As String, extdir As String, _
        prom As Integer, ovr As Integer, _
        mess As Integer, dirs As Integer, numfiles As Long, numxfiles As Long)
        Dim xx As Long ' , s1 As String * 20, s2 As String * 256    ' Set options
        MYDCL.ExtractOnlyNewer = 0      ' 1=extract only newer
        MYDCL.SpaceToUnderscore = 0     ' 1=convert space to underscore
        MYDCL.PromptToOverwrite = prom  ' 1=prompt to overwrite required
        MYDCL.fQuiet = 0                ' 2=no messages 1=less 0=all
        MYDCL.ncflag = 0                ' 1=write to stdout
        MYDCL.ntflag = 0                ' 1=test zip
        MYDCL.nvflag = mess             ' 0=extract 1=list contents
        MYDCL.nUflag = 0                ' 1=extract only newer
        MYDCL.nzflag = 0                ' 1=display zip file comment
        MYDCL.ndflag = dirs             ' 1=honour directories
        MYDCL.noflag = ovr              ' 1=overwrite files
        MYDCL.naflag = 0                ' 1=convert CR to CRLF
        MYDCL.nZIflag = 0               ' 1=Zip Info Verbose
        MYDCL.C_flag = 0                ' 1=Case insensitivity, 0=Case Sensitivity
        MYDCL.fPrivilege = 0            ' 1=ACL 2=priv
        MYDCL.Zip = fname               ' ZIP name
        MYDCL.ExtractDir = extdir       ' Extraction directory, NULL if extracting
                                        ' to current directory
        ' Set Callback addresses
        ' Do not change
        MYUSER.DllPrnt = FnPtr(AddressOf DllPrnt)
        MYUSER.DLLSND = 0& ' not supported
        MYUSER.DLLREPLACE = FnPtr(AddressOf DllRep)
        MYUSER.DLLPASSWORD = FnPtr(AddressOf DllPass)
        MYUSER.DLLMESSAGE = FnPtr(AddressOf ReceiveDllMessage)
        MYUSER.DLLSERVICE = 0& ' not coded yet :)
        
        ' Set Version space
        ' Do not change
        With MYVER
            .structlen = Len(MYVER)
            .beta = Space$(9) & vbNullChar
            .date = Space$(19) & vbNullChar
            .zlib = Space$(9) & vbNullChar
        End With
        
        ' Get version
        Call UzpVersion2(MYVER)     xx = windll_unzip(numfiles, vbzipnam, _
         numxfiles, vbxnames, MYDCL, MYUSER)
            
        If xx <> 0 Then MsgBox xx
        
    End Sub当代码执行到xx = windll_unzip(numfiles, vbzipnam, _
         numxfiles, vbxnames, MYDCL, MYUSER)
    它会反复执行下下面的一个函数:
    Function DllPrnt(ByRef fname As CBChar, ByVal x As Long) As Long
        Dim s0$, xx As Long    ' always put this in callback routines!
      '  On Error Resume Next
        s0 = ""
        For xx = 0 To x
            If fname.ch(xx) = 0 Then xx = 99999 Else s0 = s0 + Chr(fname.ch(xx))
        Next xx
      '  c = vbzipinf
        vbzipinf = vbzipinf + s0
      DllPrnt = 0
    End Function我怎么都无法跳出这个函数,但我只要执行一次(解压特定文件,不需要全部解压)
    我想跳出此函数,但不知如何是好
      

  3.   

    Function DllPrnt(ByRef fname As CBChar, ByVal x As Long) As Long
        Dim s0$, xx As Long    ' always put this in callback routines!
    按这个函数的说明,它是一个回调函数。每一次处理时都要被调用。你查一下代码,看看它被挂在什么地方了。