

COM Proxy › Executing the VB and ASP Sample Code › Calling the COM Proxy from Visual Basic
Calling the COM Proxy from Visual Basic
When you build a COM Proxy, the generation process creates a Visual Basic template with all the code required to invoke the proxy (through an ActiveX automation interface) and to send and receive data. This template is in file <model-name>\proxy\com\deploy\<component>\vb\<operation>.bas
To call this file from Visual Basic, you must add code to let you input the required data and display the outputs.
Follow these steps:
- To insert the generated module into your Visual Basic project, choose Project from the Visual Basic menu, and click Add Module.
- To use this code, create an event that invokes the inserted subroutine (for example, a button click event).
- Make changes to assign values for required import views, or comment out unused import view assignment statements.
- Change the reading of the export views so that the information is not assigned to temporary variables.
- Ensure that you add project references to the COM Proxy. To do this, complete the following steps:
- Select Project from the Visual Studio menu.
- Click Add Reference.
The Add Reference dialog appears.
- Select COM on the Add Reference dialog.
- Select the AX Proxy, listed as <component> 1.0 Type Library, in the Component Names drop down.
- Verify if the AX file location is accurate in the Path field.
- Click OK.
The reference is added to the project.
- If you are using Visual Basic .NET and, add the following statement to the start of the file that contains the generated module:
imports <componet>
This statement allows you access to the component added in step 5.
Note: The code in the template is commented to help you in adding your own procedures. Pay special attention to the DECLARATIONS section near the top of the file. It contains instructions for adding the ActiveX automation DLL reference to the VB project. You may also need to comment out certain lines in the code (for example, the section on INPUT VALUES).
Copyright © 2015 CA Technologies.
All rights reserved.
 
|
|