Utils.AddCommand() function with params
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
public static void AddCommand(string cmdGroupName, string cmdGlobalName, string cmdLocalName, CommandFlags cmdFlags, CommandCallback func);
how can use a function with params as the fifth param of this "AddCommand"method?
here goes the codes
[CommandMethod("Testaddcmd")]
static public void Testaddcmd()
{
Autodesk.AutoCAD.Internal.CommandCallback cc = new Autodesk.AutoCAD.Internal.CommandCallback ShowMsg());
Autodesk.AutoCAD.Internal.Utils.AddCommand("test", "ttt", "ttt", CommandFlags.Modal, cc);
}
public static void ShowMsg()
{
MessageBox.Show("ok:);
}
==========>the error one
[CommandMethod("Testaddcmd")]
static public void Testaddcmd()
{
Autodesk.AutoCAD.Internal.CommandCallback cc = new Autodesk.AutoCAD.Internal.CommandCallback ShowMsg("s"));
Autodesk.AutoCAD.Internal.Utils.AddCommand("test", "ttt", "ttt", CommandFlags.Modal, cc);
}
public static void ShowMsg(string s)
{
MessageBox.Show(s);
}