如何通过PB显示Windows文件复制进度对话框?

发布于 2024-08-02 17:50:51 字数 202 浏览 4 评论 0原文

我使用了 CopyFilea 和 ShFileOperation 函数。 CopyFileA 它复制了文件(大而繁琐的数据)。但它没有显示复制进度,并且还在 SHFileOperation api 中尝试过,这显示了错误。

PB 版本是 10.2.0 build 7516

错误消息:调用外部函数 %s

任何主体时出错 请给我一个解决方案?

I used the functions CopyFilea and ShFileOperation. CopyFileA it copied the file(large cumbersome data). but it didn't show the Copy Progress and Also tried in SHFileOperation api this shows the error.

PB Version is 10.2.0 build 7516

Error Msg: Error Calling external function %s

any body Please give me a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青萝楚歌 2024-08-09 17:50:51

在 sybase.public.powerbuilder 上有 关于 SHFileOperation 的讨论.一般。此代码块显示了如何正确设置结构,对于本例中的删除操作 - 有帮助吗?

type os_shfileopstruct from structure
        unsignedlong            hwnd
        unsignedlong            wfunc
        blob            pfrom
        blob            pto
        unsignedinteger         fflags
        unsignedlong            banyoperationsaborted
        unsignedlong            hnamemappings
        string          lpszprogresstitle
end type

//inside a function call:
// Arguments:    as_SourceFile - the file(s) to delete.
//               aui_flags     - file operation flags (0 - default)
//               aw_requestor  - the requesting window

os_shfileopstruct       lstr_FileOp
Integer li_rc

lstr_FileOp.hWnd                  = Handle(aw_requestor)
lstr_FileOp.wFunc                 = FO_DELETE
lstr_FileOp.pFrom                 = Blob( as_SourceFile + Space(2) )
BlobEdit( lstr_FileOp.pFrom, Len( as_sourcefile ) + 1, Char(0) )
BlobEdit( lstr_FileOp.pFrom, Len( as_sourcefile ) + 2, Char(0) )
lstr_FileOp.fFlags                = aui_flags
lstr_FileOp.hNameMappings         = 0
lstr_FileOp.lpszProgressTitle     = Space(10)

li_rc = SHFileOperationA( lstr_FileOp )
IF li_rc <> 0 THEN
        IF NOT IsNull( lstr_FileOp ) THEN
                IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
                        RETURN 0
                END IF
        END IF
ELSE
        -1
END IF

RETURN 1 

来自 sybase.public.powerbuilder.general

There is a discussion of SHFileOperation on sybase.public.powerbuilder.general . This code block shows how to set up the structure correctly, for a delete operation in this case - does it help?

type os_shfileopstruct from structure
        unsignedlong            hwnd
        unsignedlong            wfunc
        blob            pfrom
        blob            pto
        unsignedinteger         fflags
        unsignedlong            banyoperationsaborted
        unsignedlong            hnamemappings
        string          lpszprogresstitle
end type

//inside a function call:
// Arguments:    as_SourceFile - the file(s) to delete.
//               aui_flags     - file operation flags (0 - default)
//               aw_requestor  - the requesting window

os_shfileopstruct       lstr_FileOp
Integer li_rc

lstr_FileOp.hWnd                  = Handle(aw_requestor)
lstr_FileOp.wFunc                 = FO_DELETE
lstr_FileOp.pFrom                 = Blob( as_SourceFile + Space(2) )
BlobEdit( lstr_FileOp.pFrom, Len( as_sourcefile ) + 1, Char(0) )
BlobEdit( lstr_FileOp.pFrom, Len( as_sourcefile ) + 2, Char(0) )
lstr_FileOp.fFlags                = aui_flags
lstr_FileOp.hNameMappings         = 0
lstr_FileOp.lpszProgressTitle     = Space(10)

li_rc = SHFileOperationA( lstr_FileOp )
IF li_rc <> 0 THEN
        IF NOT IsNull( lstr_FileOp ) THEN
                IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
                        RETURN 0
                END IF
        END IF
ELSE
        -1
END IF

RETURN 1 

from sybase.public.powerbuilder.general

初熏 2024-08-09 17:50:51

您的操作系统是什么? Windows Vista 中的 SHFileOperation 已被替换通过IFileOperation

What is your operating system? SHFileOperation has has been replaced in Windows Vista by IFileOperation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文