Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[15174] Re:델파이7으로 만든 dll을 vb6에서 호출시 에러가 발생합니다.
김도완 [purplecofe2] 2557 읽음    2014-05-24 09:43
이 글을 참고하셔요.
http://www.devx.com/tips/Tip/37587


정필준 님이 쓰신 글 :
: 아래의 dll을 만든 후 vb6에서 호출하면 vb6가 멈춥니다.
: vb6에서 어떻게 호줄해야 하는지 고수분들의 조언을 부탁드릴게요.^^~~
: 답변 꼭 부탁드리곘습니다. 감사합니다.~~
: ======================================================================================================
: vb6 코드
: ======================================================================================================
: Private Declare Function DllPchar Lib "C:\TEST\Project2.dll" (ByVal AStr As String) As String
:
: Private Sub Command10_Click()
: Dim tmp as String
:
: tmp  = DllPchar("123");
:
: End Sub
: ======================================================================================================
: 델파이 코드
: ======================================================================================================
: library Project2;
:
: { 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. }
:
: uses
:   SysUtils,
:   Classes,
:   Windows;
:
: {$R *.res}
:
: function DllPchar( AStr: PChar) : PChar; stdcall;
: var
: S : string;
: begin
: S := AStr;
: S := 'DLL 함수 테스트 : ' + S + ' - stdcall';
: Result := PChar(S);
: end;
:
: exports
: DllPchar;
:
: begin
: end.
: ======================================================================================================
:

+ -

관련 글 리스트
15173 델파이7으로 만든 dll을 vb6에서 호출시 에러가 발생합니다. 정필준 2829 2014/05/23
15174     Re:델파이7으로 만든 dll을 vb6에서 호출시 에러가 발생합니다. 김도완 2557 2014/05/24
15175         Re:Re:델파이7으로 만든 dll을 vb6에서 호출시 에러가 발생합니다. 정필준 2527 2014/05/24
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.