Posts

Showing posts with the label Events

How to add .net based user control to AX 2009

if you would like to add any user control prepared on .net platform into AX 2009 you should follow the steps: 1-Create Active X and wrap the user control with unmanaged code. 2-register to windows as COM object. 3-call it from AX. 1- Here is sample code: //create Class type project in Visual Studio //Set events that will be used in AX //presents to caller [ComVisible(true)] //create interface type of Dispatch [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] //Create unique key, used by windows //you can create a guid from tools menu on visual studio easily. [Guid("102B961D-60B6-4990-8B29-4802F7F9D293")] public interface IEventInterface { [DispId(1)] //define events that we want to use void ValidateEdit(object sender, ValidateEditEventArgs e); } [ComVisible(true)] //class unique ID [ProgId("DC.ActiveX.C1FlexGrid")] //declera EventInterface class for the class [ComSourceInterfaces(typeof(IEventInterface))] //class type should be AutoDual [ClassInterface(ClassInt...