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

C++빌더 Q&A
C++Builder Programming Q&A
[60238] DLL 에 정의한 클래스 사용 방법...
이용태 [kidary97] 1221 읽음    2010-02-12 13:23
다음과 같은 클래스를 DLL로 만들었습니다.

typedef class TESTCLASS
{
    private :
        int a;
        int b;

    public :
        TMyClass();
        int getA();
        int getB();
        void setA(int s_A);
        void setB(int s_B);
}TMyClass;

TMyClass::TMyClass()
{
      a = 10;
      b = 20;
}

int TMyClass::getA()
{
    return a;
}

int TMyClass::getB()
{
    return b;
}

void TMyClass::setA(int s_A)
{
    a = s_A;
}

void TMyClass::setB(int s_B)
{
    b = s_B;
}

이렇게 만들어진 DLL를 빌더6.0 APP프로젝트 하나 만들어서 추가해서 사용할려고 하는데요..

lib, dll파일 복사하고, lib 파일은 addto project해서 추가했습니다.

그런 다음에 폼에서 불러서 써볼려고 하는데요..

컴파일 하면.. 다음과 같은 에러가 뜹니다..;;
[C++ Error] Unit1.cpp(13): E2141 Declaration syntax error
[C++ Error] Unit1.cpp(18): E2451 Undefined symbol 'myClass'
[C++ Error] Unit1.cpp(18): E2303 Type name expected
[C++ Error] Unit1.cpp(18): E2379 Statement missing ;
[C++ Error] Unit1.cpp(25): E2451 Undefined symbol 'myClass'
[C++ Error] Unit1.cpp(25): E2121 Function call missing )


#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

TMyClass *myClass;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    myClass = new TMyClass;
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Button1Click(TObject *Sender)
{
    ShowMessage(IntToStr(myClass->getB());
}
//---------------------------------------------------------------------------

DLL에 정의된 클래스를 폼에서 그냥 선언해서 쓸 수는 없는거 같은데요..

어떻게 해야 할지 모르겠습니다..;;;

답변 부탁드려요..^^

+ -

관련 글 리스트
60238 DLL 에 정의한 클래스 사용 방법... 이용태 1221 2010/02/12
60250     Re:DLL 에 정의한 클래스 사용 방법... df 1609 2010/02/13
60240     Re:DLL 에 정의한 클래스 사용 방법... 장성호 1348 2010/02/12
60241         Re:Re:DLL 에 정의한 클래스 사용 방법... 이용태 1907 2010/02/12
60249             Re:Re:Re:DLL 에 정의한 클래스 사용 방법... df 1745 2010/02/13
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.