Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PB 8 to PB 10 COPYFILEA ISSUES

121 views
Skip to first unread message

michael...@maine.gov

unread,
Sep 13, 2006, 10:05:03 AM9/13/06
to
Good Morning,

We are currently migrating from PB 8.0.3 to 10.0.2 and are having
issues with COPYFILEA always returning FALSE, and subsequently failing.
A previous posting talked about adding ANSI to our alias, however our
application's local external function has no alias:

Function boolean CopyFileA(ref string cfrom, ref string cto, boolean
flag) LIBRARY "Kernel32.dll"

The code we are trying to execute is:

IF i_l_read_write_status <> 1 or isnull(i_l_read_write_status) then
l_b_copy_file_flag = FALSE
l_s_copy_file_from = "c:\pb5\temp\" + i_s_ftp_filename
l_s_copy_file_to = "c:\pb5\temp\l_s_file2.doc"
l_b_copy_file_rtn = CopyFileA(l_s_copy_file_from, l_s_copy_file_to,
l_b_copy_file_flag)
IF l_b_copy_file_rtn = False THEN
mle_ole_text.text = mle_ole_text.text + "Failed to copy to temp
file. !~r~n"
This.TriggerEvent("ue_save_event_txt")
Messagebox("w_m_ole_report","Failed to copy to temp file - Notify
HelpDesk!", StopSign!, OK!, 1)
END IF
END IF

Does anyone our there have an example of what the alias should look
like?

Thanks,

Mike

Brad Wery [TeamSybase]

unread,
Sep 13, 2006, 11:53:22 AM9/13/06
to
Adding the alias would make the declaration look like this:

Function boolean CopyFileA(ref string cfrom, ref string cto, boolean

flag) LIBRARY "Kernel32.dll" ALIAS FOR "CopyFileA;ANSI"

Alternatively you could just declare the UNICODE version of the API
function:

Function boolean CopyFileA(ref string cfrom, ref string cto, boolean

flag) LIBRARY "Kernel32.dll" ALIAS FOR "CopyFileW"

OR

Function boolean CopyFileW(ref string cfrom, ref string cto, boolean
flag) LIBRARY "Kernel32.dll"


Better yet, you could just use the built in FileCopy powerscript function.

Brad

0 new messages