Microsoft MVP성태의 닷넷 이야기
글쓴 사람
한승훈 (masa4u at gmail.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

dll import하기 위해 struct 구성시에 struct가 struct를 가지고 있고 포함된 struct가 ByValArray형태일때 해결 방법을 알고 싶습니다.

unsafe public struct fng_curve
{
    public int size;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
    public double[] tenor;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
    public double[] forwardfx;
};
unsafe public struct fng_curve_list
{
    public int size;
    public fng_curve* data;
};

error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('fng_curve')


fng_curve의 size를 제대로 읽어 올수 없어 생기는 오류 같습니다.
혹시 아시면 답변 부탁드려요..

수고하세요.


[연관 글]






[최초 등록일: ]
[최종 수정일: 6/4/2009]


비밀번호

댓글 작성자
 



2009-06-06 01시09분
답변이 좀 늦었습니다. 이미 해결하셨을지 모르지만.
아래에 정리를 해놓았으니 참고가 되길 바랍니다.

Win32 Interop - 크기가 정해지지 않은 배열을 C++에서 C#으로 전달하는 경우
; http://www.sysnet.pe.kr/2/0/737
kevin25

NoWriterDateCnt.TitleFile(s)