Link to home
Start Free TrialLog in
Avatar of jkunal
jkunalFlag for India

asked on

Active X Control

Hi,

I have made an Active X control, that
reads data from the data base, does some modifications and displays the data.
I am using asp's to view the ocx control.This ocx control works very well on the m/c i created it, but if i open the asp page from some other page i dont get anythig.(Have to something like cab file but dont know how).
My question is :
1.How can i make it possible for all the clients to view this ocx?
2.If it picks values from the data base on the server will it work for the clients that access the website,by that i mean will it display the values from the server?
Avatar of MTroutwine
MTroutwine
Flag of United States of America image

You need to create an Internet Setup Package using the Package and Deployment utility provided with VB.  This creates and 'Internet Component Download' and allows the browser to uncompress and install the ActiveX component, it will also check security on the component.  You will have to add an <OBJECT> tag to your web page similar to this to download the component:

<OBJECT ID="MyControl"
CLASSID="CLSID:XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX"
CODEBASE="MyControl.CAB#version=1.0.0.0">
</OBJECT>

The P&D wizard will walk you through creating the package and will question you on how you want to handle security with options such as Authenticode, Safe For Scripting, etc..  The wizard will also allow you to select where the component CAB file and associated files will be stored for downloading.

Once you run the wizard and have the package setup you should be set to go.

:>)
Avatar of jkunal

ASKER

Thanks MTroutwine,
will check it out tomorrow morning from office and if it works you will surely get your deserved points.

Thanks Any Way

Kunal :->
Avatar of jkunal

ASKER

Thanks MTroutwine,
will check it out tomorrow morning from office and if it works you will surely get your deserved points.

Thanks Any Way

Kunal :->
Avatar of jkunal

ASKER

Hey i followed  u r instructions and got an htm file along with the cab file
i copied the htm file on my web server
and ran that htm file from another m/c but still did not get the ocx component
can u help?
Avatar of hes
You also need to do the following:


VB activeX controls are licensed for the development box only. IE's license manager will not display a unlicensed control. You have to create a .LPK file from the tool
lpk_tool.exe located on the vb install cd under common/tools/vb/lpk, then install that file on the server running the htmp page and add the following code to the html page
 <object CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"   width="50" height="50">
    <param name="LPKPath" value="FileName.lpk">
  </object>




Avatar of jkunal

ASKER

hes
i cannot find the lpk tool.
Please help

Avatar of jkunal

ASKER

Hi Again, I followed what you people had said but still no luck..

This is my Htm page....

<HTML>
<HEAD>
<TITLE>admins.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,
      http://www.microsoft.com/intdev/sdk/sdk.htm. 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="(IP)/control/" VALUE="admin.LPK">
</OBJECT>

<OBJECT ID="admin"
CLASSID="CLSID:3068DCCA-E474-11D3-B333-00104B219AE3"
CODEBASE="admins.CAB#version=1,0,0,0">
</OBJECT>
</BODY>
</HTML>

But i still cannot make it work on a client m/c.
i even set the security to low in my IE
:-<
Many thanks to hes for adding the code I had missed!

jkunal,

Have you ran the LPK_TOOL.EXE?  If you are running Visual Studio Enterprise this file is located on Disk #3.  

Reference: PRB: Visual Basic Files Are Missing From Common\Tools Directory
http://support.microsoft.com/support/kb/articles/Q191/5/46.ASP

This executable will create the license package for your component.  If you have done all of this then I would reject my answer and see if someone else has any ideas!  

:>)
jkunal,
I think the param name is incorrect
it should be "LPKPath"

http://support.microsoft.com/support/kb/articles/Q159/9/23.asp
Avatar of jkunal

ASKER

hes thanks for the article,
did the changes (LPKPath) but it still does'nt work
Avatar of jkunal

ASKER

Does my active -x control also requires digital signing??
I am getting confused in this active-x
control registering..........
Avatar of jkunal

ASKER

sorry MTroutwine but i need a answer on this soon......
jkunal,
Please post the code as you have it now.
That's fine I would like to see the problem resolved, as per hes' request can you post your code?
Avatar of jkunal

ASKER

Hi hes,MTroutwine here is the code....

<HTML>
<HEAD>
<TITLE>admins.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,
      http://www.microsoft.com/intdev/sdk/sdk.htm. 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="admin.LPK">
</OBJECT>

<OBJECT ID="admin"
CLASSID="CLSID:3068DCCA-E474-11D3-B333-00104B219AE3"
CODEBASE="admins.CAB#version=1,0,0,0">
</OBJECT>
</BODY>
</HTML>
jkunal,
is the admin.LPK in the same directory as the html file, that is how you have your VALUE= coded.
Avatar of jkunal

ASKER

Yep hes,

And i had a strange experience,
i copied a ocx from microsoft site and then registered and made a CAB file and it worked fine on the client machine..
Now i make my own ocx and do the same thing and it doesnt work, so i just made a ocx with a text box and a button.
When you click on the button you get 'HI' displayed on the text box.
Now i did the same regs etc etc for my new control as i did for the MS control but still my control didnt work....

Is it that you have to add something to the ocx file??
Avatar of jkunal

ASKER

Now i know how export a Active-X, even though mine doesnt work,
Thanx to you MTroutwine And hes.
I will keep this qusetion open add another two question with 50 points each for MTroutwine and hes for helping me out.

Avatar of jkunal

ASKER

hes,MTroutwine please suggest something..
I need this working by Monday.
Please....
ASKER CERTIFIED SOLUTION
Avatar of anupvijay
anupvijay
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial