Programming/Old

#[c++] Marshaling

kkennib 2016. 3. 10. 11:05
반응형

마샬링을 이용하면 

string를 char로,  

char를 string 으로 쉽게 변환할 수 있다.


마샬링을 사용하기 위해서는 다음과 같은 헤더파일과 namspace를 등록해줘야 하고, 

#include <msclr\marshal.h>

using namespace msclr::interop;


Project Properties-> Configuration Properties -> General -> Common Language Runtime Supprot 

를 'Common Language Runtime Supprot (clr)' 로 변경해줘야 한다.


또한 아래 사이트에 From type, To type이 적혀 있으니 참고하면 된다.

https://msdn.microsoft.com/en-us/library/bb384865.aspx


반응형