Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetTypeLibGuid Method
Collapse the table of content
Expand the table of content

Marshal.GetTypeLibGuid Method

Retrieves the library identifier (LIBID) of a type library.

[Visual Basic]
Public Shared Function GetTypeLibGuid( _
   ByVal pTLB As UCOMITypeLib _
) As Guid
public static Guid GetTypeLibGuid(
public: static Guid GetTypeLibGuid(
public static function GetTypeLibGuid(
   pTLB : UCOMITypeLib
) : Guid;


A UCOMITypeLib that represents an ITypeLib pointer.

Return Value

The LIBID (that is, the Guid) of the type library pointed to by the pTLB parameter.


GetTypeLibGuid extracts the LIBID directly from an existing type library. This action differs from that of the Marshal.GetTypeLibGuidForAssembly method, which calculates what the LIBID should be based on the current assembly. For additional information about ITypeLib, see the MSDN Library.

Note   This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.UnmanagedCode permission. If your code can be called from partially trusted code, do not pass user input to Marshal class methods without validation. For important limitations on using the LinkDemand member, see Demand vs. LinkDemand.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace | GetTypeLibGuidForAssembly | UCOMITypeLib

© 2015 Microsoft