Re: Feedback on recursive file search...

From: Mark Alexander Bertenshaw (mark.bertenshaw_at_virgin.net)
Date: 11/18/04


Date: Thu, 18 Nov 2004 00:48:00 -0000

Schmidt wrote:
> "Mark Alexander Bertenshaw" <mark.bertenshaw@virgin.net> schrieb im
> Newsbeitrag news:%23hjbwnCzEHA.2656@TK2MSFTNGP14.phx.gbl...
>
>>> FindFirst/FindNext is a very good example:
>>> Regarding "light of new knowledge" - everybody who knows about the
>>> implicit Unicode-ANSI-Conversion VB does for String-Params (even in
>>> TypeDefs) sitting inside API-Declares, can speed up the classic
>>> File-Loop by factor 2-3, changing the Strings inside WIN32_FIND_DATA
>>> to ByteArrays.
>
>> Why do that when you can call the Unicode version of the API calls?
>> (I assume that you aren't writing for Win95/98/Me anymore :-) ).
> Because VB converts String-Params in API-Calls *always* to ANSI,
> regardless if the Function is the 'A' or the 'W'-Version - if the
> Params are Byref or Byval.
>
> If you can speed up the Unicode-Function 'FastFindW' in my posted
> example without using ByteArrays - I would like to see how.

What? You're still using Declares? That's what type libraries are for,
because Unicode declarations of parameters are never converted. Google for
WinU.tlb for a good start.

--
Mark Bertenshaw
Kingston upon Thames
UK


Relevant Pages

  • Re: Feedback on recursive file search...
    ... >> Why do that when you can call the Unicode version of the API calls? ... > Params are Byref or Byval. ... because Unicode declarations of parameters are never converted. ...
    (microsoft.public.vb.general.discussion)
  • Re: xmlrpclib and decoding entity references
    ... I haven't used XMLRPC but superficially this looks like a quoting and/or encoding ... unicode to preserve all the represented characters. ... above is a result of converting from unicode to an encoding that can't represent ...
    (comp.lang.python)
  • Re: api call for tchar*
    ... >Declare statement as opposed to a ByVal String argument. ... >String passes an ANSI version while a ByRef passes a Unicode version. ... I have just dug out an old Delphi DLL and tested it again ...
    (microsoft.public.vb.winapi)
  • Re: api call for tchar*
    ... >String passes an ANSI version while a ByRef passes a Unicode version. ...
    (microsoft.public.vb.winapi)
  • Re: Unicode HTML to ASCII conversion -- help!
    ... Removing byRef didn't change anything BTW. ... I found another solution for UNICODE to ASCII conversion. ... ren *.html *.htm ...
    (microsoft.public.scripting.vbscript)

Loading