VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
2 Replies Last post: Sep 9, 2009 10:29 AM by LeeTheMC  

Client Plugin Error posted: Sep 7, 2009 8:03 AM

Click to view harkamal's profile Hot Shot 221 posts since
Mar 19, 2009

Refering to Client Plugin SDK and Sample, I built a simple homeview plugin, it is loaded, and events fire as intended. But it also throws a strange error --"Error" :bject reference not set to an instance of an object.". Can someone help why ?

public class Plugin2 : Plugin {

public VIApp _viApp;

public void Load(VIApp app) {

// Test Loading

if (app == null) { throw new Exception("Plugin.Load() viApp is null.\nPlugin load failed"); }

_viApp = app;

// Test Menu

Extension ext = _viApp.NewExtension();

ext.Name = "PowerCLI";

ext.Activated += new ExtensionEvent(ext_Activated);

ext.Image = Properties.Resources.PowerCLI1;

_viApp.AddExtension("HomeView.Applications", ext);

}

void ext_Activated(Extension sender) {

try {

System.Windows.Forms.MessageBox.Show("hi");

} catch { }

}

public void Unload() {

//_viApp = null;

}

}



Attachments:

Re: Client Plugin Error

2. Sep 9, 2009 10:29 AM in response to: harkamal
Click to view LeeTheMC's profile Novice 9 posts since
Sep 2, 2008

Without digging too deep into your code, my first recommendation would be to set ext.Content to some control. That might be the empty object pointer that the client is tripping on.

Lee

Developer Social Media

Communities