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
[20868] Re:[# extern PACKAGE TSplashForm *SplashFrom; 에서 PACKAGE의 의미? #]
유영인.Chris [cuperido] 1105 읽음    2002-08-19 14:24
제 답변은 아니지만..


The extern means what it has always meant in c++, that the statment is
essentially a prototype, and not a definition. The statement extern
TForm* Form1 tells the compiler that there is a variable out there, and
that it is a TForm1 pointer, but the statment does not allocate any
storage for the variable. That is done in a cpp file. Look in the CPP
source file for Form1 and you will see something like this:

TForm1 *Form1;

This is where the variable is actually defined. The extern declaration
is simliar to how a class declaration works.

header file

extern TForm1* Form1;

class A
{
public:
    A();
};

cpp source file

TForm1* Form1;

A::A()
{
}

Harold Howe [TeamB]



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


In the file sysdefs.h, found in the Include\Vcl folder, PACKAGE is defined
as follows:

#define PACKAGE __declspec(package)

I quote the following from the "Using C++ Builder" help file:

__declspec(package)

The package argument indicates that the code defining the class can be
compiled in a package. This modifier is auto-generated by the compiler when
creating packages in the IDE.

<and:>

The PACKAGE macro expands to a statement that allows classes to be imported
and exported from the resulting BPL file.

If you use the New Component wizard to create components (by choosing
Comnponent|New Component), C++Builder inserts the PACKAGE macro where it is
needed. But if you have custom components from an older version of
C++Builder, you뭠l have to add PACKAGE manually in the two places just
mentioned. <end of quotation>

FF


윤종희 님이 쓰신 글 :
: PACKAGE를 help에서 찾아보니 __declspec(package) 인거 같더군요.
:
:
: __declspec(package)
:
: The package argument indicates that the code defining the class can be compiled in a package. This modifier is auto-generated by the compiler when creating packages in the IDE.
:
: 라고 나와 있던데...제대로 찾은거 맞나요? ^^;;
:
: 만약 맞다면, 내용 중에서 ' the code defining the class can be compiled in a package. ' 이 무슨 뜻인지 모르겠어요.
:
: 행복하세요.
:
: 24살 늦은 여름 [# 윤종희 #]
:
:

+ -

관련 글 리스트
20859 [# extern PACKAGE TSplashForm *SplashFrom; 에서 PACKAGE의 의미? #] 윤종희 1117 2002/08/18
20868     Re:[# extern PACKAGE TSplashForm *SplashFrom; 에서 PACKAGE의 의미? #] 유영인.Chris 1105 2002/08/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.