Solved

Active X Control

Posted on 2000-02-24
20
224 Views
Last Modified: 2013-11-25
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
Comment
Question by:jkunal
  • 12
  • 4
  • 3
  • +1
20 Comments
 
LVL 3

Expert Comment

by:MTroutwine
ID: 2554209
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
 
LVL 4

Author Comment

by:jkunal
ID: 2554279
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
 
LVL 4

Author Comment

by:jkunal
ID: 2554352
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 4

Author Comment

by:jkunal
ID: 2554885
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
 
LVL 20

Expert Comment

by:hes
ID: 2555238
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
 
LVL 4

Author Comment

by:jkunal
ID: 2556954
hes
i cannot find the lpk tool.
Please help

0
 
LVL 4

Author Comment

by:jkunal
ID: 2557319
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
 
LVL 3

Expert Comment

by:MTroutwine
ID: 2557901
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
 
LVL 20

Expert Comment

by:hes
ID: 2558155
jkunal,
I think the param name is incorrect
it should be "LPKPath"

http://support.microsoft.com/support/kb/articles/Q159/9/23.asp
0
 
LVL 4

Author Comment

by:jkunal
ID: 2563905
hes thanks for the article,
did the changes (LPKPath) but it still does'nt work
0
 
LVL 4

Author Comment

by:jkunal
ID: 2565220
Does my active -x control also requires digital signing??
I am getting confused in this active-x
control registering..........
0
 
LVL 4

Author Comment

by:jkunal
ID: 2569190
sorry MTroutwine but i need a answer on this soon......
0
 
LVL 20

Expert Comment

by:hes
ID: 2569750
jkunal,
Please post the code as you have it now.
0
 
LVL 3

Expert Comment

by:MTroutwine
ID: 2570373
That's fine I would like to see the problem resolved, as per hes' request can you post your code?
0
 
LVL 4

Author Comment

by:jkunal
ID: 2571534
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
 
LVL 20

Expert Comment

by:hes
ID: 2573128
jkunal,
is the admin.LPK in the same directory as the html file, that is how you have your VALUE= coded.
0
 
LVL 4

Author Comment

by:jkunal
ID: 2573181
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
 
LVL 4

Author Comment

by:jkunal
ID: 2573228
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
 
LVL 4

Author Comment

by:jkunal
ID: 2576291
hes,MTroutwine please suggest something..
I need this working by Monday.
Please....
0
 
LVL 2

Accepted Solution

by:
anupvijay earned 100 total points
ID: 2622800
hi,
i you have a problem with the registering of yuor ocx component
Check it out
Anup
 

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA/SQL - Connect to SQL server and pull data 4 107
Spell Check in VB6 13 112
How do ASP.NET and MVC work together? 4 45
Error with a code discussed on this page 5 12
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now