Community
Showing results for 
Search instead for 
Do you mean 
Reply

Sample CustomMenuPlugin - IPlugin not found? Newbie question w/ screenshot

New Member
Posts: 2
Country: USA

Sample CustomMenuPlugin - IPlugin not found? Newbie question w/ screenshot

I think I'm doing this right???

 

Using

- Act 2011

- VS 10 (csharp)

- I started a "class" project

- Copied the dlls from GlobalAssemblyCache locally and referenced relevant dlls in project

- build produces 4 errors

 

Any ideas?

4 errors are looking for:

IPlugin, ActApplication & CommandHandler

 

Thanks, Bryan

 

screenshot.jpg

 

Employee
Posts: 1,163
Country: USA

Re: Sample CustomMenuPlugin - IPlugin not found? Newbie question w/ screenshot

You're missing a reference for Act.UI.dll, you have a using statement for it but no reference.

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 2
Country: USA

Re: Sample CustomMenuPlugin - IPlugin not found? Newbie question w/ screenshot

That worked.  Just an FYI that the help docs read:

 

  1. Create a Visual Studio project using the open CS file, referencing:
  • Act.Framework.dll
  • Act.UI.Core.dll

I'm in KISS mode when doing first examples - so thanks for the help!

 

One more question, if I may...

 

It did generate a DLL without errors, which I copied over to the plugin directory.  Somehow I don't think it's working correcly though because I can't see the menu item.  I even added the following MsgBox but nothing seems to happen.  Do you know where the menu item is supposed to show up?  Any ideas?  Thanks again..  

 

private void Application_AfterLogon(object sender, EventArgs e)
{
MessageBox.Show("test");

...............

Employee
Posts: 1,163
Country: USA

Re: Sample CustomMenuPlugin - IPlugin not found? Newbie question w/ screenshot

Go to your preferences folder (%appdata%\Roaming\ACT\ACT Data) and look for DependentDlls.xml, this file lists assembly that Act won't attempt to load on startup, if your plugin appears there, that means for some reason it failed to load it. You can delete the line item and try to load it again.

 

A menu item will show up at the URN specified, so in this example: 

 

//Within my AfterLogon event

AddMenuItem("act-ui://com.act/application/menu/tools/Test""Test", RunMe); 
private void AddMenuItem(string urn, string MenuTxt, Act.UI.CommandHandler handler)
        {
            try
            {
                if (MenuItemExists(urn) == true)
                {
                    RemoveMenuItem(urn);
                }
                Act.UI.Core.CommandBarControl ParentMenu = ActApp.Explorer.CommandBarCollection["Connected Menus"].ControlCollection[GetParentControlURN(urn)];
                Act.UI.Core.CommandBarButton NewMenu = new Act.UI.Core.CommandBarButton(MenuTxt, MenuTxt, null, urn, nullnull);
                NewMenu.DisplayStyle = Act.UI.Core.CommandBarControl.ItemDisplayStyle.TextOnly;
                ActApp.RegisterCommand(urn, new Act.UI.CommandHandler(handler), Act.UI.RegisterType.Shell);
                ParentMenu.AddSubItem(NewMenu);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }

 

The menu would be added to the Tools menu with the name Test.

Matthew Wood
Act! SDK Support
Community Moderator