在交流#装配我有一个全球性的棱镜CompositeCommand订阅这样的:使用订阅C#CompositeCommand从C++
private static readonly CompositeCommand __myCommand = new CompositeCommand();
public static CompositeCommand MyCommand
{
get { return _myCommand; }
}
从C#我可以订阅这个命令:
[...].MyCommand.RegisterCommand(new DelegateCommand<MyClass>((c) => c.Something()));
我的问题:我需要订阅来自托管C++的命令,并且我不知道如何在DelegateCommand中使用函数签名。大多数情况下,我收到如下错误:
error C2664:'Microsoft :: Practices :: Prism :: Commands :: DelegateCommand :: DelegateCommand(System :: Action ^)':参数1从'void( 'System :: Action ^'中的__clrcall *)(MyNameSpace :: MyClass ^)'不可能。
如何订阅c#命令?或者还有其他的方式来听一个事件(我可以用不同的东西替换CompositeCommand)。
谢谢!
你们是不是在管理/ CLI C++或本地C处理命令++? – 2010-12-21 16:14:48
哦,对不起,管理C++。没有cli,我甚至不会想这样做;) – Sam 2010-12-22 09:22:17