티스토리 뷰
#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
- DotNetMagic
- c#
- 스크린캡쳐
- windows
- iTextSharp
- java
- Phalanger
- download.com
- jre
- AdSense숨기기
- Regular Expressions
- 애드센스숨기기
- WinAutomation
- AxWebBrowser
- autohotkey
- Rollback Rx
- ScreenHunter
- Service pack
- registry
- .net framework
- 애드센스감추기
- Microsoft
- READYSTATE_COMPLETE
- Sample Code
- iText
- 유틸리티
- tagREADYSTATE
- AdSense감추기
- Automation
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함