티스토리 뷰
#include <stdio.h>
#include <msclr/marshal.h>
using namespace System;
using namespace msclr::interop;
int main(array<System::String ^> ^args)
{
{
// System::String^ to const char*
marshal_context^ context = gcnew marshal_context();
String^ message = gcnew String("System::String^ to const char*");
const char* result = context->marshal_as<const char*>(message);
puts(result);
delete context;
}
{
// const char* to System::String^
const char* message = "const char* to System::String^";
String^ result = marshal_as<String^>(message);
Console::WriteLine(result);
}
return 0;
}
#include <msclr/marshal.h>
using namespace System;
using namespace msclr::interop;
int main(array<System::String ^> ^args)
{
{
// System::String^ to const char*
marshal_context^ context = gcnew marshal_context();
String^ message = gcnew String("System::String^ to const char*");
const char* result = context->marshal_as<const char*>(message);
puts(result);
delete context;
}
{
// const char* to System::String^
const char* message = "const char* to System::String^";
String^ result = marshal_as<String^>(message);
Console::WriteLine(result);
}
return 0;
}
'Code > C C++' 카테고리의 다른 글
Display Number on Tray Icon (0) | 2010.06.20 |
---|---|
[C++] polymorphism.h (0) | 2010.05.17 |
[C++] How to: Convert Between Various String Types (0) | 2010.05.17 |
[C++] vector shared_ptr sample (0) | 2010.05.15 |
[MFC] Simplified MFC Structure (0) | 2010.04.24 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스크린캡쳐
- 애드센스감추기
- iText
- Phalanger
- ScreenHunter
- java
- autohotkey
- WinAutomation
- Rollback Rx
- Microsoft
- DotNetMagic
- AdSense숨기기
- iTextSharp
- tagREADYSTATE
- Regular Expressions
- jre
- windows
- AxWebBrowser
- download.com
- registry
- c#
- 애드센스숨기기
- READYSTATE_COMPLETE
- 유틸리티
- Automation
- Service pack
- .net framework
- AdSense감추기
- Sample Code
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함