5/13/2011

This section provides information about the GUIDs that are used with the sample device imaging component.

The following line in SamplePlugin.cs defines a GUID that uniquely identifies the sample device imaging component.

Copy Code
	[Guid("AAC3FA7D-AD4E-4F39-8BFC-1CA088886215")]
Important:
If you are creating your own device imaging component, you mustchange this GUID to a unique ID.

This GUID is also referenced by the Regand Unregmethods that are used to register and unregister the device imaging component. The following code shows how the Regmethod uses the GUID.

Copy Code
[ComRegisterFunction()]
public static void Reg(string regKey)
{
	RegistryKey categoryKey =
Registry.ClassesRoot.CreateSubKey(@"CLSID\{AAC3FA7D-AD4E-4F39-8BFC-1CA088886215}\Implemented
Categories\{BB86C90C-F77E-48DD-87BF-2A6633339C05}");
	categoryKey.Close();
}

In the previous code example, {AAC3FA7D-AD4E-4F39-8BFC-1CA088886215}is the device imaging component GUID mentioned previously, whereas {BB86C90C-F77E-48DD-87BF-2A6633339C05}is the COM category GUID and should not be changed.

For a device imaging component to be registered and available for the Device Imaging service, you must register the component GUID ({AAC3FA7D-AD4E-4F39-8BFC-1CA088886215}) for the Device Imaging Service COM Category {BB86C90C-F77E-48DD-87BF-2A6633339C05}. For more information about how to register COM Categories, see Categorizing by Component Capabilities on MSDN.

In addition, you must make your device imaging component visible to COM by changing the ComVisibleattribute to Truein AssemblyInfo.cs. The following code example demonstrates how to make your device imaging component visible to COM.

Copy Code
[assembly: ComVisible(true)]

See Also