Dynamics AX

Welcome to my Dynamics AX playground!

Home     Articles     Dynamics AX - Trivia     Dynamics AX Search     Mohammed Rasheed     Contact Me     My Dynamics Ax Blog      
Guide to Setup SSRS with
Add Fields to a Table Using Code
Code to view Ledger Transaction Details
AX Mobile - Installation and Configuration
Forecasting in Dynamics AX 2009
Multi Threaded Programming in DAX
OLAP - Installation and Configuration
Send Text Messages (SMS) from DAX
Sending Emails from DAX without Outlook.
Using Data Definition Groups
A View Thing..
All About Maps..
COM Class Wrapper
Create a Role Centre
Create and Post Counting
Outlook 07 Integration
Alerts to Multiple Users
Counting Lines of Code
 
 

Using the COM Class Wrapper in AX 2009

 

View the PDF version (Better, with Pics)

 

COM Class wrapper is a immensely useful and phenomenally easy to use tool..

 

Basically it wraps COM objects and make them available to you (a developer) just like a normal x++ class.

 

You dont necessarily have to use the com wrapper to be able to use com objects.. the old and handy class COM (http://msdn.microsoft.com/en-us/library/aa655160.aspx) is sufficient..  however (with all due respect to the COM class) intellisense does not work with the COM class hence as a developer you either need to know what the com methods are (and their signatures) or you continuously will be flicking though developer documentation on the com interface.

 

Well COM class wrapper basically put intellisense into COM...... you can say that the COM Wrapper is to COM what References is to .Net

 

I would like to point out that MS discourages the use of the COM interfaces in AX. Hence, if you have the option, then consider taking the .Net route.

 

You can find the COM Wrapper under Developer Tools > Wizards > COM Class Wrapper

 

It does exactly what is says on the tin..

 

In the next screen one would see a list of all registered com libraries..

 

Select the one that you are looking for and click next... (the office 12 object library is a bad example.. as I could have done the same thin using References, which is the recommended method).

 

Specify an element mask.. this makes it easier to find the objects in the AOT. It also resolves the possibility of name conflicts.

 

In this example mrOff was the Element Mask.