• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
张纯睿
博客园    首页    新随笔    联系   管理    订阅  订阅

Convert Standard String to System::String

How to: Convert Standard String to System::String 
      string str = "test";
   cout << str << endl;
   String^ str2 = gcnew String(str.c_str());


How to: Convert System::String to wchar_t* or char*
  String ^str = "Hello";

   // Pin memory so GC can't move it while native function is called
   pin_ptr<const wchar_t> wch = PtrToStringChars(str);


第22章 Windows Forms应用程序进阶
第23章 在Windows Forms 应用程序中访问数据源

将程序从托管扩展 C++ 迁移到 C++/CLI[1]
http://develop.csai.cn/c/200702071003441921.htm

posted @ 2011-08-25 18:02  张纯睿  阅读(121)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3