Name

StringToWideChar Function

Syntax

function StringToWideChar(const Str: string; Result: PWideChar;
                          Size: Integer): PWideChar;

Description

The StringToWideChar function converts Str to a wide string. It copies at most Size-1 characters from Str to Result, appending #0 to the result string. It returns a pointer to Result.

StringToWideChar is a real function.

Example

procedure Demo;
var
  OleStr: PWideChar;
begin
  GetMem(OleStr, (Length(S)+1) * SizeOf(WideChar));
  try
    StringToWideChar(S, OleStr, Length(S)+1);
    SomeOLEProcedure(OleStr);
  finally
    FreeMem(OleStr);
  end;
end;

See Also

OleStrToString Function, OleStrToStrVar Procedure, PWideChar Type, String Keyword, WideChar Type, WideCharLenToString Function, WideCharLenToStrVar Procedure, WideCharToString Function, WideCharToStrVar Procedure, WideString Type
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset