dll 함수로 데이터 보내는 일은 string으로 가능하지만
반대로 받는건 StringBuilder 를 이용해야 하네요.
[DllImport("test.dll")]
public static extern int sample(string in_param, StringBuilder out_param);
StringBuilder s = new StringBuilder(100); // 문자열 최대 크기를 잡아주세요.
if (sample("test", s) == 0)
MessageBox.Show(s.ToString());
발췌정보:
http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=17&MAEULNo=8&no=77076&ref=77076
'프로그래밍 > .Net' 카테고리의 다른 글
Queue 사용하기 (0) | 2014.01.17 |
---|---|
함수 파라미터 가져오기(ref, out, in) (0) | 2014.01.17 |
[본문스크랩] C++에서 C# DLL Interop (0) | 2014.01.17 |
DLL 함수 호출 시 발생하는 PInvokeStackImbalance Exception (0) | 2014.01.17 |
[본문스크랩] XSL 개요 (0) | 2014.01.17 |