Click to Rate and Give Feedback
MSDN
MSDN Library
COM
 SysAllocStringLen
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Component Automation
SysAllocStringLen

Allocates a new string, copies cch characters from the passed string into it, and then appends a null character.

Visual C++
BSTR SysAllocStringLen(
  const OLECHAR   *pch,
  unsigned int  cch
);
pch

A pointer to cch characters to be copied. If pch is NULL, a new string is allocated that contains only the null character.

cch

The number of characters to be copied from pch. A null character is placed afterwards, allocating a total of cchplus one characters.

Points to a copy of the string, or NULL if insufficient memory exists.

The pch string can contain embedded null characters and does not need to end with a NULL. Free the returned string later with SysFreeString. If pch is not NULL, then the memory allocated to pch must be at least cch characters long.

NoteNote:

This function does not convert a char * string into a Unicode BSTR.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker