Re: Getting an mdTypeDef for the type of a field
Serge Lidin <[email protected]> Tue, 10 May 2005 13:54:21 -0700
| Newsgroups | gmane.comp.windows.devel.dotnet.rotor |
|---|---|
| Message-ID | <81AC085044D04B429F5FB883D94FA1AF01D6A2EE@df-fido-msg.exchange.corp.microsoft.com> |
You need to get the field's signature and decode this signature. In the
simplest case (public Bar Field) the signature will be:
{CALLCONV_FIELD,E_T_CLASS,<compressed token of Bar>} Or
{CALLCONV_FIELD,E_T_VALUETYPE,<compressed token of Bar>}
For calling convention and element type encoding, see CorHdr.h
For token compression/decompression functions see Cor.h
Thanks,
Serge
-----Original Message-----
From: Discussion of the Rotor Shared Source CLI implementation
[mailto:[email protected]] On Behalf Of Arild Fines
Sent: Tuesday, May 10, 2005 12:43 PM
To: [email protected]
Subject: Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field
Discussion of the Rotor Shared Source CLI implementation wrote:
> IMDInternalImport::GetParentToken() is what you need.
No, that seems to give me the mdTypeDef corresponding to the enclosing
type. I.E:
public class Foo
{
public Bar Field;
}
If I have a mdFieldDef for Field here, calling GetParentToken gives me
the mdTypeDef for Foo, not Bar.
Any other ideas?
>
> -----Original Message-----
> From: Discussion of the Rotor Shared Source CLI implementation
> [mailto:[email protected]] On Behalf Of Arild Fines
> Sent: Tuesday, May 10, 2005 10:53 AM
> To: [email protected]
> Subject: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field
>
> Given an mdFieldDef, is there a way to get an mdTypeDef for the type
> of
> the field the mdFieldDef represents? IMetaDataImport defines a
> GetFieldProps method, which seems to be able to do what I want, but
> internally in the EE you only seem to have access to the
> IMDInternalImport interface, which seems vaguely different.
>
> IMDInternalImport defines the method GetSigOfFieldDef(), which
> returns a
> PCOR_SIGNATURE, but I don't seem to be able to find a way to get a
> metadata token from that either.
--
Arild
AnkhSVN: http://ankhsvn.tigris.org
Blog: http://ankhsvn.com/blog
IRC: irc://irc.freenode.net/ankhsvn
"The problem in the world today is communication. Too much
communication." -- Homer Simpson
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com