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

my VB6 app does not work in a foreign country

10 views
Skip to first unread message

Peter

unread,
Jan 29, 2010, 5:57:01 AM1/29/10
to
Dear all
I have written a VB6 app that mainly copies or renames files of certain
folders and subfolders.
To rename the files I use
Name sFilename As sNewfilename
to copy the files I use the Win32API function

Public Declare Function CopyFileEx Lib "Kernel32.dll" Alias "CopyFileExA"
(ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal
lpProgressRoutine As Long, lpData As Any, ByRef pbCancel As Long, ByVal
dwCopyFlags As Long) As Long
and call it like:
ret = CopyFileEx(sFilenames, sNewfilename, AddressOf CopyProgressRoutine,
ByVal 0&, bCancel, ByVal 0&)

Now I heard from a customer from Israel that the app does not work if the
filename or the folder contains non-ascii characters like
�,�,�,�,�,o,�,�,u
Then I made some tests on my PC with files/folders containing these
characters but here it works without any problems.
I couldn't debug the problem in detail yet somewhere my app reports a Error
52: Bad file name or number
What can be the reason for this error, does it have something to do with
unicode support and VB6 strings?
How can I fix this?
Regards
Peter

Peter

unread,
Jan 29, 2010, 5:58:51 AM1/29/10
to
Forgot to mention: I am located in Europe/Austria

"Peter" <pet...@myrealbox.com> schrieb im Newsbeitrag
news:hjuett$hp0$1...@mail1.sbs.de...

Dee Earley

unread,
Jan 29, 2010, 6:38:21 AM1/29/10
to

Change the "Language for non unicode apps" setting to match the charset
used to create the file.
Alternatively, use the W version of CopyFileEx and pass the strings as
pointers using strptr().

I Think:


Public Declare Function CopyFileEx Lib "Kernel32.dll" Alias

"CopyFileExW" (ByVal lpExistingFileName As long, ByVal lpNewFileName
As Long, ByVal lpProgressRoutine As Long, lpData As Any, ByRef


pbCancel As Long, ByVal dwCopyFlags As Long) As Long


--
Dee Earley (dee.e...@icode.co.uk)
i-Catcher Development Team

iCode Systems

Peter

unread,
Feb 1, 2010, 9:45:14 AM2/1/10
to
Thanks for your answer.
Inbetween I got the information from my customer that CopyFileExA seems to
work correct with non-ascii characters while the problem seems to come from
"Name As"
So as a next step I want to replace Name As with MoveFileExA
Regards
Peter

"Dee Earley" <dee.e...@icode.co.uk> schrieb im Newsbeitrag
news:uLyb3eNo...@TK2MSFTNGP06.phx.gbl...

0 new messages