==> 쉽게 말하면 델파이에서 DLL 이 나온게 아니라 C 부터 DLL 이 있어와서 그걸 지원하다보니 Delphi가 그걸 따르는거지요.. 하지만.. DLL 을 그냥 생성해 보시면 프로젝트 파일에 이렇게 나온것을 확인할 수 있습니다.
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
쉽게 말씀드리면, 파라미터에 델파이의 String 또는 클래스를 넘기려면 DLL uses절 첫번째에 ShareMem 을 반드시!!!! 추가해야된다는거죠..
그러니까..String 파라미터도 지원됩니다..!! 다만 ShareMem이라는 델파이가 지원하는 메모리관련 유닛을 추가해줘야하지요...
단점이라 하면.. DLL 사이즈가 커집니다 >_<.. 그리고!! 다른 컴파일러에서 사용하실 수 없겠지요... -_-;; C++ Builder 에서는 되리라봅니다. ^^;; 하지만 기냥 C/C++ 또는 MS VC 기타. 프로젝트에서 사용하실 수는 없습니다.
호환되게 하시기 위해서는 순수 C 스타일의 방식으로 코딩하셔야겠지요.. Char*(PChar) 로요...
==> 쉽게 말하면 델파이에서 DLL 이 나온게 아니라 C 부터 DLL 이 있어와서 그걸 지원하다보니 Delphi가 그걸 따르는거지요.. 하지만.. DLL 을 그냥 생성해 보시면 프로젝트 파일에 이렇게 나온것을 확인할 수 있습니다.
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
쉽게 말씀드리면, 파라미터에 델파이의 String 또는 클래스를 넘기려면 DLL uses절 첫번째에 ShareMem 을 반드시!!!! 추가해야된다는거죠..
그러니까..String 파라미터도 지원됩니다..!! 다만 ShareMem이라는 델파이가 지원하는 메모리관련 유닛을 추가해줘야하지요...
단점이라 하면.. DLL 사이즈가 커집니다 >_<.. 그리고!! 다른 컴파일러에서 사용하실 수 없겠지요... -_-;; C++ Builder 에서는 되리라봅니다. ^^;; 하지만 기냥 C/C++ 또는 MS VC 기타. 프로젝트에서 사용하실 수는 없습니다.
호환되게 하시기 위해서는 순수 C 스타일의 방식으로 코딩하셔야겠지요.. Char*(PChar) 로요...
도움이 되셨길...
by KDDG 만수 ㅔ 이~~