03.07.2008, 14:05 | #1 |
Участник
|
AX Developer tips: .NET enumerations in Dynamics AX
Источник: http://axdevposts.blogspot.com/2008/...namics-ax.html
============== As you know starting from DAX 4.0 .NET interoperability was introduced. You can easily instantiate .NET classes either likewise COM or by directly calling constructor method: Microsoft.Office.Interop.Outlook._Application outlookApplication = new Microsoft.Office.Interop.Outlook.ApplicationClass(); it is the same with Microsoft.Office.Interop.Outlook._Application outlookApplication = new CLRObject("Microsoft.Office.Interop.Outlook.ApplicationClass"); Although usage of .NET objects is quiet common to COM, you cannot pass enum parameter to .NET object as int or str Instead of doing it you have to initialize it this way: Microsoft.Office.Interop.Outlook.OlItemType olAppointmentItem = CLRInterop::parseClrEnum('Microsoft.Office.Interop.Outlook.OlItemType', 'olAppointmentItem'); Here you're initializing type of new Outlook item with type Appointment. This inconvenient trick should be held every time you want to initialize enum parameter. Anyway it is more convenient than defining macro values like is done for COM enumerations. Источник: http://axdevposts.blogspot.com/2008/...namics-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|