• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

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?
0
jkunal
Asked:
jkunal
  • 12
  • 4
  • 3
  • +1
1 Solution
 
MTroutwineCommented:
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.

:>)
0
 
jkunalAuthor Commented:
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 :->
0
 
jkunalAuthor Commented:
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 :->
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
jkunalAuthor Commented:
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?
0
 
hesCommented:
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>




0
 
jkunalAuthor Commented:
hes
i cannot find the lpk tool.
Please help

0
 
jkunalAuthor Commented:
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
:-<
0
 
MTroutwineCommented:
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!  

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

http://support.microsoft.com/support/kb/articles/Q159/9/23.asp
0
 
jkunalAuthor Commented:
hes thanks for the article,
did the changes (LPKPath) but it still does'nt work
0
 
jkunalAuthor Commented:
Does my active -x control also requires digital signing??
I am getting confused in this active-x
control registering..........
0
 
jkunalAuthor Commented:
sorry MTroutwine but i need a answer on this soon......
0
 
hesCommented:
jkunal,
Please post the code as you have it now.
0
 
MTroutwineCommented:
That's fine I would like to see the problem resolved, as per hes' request can you post your code?
0
 
jkunalAuthor Commented:
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>
0
 
hesCommented:
jkunal,
is the admin.LPK in the same directory as the html file, that is how you have your VALUE= coded.
0
 
jkunalAuthor Commented:
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??
0
 
jkunalAuthor Commented:
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.

0
 
jkunalAuthor Commented:
hes,MTroutwine please suggest something..
I need this working by Monday.
Please....
0
 
anupvijayCommented:
hi,
i you have a problem with the registering of yuor ocx component
Check it out
Anup
 

0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 12
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now