Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OCX won't display on web page

Status
Not open for further replies.

Kavius

Programmer
Apr 11, 2002
322
CA
Oops looks like I posted to the wrong forum with a question. I am hoping someone here may be able to help me.

Old thread: thread222-866657

Summary of problem:
I have an application that needed to do some calculations for a company. The one weird requirement is that they wanted the same piece to work on the web, in a current VB App, and as a stand alone.

Normally, I would build some logic, package that as a DLL and then build a seperate front-end for the web and the application. In this case I decided to just use an OCX and distribute it to the web.

This appears to work well, if the ocx is already registered on the user's computer. Currently, if a user accesses the website you get a box pop-up asking if you want to install the package, you say, yes and then nothing happens. The control just isn't loading remotely.

Any ideas what I might be missing?

Just to test I created the simplest project I could (an ocx with nothing on it) and built a cab for distrobution. It won't display either

The weirdest thing is that if you install the application version (which is the ocx placed on a form) it installs and then you can use the ocx off of a webpage. This says to me that the ocx is not being installed properly by IE.

As a note I did change my security to these settings for the test:
[tt]
ActiveX controls and plug-ins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
enable - Download signed ActiveX controls
prompt - Download unsigned ActiveX controls
prompt - Initialize and script ActiveX controls not marked as safe
enable - Run ActiveX controls and plug-ins
enable - Script ActiveX controls marked safe for scripting
[/tt]

 
Sorry, I didn't read every line of the earlier (old) thread. But have you included a license package (LPK) file and an appropriate matching reference to the IE License Manager component?

When you use the PDW on a UserControl project it creates a small test HTM if you say you are packaging for the web.

Here's an example of a working one I have for an old trivial (demo) project called "FormDemo" that has a teeny UserControl with 2 text boxes, a button, and a label (enter two values, press the "Add" button, the sum shows in the label control):

FormDemo.HTM
Code:
<HTML>
<HEAD>
<TITLE>FormDemo.CAB</TITLE>
</HEAD>
<BODY>
<!--	If any of the controls on this page require licensing, you must
	create a license package file. Run LPK_TOOL.EXE to create the
	required LPK file. LPK_TOOL.EXE can be found on the ActiveX SDK,
	[URL unfurl="true"]http://www.microsoft.com/intdev/sdk/sdk.htm.[/URL] If you have the Visual
	Basic 6.0 CD, it can also be found in the \Tools\LPK_TOOL directory.

	The following is an example of the Object tag:

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
	<PARAM NAME="LPKPath" VALUE="LPKfilename.LPK">
</OBJECT>
-->

<OBJECT ID="AddForm"
CLASSID="CLSID:3FDC7FE3-94AF-11D5-A4B3-00C04F4F1704"
CODEBASE="FormDemo.CAB#version=1,0,0,0">
</OBJECT>
</BODY>
</HTML>
Note that I created the file [tt]FormDemo.LPK[/tt] using LPKTOOL as suggested in the sample HTM's comments. Then I would edit to produce:

[tt]<PARAM NAME="LPKPath" VALUE="FormDemo.LPK">[/tt]

After editing/saving the HTM, place all 3 "FormDemo" files (HTM, CAB, and LPK) in the same web server directory. Then any machine can properly display the web page.

When creating the LPK file you need to reference every licensed control your UserControl uses. Also any licensed control used on the rest of the page (there can be only one License Manager on a page, it can reference only one file - thus your LPK file must be comprehensive). This only works if you have a developer license for the controls in question of course.

If your VB6 UserControl has the "Require License Key" option checked (see the project properties) you may need to include it in the LPK file as well when you build it. I've never tried that myself though. When in doubt, try it out.


In general this is meant as encouragement. It can be done, I've done it many times.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top