There are many possible ways to instantiate plugins, but it is highly recommended that you use the k3d::plugin::create() convenience functions provided in k3dsdk/plugins.h. This will eliminate repetitive code and subtle errors. Overloaded and templated versions of k3d::plugin::create() are provided to handle the creation of application and document plugins and automatically query new plugins for particular interfaces (a very common use-case).