Most of the ActiveX related topics were written for use with the VBA programming language. To use the code in other programming environments, you must update it for the chosen environment.
Use the documentation for your development environment to help you convert the example code.