첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

■ Marshal 클래스의 AllocHGlobal 정적 메소드를 사용해 비관리 메모리를 할당하는 방법을 보여준다.

 

▶ 예제 코드 (C#)

using System.Runtime.InteropServices;
using System.Text;

byte[] sourceByteArray = Encoding.UTF8.GetBytes("안녕하세요");

IntPtr targetHandle = Marshal.AllocHGlobal(sourceByteArray.Length); // 메모리만 할당받는다.
728x90
그리드형(광고전용)
Posted by icodebroker
,