Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

subscribing to c# CompositeCommand from c++ -


in c# assembly i've got global prism compositecommand subscribe this:

private static readonly compositecommand __mycommand = new compositecommand();  public static compositecommand mycommand {   { return _mycommand; } } 

from c# can subscribe command using:

[...].mycommand.registercommand(new delegatecommand<myclass>((c) => c.something())); 

my problem: need subscribe command managed c++, , got no idea how function signature needs to used in delegatecommand. of time errors like:

error c2664: 'microsoft::practices::prism::commands::delegatecommand::delegatecommand(system::action ^)': conversion of parameter 1 'void (__clrcall *)(mynamespace::myclass ^)' in 'system::action ^' not possible.

how subscribe c# command? or there other way listen event (i can replace compositecommand different).

thanks!

i'm going assume you're using managed c++ - else, , there's bigger issues worry about.

it looks you're getting linking errors c# type. such, don't think issue related problems prism. in order c++ managed compiler link c# assembly, need produce c# assembly xml documentation file (see build tab in properties). enabled in project?

i used following simple proof of concept, testobject defined in c# assembly referenced c++ dll. compiled without issues.

header file:

 void __clrcall commandcallback(project::infrastructure::testobject^ param);  public ref class managedmodule : imodule { public:     managedmodule();       virtual void __clrcall initialize();  private: }; 

implementation:

manageddll::managedmodule::managedmodule() {  }  void __clrcall manageddll::managedmodule::initialize() {     action<project::infrastructure::testobject^>^ newaction =           gcnew action<project::infrastructure::testobject^>(&commandcallback);     delegatecommand<project::infrastructure::testobject^>^ newcommand =           gcnew delegatecommand<project::infrastructure::testobject^>(newaction);     project::infrastructure::commands::applicationexitcommand->registercommand(newcommand);      return; }  void __clrcall commandcallback(project::infrastructure::testobject^ param) {     return; } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -