惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
博客园_首页
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
雷峰网
雷峰网
O
OpenAI News
SecWiki News
SecWiki News
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
N
News | PayPal Newsroom
Project Zero
Project Zero
Forbes - Security
Forbes - Security
IT之家
IT之家
A
Arctic Wolf
WordPress大学
WordPress大学
Jina AI
Jina AI
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
Cloudbric
Cloudbric
G
GRAHAM CLULEY
博客园 - 叶小钗
H
Hacker News: Front Page
腾讯CDC
量子位
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes

博客园 - verygis

DWF Toolkit on Microsoft Windows Visual studio 2017 c++ wcout 无法输出中文 Javascript 技巧集(1) win10 下 gulp-sass 无法使用的解决 VS2010 下 将 EntityFramework 的版本从 4.0 升级到 5.0 [原]CentOS 6.5 上安装 MySQL 5.6 Filezilla 适用于 Win2003 和 WinXP 的版本 Bower 自定义组件文件夹名称 [原]JQuery mobile CSS 文件组织 [转]Django与遗留系统和数据库集成 [转]mysql在windows下支持表名大小写,lower_case_table_names [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only [转]理解android.intent.category.LAUNCHER 具体作用 [转]如何判断某版本的.NET Framework是否安装 [转]Convert Windows TCHAR argv list to classical char * argv Google V8 源码下载及构建环境 关于网络字节序(network byte order)和主机字节序(host byte order) 宏 UNUSED_PARAM 的作用 [转]在C#中使用IDL文件,IDL是个接口定义文件
C++/CLI 本地字符串和托管字符串之间的转换
verygis · 2018-01-07 · via 博客园 - verygis

参考: https://docs.microsoft.com/zh-cn/cpp/dotnet/overview-of-marshaling-in-cpp

#include "msclr/marshal.h"
#include "msclr/marshal_windows.h"
#include "msclr/marshal_cppstd.h"
#include "msclr/marshal_atl.h"

int main(cli::array<System::String ^> ^args)
{

    marshal_context^ context = gcnew marshal_context();

    DWFString s(context->marshal_as<const wchar_t *>(args[0]));

    System::String ^s2 = marshal_as<System::String^>((const wchar_t *)s);

}