i'm using divils article to teach me how to do plug ins....
I've gotten stuck... This is my main file where i'd like to use the plug... the rest of the files mimic divil's *note i removed his form and included that in the 'main' file. i hope this code is enough
public class jrnMain
{
public static void Main()
{
jrn.IjrnHost objHost = new jrn.Host();
int index;
//get a list of plugins
jrn.PlugServices.availablePlug[] plugins = jrn.PlugServices.findPlug(Path.GetDirectoryName(Application.ExecutablePath), "jrn.IjrnPlug");
//loop through available plugins, creating instances and adding them to listbox
for(index = 0; index <= plugins.Length - 1;index++)
{
jrn.IjrnPlug objPlug;
objPlug = (jrn.IjrnPlug)PlugServices.CreateInstance(plugins[index]);
objPlug.Initialize(objHost);
Console.WriteLine(((jrn.IjrnPlug)objPlug).Name());
}//for
}
}//class
I get the following error "object reference not set to an instance of an object" on the line Console.WriteLine( .....Name);
I understand what that error means but i don't get how i'm supposed to create an instance. In Divil's vb version he does a DirectCast. Which ithought my line of code was the = of. I'm just confused.
I had all this working at one point now it's seems shot.
Any ideas?
thanks
brandon