다음을 통해 공유


CoClassAttribute 클래스

형식 라이브러리에서 가져온 coclass의 클래스 식별자를 지정합니다.

네임스페이스: System.Runtime.InteropServices
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Interface, Inherited:=False)> _
Public NotInheritable Class CoClassAttribute
    Inherits Attribute
‘사용 방법
Dim instance As CoClassAttribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false)] 
public sealed class CoClassAttribute : Attribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets::Interface, Inherited=false)] 
public ref class CoClassAttribute sealed : public Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false) */ 
public final class CoClassAttribute extends Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false) 
public final class CoClassAttribute extends Attribute

설명

일반적으로 형식 라이브러리 가져오기(Tlbimp.exe)가 형식 라이브러리를 가져올 때 자동으로 이 특성을 적용하지만 직접 coclass 인터페이스에 이 특성을 적용할 수 있습니다.

Tlbimp.exe는 coclass를 가져올 때 coclass를 나타내기 위한 관리되는 클래스와 인터페이스를 생성합니다. coclass 인터페이스의 인터페이스 식별자(IID)는 원본 coclass의 기본 인터페이스와 동일합니다. 또한 가져온 coclass 인터페이스의 이름은 coclass의 이름을 그대로 사용합니다. Tlbimp.exe는 원본 coclass 이름의 끝에 "class"를 추가하여 가져온 클래스를 식별합니다.

이 특성은 거의 적용하지 않습니다. 그러나 Tlbimp.exe가 생성한 메타데이터와 비슷한 메타데이터를 만드는 소스 코드를 작성하려는 경우에는 각 coclass에 대한 coclass 인터페이스를 만들어야 합니다. 원본 coclass의 이름을 사용해 coclass 인터페이스의 이름을 지정하고 기본 인터페이스에서 파생시키십시오. CoClassAttribute 외에도 System.Runtime.InteropServices.ComImportAttributeSystem.Runtime.InteropServices.GuidAttribute를 coclass 인터페이스에 적용해야 합니다. Tlbimp.exe가 형식 라이브러리에서 인터페이스와 coclass를 가져오는 방법에 대한 자세한 내용은 가져온 형식 변환을 참조하십시오.

상속 계층 구조

System.Object
   System.Attribute
    System.Runtime.InteropServices.CoClassAttribute

스레드로부터의 안전성

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0에서 지원

참고 항목

참조

CoClassAttribute 멤버
System.Runtime.InteropServices 네임스페이스
ComImportAttribute
GuidAttribute

기타 리소스

형식 라이브러리 가져오기(Tlbimp.exe)