ActiveX Documents

Finishing Up

If everything works OK, it's time to compile. Go ahead and close VB (Remember to save) and open the Application Setup Wizard for VB. (It's the program which creates the setup files for you.) Select the Project File for your Document, and choose Generate Internet Download Setup. This option will set up the Document so that all parts will be downloaded automatically, and any needed Runtimes will be downloaded from Microsoft, saving you Server space. Click next, and then select a folder to put the compiled files in. I suggest UDTest, as only the Document's files will be there. Click next, and select download from the Microsoft website option, and click next. After this it's the same as any application, however click finish, and the Setup Wizard will do the rest of the work for you.

While it may seem like we are finished, there are still a few things left. You need redesign the main page of your site, so that it's framed, to take full advantage of the Document. Opening the Document in a new window is fine, but you loose the seamless look of Java or pure HTML. Before you do the Loading page, you need to know what the ClassId of your control is. Well, when you ran the Control, it wrote the ID to the windows registry. To get it, Open and run your project Then select run from the start menu, and type in regedit. You'll see the windows registry open up. Open HKEY_CLASSES_ROOT and scroll down till you find the name of your Control. Open that folder, then open the folder Clsid. To the right, you'll see the key pop-up. Under the data heading is the Document's ID. Copy that down. To make the Loading page, you'll have to define the ActiveX object, (the classid and where to download it and check for newer copies), and the frameset for your site. (Actually we'll use VBScript to load the main page of the site.) Open Notepad and key in the following: (note, anything in green is comments I put there for you. If it's blue, you put what you named the page or control there. :P )

<HTML>
<OBJECT ID="Name of your control ie (UDoc)" CLASSID="CLSID:Your classid here."CODEBASE="Cab
file generated by setup
#version=version # ie 1,0,0,0></OBJECT>

<SCRIPT LANGUAGE="VBScript"">
Sub Window_OnLoad
Document.Open
Document.Write "<FRAMESET COLS=""20%,*"">"
Document.Write "<FRAME NAME=""usrdoc"" SRC=""you vbd file"">"
Document.Write "<FRAME NAME=""main"" SRC=""path to your home page"">"
Document.Write "</FRAMESET>"
Document.Close
End Sub
</SCRIPT>
</HTML>

That's it. Once you upload all of the files to your webspace, along with the load file, everything should work just fine.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski