Instantiating an automation object

I need to instantiate an automation object. I have a VB example, but I don’t have the knowledge to convert that to c/al. Public WithEvents PhoneLineMgr As CLMGRLib.ClientLineMgr Set PhoneLineMgr = CreateObject(“CLMgr.ClientLineMgr”) Where the automation object has been set to “CLMgr 2.0 Type Library”.ClientLineMgr All ideas gratefully accepted.

From the example it looks like you want to catch events from the automation object. For this you will need to use a codeunit in Navision: Define a Global Variable named PhoneLineMgr, Type Automation, Subtype “CLMgr 2.0 Type Library”.ClientLineMgr, go to properties and set WithEvents to Yes. Now you can instantiate the variable with CREATE(PhoneLineMgr); You will need to set the codeunit property SingleInstance to Yes in order to keep it running in the backgroud and catch all events from the external component. Also, if I remember, you can find some information about this on the “Application Designer’s Guide”.

thanks Nelson, the create command fixed it. :smiley:


Can you share your solution?

My customer uses Swyx and likes to call from NAV.