肯肯

DNN, DotNetNuke, CS, CCS, ANF, Oracle, GIS, RIA, JS, XML, AJAX

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

参考: 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);

}

posted on 2018-01-07 09:48  verygis  阅读(983)  评论(0编辑  收藏  举报