요약

1. export 된 함수 매개변수 또는 결과값으로 String 또는 String 을 포함하는 구조체/클래스 를 사용하는 경우

   DLL 과 DLL 을 사용하는 프로젝트에 MEMMGR.LIB 를 추가하라.

2. DLL 에서 export 된 TObject 에서 상속되지 않은 클래스를 new/delete 하는 경우 프로젝트에 MEMMGR.LIB 를 추가하라.

3. MEMMGR.LIB 를 추가하면 BORLNDMM.DLL 을 사용하게되므로 같이 배포해야 한다.

4. 이를 피하려면 "char*" 또는 ShortString 을 사용하라.

5. 동적 RTL 을 사용하는 경우에는 암시적으로 처리가 되므로 신경쓰지 않아도 된다.


원본


//   Important note about DLL memory management when your DLL uses the

//   static version of the RunTime Library:

//

//   If your DLL exports any functions that pass String objects (or structs/

//   classes containing nested Strings) as parameter or function results,

//   you will need to add the library MEMMGR.LIB to both the DLL project and

//   any other projects that use the DLL.  You will also need to use MEMMGR.LIB

//   if any other projects which use the DLL will be performing new or delete

//   operations on any non-TObject-derived classes which are exported from the

//   DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling

//   EXE's to use the BORLNDMM.DLL as their memory manager.  In these cases,

//   the file BORLNDMM.DLL should be deployed along with your DLL.

//

//   To avoid using BORLNDMM.DLL, pass string information using "char *" or

//   ShortString parameters.

//

//   If your DLL uses the dynamic version of the RTL, you do not need to

//   explicitly add MEMMGR.LIB as this will be done implicitly for you


해석


//   정적 Runtime library 를 사용하는 DLL 메모리 관리에 관한 중요 사항:

//

//   DLL 이 매개변수 또는 반환 값으로 String 객체 (또는 String 을 포함하는

//   구조체/클래스) 를 전달하는 경우, MEMMGR.LIB 를 DLL 프로젝트와 DLL 을

//   사용하는 다른 프로젝트에 추가하여야 한다. 또한 DLL 을 사용하는 프로젝트가

//   DLL 에서 export 된 TObject 에서 상속받지 않은 클래스를 new 또는 delete

//   하는 경우 MEMMGR.LIB 를 추가해야 한다. MEMMGR.LIB 를 프로젝트에 추가하면

//   DLL 과 그것을 호출하는 EXE 의 메모리 관리자를 BORLNDMM.DLL 로 변경됩니다.

//   이경우, BORLNDMM.DLL 은 당신의 DLL 과 함께 배포해야 합니다.

//

//   BORLNDMM.DLL 사용을 피하기위해, "char *" 또는 ShortString 매개 변수로

//   문자열 정보를 전달하시오.

//

//   동적 RTL 을 사용할 경우, MEMMGR.LIB 가 암시적으로 추가되므로 이를

//   명시할 필요가 없다.


'Windows > RAD Studio' 카테고리의 다른 글

[CB] Ole - InternetExplorer 띄우기  (0) 2015.09.17
프로세스 종료  (0) 2015.09.08
[Del] TListBox HorizontalScrollBar 표시  (0) 2015.05.06
[Win32] 메모리 사용량 확인  (0) 2015.05.06
[C++, Win32] Thread safe FreeAndNil  (0) 2015.04.28

+ Recent posts