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

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-02-08
  • 2022-12-23
  • 2021-12-22
  • 2021-11-17
猜你喜欢
  • 2022-01-14
  • 2022-01-26
  • 2022-02-24
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-11-07
相关资源
相似解决方案