CGI is not really a language but a specification that allows programs to run on Web servers. CGI programs can be written in a number of languages, including Perl, C and Visual Basic.
Data input on a web page is sent to CGI programs.
ActiveX allows ordinary windows programs to be run on a web page as included, downloaded components. Like Java applets. However, controls can be permanently installed on the browser machine negating the need to download on every re-use. ActiveX is cute but works on windows platforms and in the Microsoft Internet Explorer browser ONLY !!! There are a lot of Netscape users out there.