## Marshal::StringToHGlobalAuto method


将指定字符串的内容复制到非托管内存，如有需要则转换为 ANSI 格式。

```cpp
static IntPtr System::Runtime::InteropServices::Marshal::StringToHGlobalAuto(const String &s)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| s | const String\& | 要复制的字符串。 |

### ReturnValue

非托管内存中的地址。

## 另见

* Class [String](../../../system/string/)
* Class [Marshal](../)
* Namespace [System::Runtime::InteropServices](../../)
* Library [Aspose.Page for C++](../../../)
