Summary
For ActiveX controls, import with command-line
amimp.exe
(in the AxHost "wrapper" class),
or use Customize Toolbox
to add directly to the IDE toolbox.
For COM and COM+ components,
provide a Runtime Callable Wrapper (RCW) either with the command-line
tlbimp.exe tool, or with a
direct reference added through the Solution Explorer.
For unmanaged libraries, such as Windows APIs, use Platform Invoke
("PInvoke"), which uses attributes placed before declarations
of external methods, e.g.,
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
public static extern int GetComputerName(
StringBuilder buffer, ref uint size);