Re: Microsoft Layer for Unicode on Windows 95/98/Me systems



"Howard Kaikow" <kaikow@xxxxxxxxxxxxx> wrote in message
news:u3FNKmCVFHA.2540@xxxxxxxxxxxxxxxxxxxxxxx
> "mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
> news:D4vfe.9555$7F4.9011@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> > > If you have Matthew Curland's Advanced Visual
>> > > Basic 6 book, see the "Unicode conversions"
>> > > section starting on page 360. VB *is* unicode.
>> > > It's just converting to ANSI on either end, for
>> > > convenience. But StrPtr(string) is pointing to
>> > > a unicode string.
>> >
>> > I do not have Curland's book.
>> >
>>
>> He explains there that VB is Unicode "inside" but
>> that it was decided to make it ANSI on the surface
>> for convenience. As a result, VB normally calls
>> "A" versions of APIs and is actually converting
>> your given string to unicode, for it's own purposes,
>> then back to ANSI again for the API call. So if you
>> need to make a W call you can use StrPtr because
>> StrPtr is pointing to the beginning of the actual
>> unicode string that VB is using. In other words,
>> your variable, for instance, s2, returns an ANSI
>> string when you read it, but VB is storing it as unicode.
>> So StrPtr(s2), which is a pointer to the actual string
>> data, is pointing to a unicode string.
>
> Thanx, I knew that.
>
> What I don't know is whether there are issues with "A" API calls when the
> code is run in Win 95/Win 98/Win Me.
> GetProcAddress may be a non-issue, could be a documentation error in the
> Oct
> 2001 MSDN Library, or not.
>
> I've not worried about this before. But now I have written a VB 6 program
> that creates a Word template from scratch (sets reference, sets password,
> creates toolbar/menu and inserts code), and installs the referenced DLL.
> Works with Word 97 and up, tho I may drop Word 97 if I decide to include
> code in the DLL that will not run in Word 97.

I think the "INFO: Updated VB4dll.txt for Visual Basic 4.0" KB article
(Article ID:196976) has a lot of relevant information. Perhaps the material
is also in the VB 6 documentation somewhere, but I won't bother to hunt it
down now.

http://support.microsoft.com/default.aspx?scid=kb;en-us;196976


.



Relevant Pages

  • Re: Calling a DLL with LPSTR parameters
    ... Why you do not want to modify native part that it would receive UNICODE string? ... I'm trying to invoke a function in a DLL, ... How can I send a string in ANSI to the DLL? ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: LPCSTR from String
    ... > to both ANSI and UNICODE string. ... LPCSTR only handles ANSI strings ... > one explane on these context ... Starting with NT it uses unicode as fundamental string encoding! ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Change the font
    ... I don't pass unicode string in function of dll. ... I pass ANSI string. ...
    (microsoft.public.vc.mfc.docview)
  • Re: String object to unmanged char *?
    ... Don't use StringToHGlobalAuto but StringToHGlobalAnsi: ... is a Unicode string and char* is a ASCII (Ansi) string. ... StringToHGlobalAnsi allows to convert a string from Unicode to ASCII. ...
    (microsoft.public.dotnet.general)
  • Re: Did Borland doing well in Q4? Listen to the Earning CC
    ... AS an ANSI application you will need to change all "String" ... declarations to "ANSIString" (and Char to ANSIChar and PChar to ... Only THEN can you start thinking about how Unicode is best ... Even the specifically "ANSI" FS routines do not use ...
    (borland.public.delphi.non-technical)