Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

Distributing ActiveX components to client machines

I've so far found out that I need the files in a cab file.
I've never used a cab file b4.. it currently contains an OCX and a related DLL. Do I need to make an INF file for this cab?...

this is part of the ACTIVEX object tag in the code:

codebase="datepicker.cab"


...so how do i distribute ACTIVEX objects via my page?

perhaps a tutorial?
0
Grunge
Asked:
Grunge
  • 6
  • 6
1 Solution
 
Dave_GreeneCommented:
Well you need to have the signed with Verisign.  You can build the .cab file using VB's Package and Deployment Wizard by selecting the internet deployment option.
0
 
Dave_GreeneCommented:
Here is a listing of steps to be taken to ensure you are building your OCX correctly

1) Create an OCX Project (ActiveX Control)
2) right click your control, select add UserControl, then when you get into the VB dialog where you

normally select a usercontrol, select the wizard.
3) Add the Property you want to expose eg (Message) "My Custom Members" in the wizard
4) doesn't map to a control
5) When you get to the set attributes page, set Message to a string.

Your New Control Should Look Like this

'CODE BEGIN

'Default Property Values:
Const m_def_Message = "Empty Message"
'Property Variables:
Dim m_Message As String
'Event Declarations:

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=13,0,0,Empty Message
Public Property Get Message() As String
Message = m_Message
End Property

Public Property Let Message(ByVal New_Message As String)
m_Message = New_Message
PropertyChanged "Message"
MsgBox "Here is the Message you passed [" & m_Message & "]"
End Property

'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
m_Message = m_def_Message
End Sub

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_Message = PropBag.ReadProperty("Message", m_def_Message)
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Message", m_Message, m_def_Message)
End Sub

'CODE END

6) Build your OCX
7) set binary compatibility on the control in the projects properties.
8) Add a standard EXE to your project group
9) Place the Control onto form1.
10) Check to see if the value you set in the controls property page (on form1) actually change the value,



if so proceed.

If not, it's time to write a comment on EE stating so. (listing the control code)
11) it worked!  yahoo!  Now build your OCX again just to be certain you have any changes
12) Use the Package and Deployment wizard to build the deployment
- Using the "Internet Package" option
- Take the defaults until you get to the "Safety Settings" tab, you will select "NO" for Safe for

Scripting, and

"YES" for safe for initialization.
- Now you are finished... with this step
13) now look into the directory where you built the package. you should see projectName.htm, open it


It should look something like this

'HTML BEGIN

<HTML>
<HEAD>
<TITLE>Project1.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="LPKfilename.LPK">
</OBJECT>
-->

<OBJECT ID="UserControl1"
CLASSID="CLSID:291EACFF-517D-4B6C-9EF0-A329A541AD8C"
CODEBASE="Project1.CAB#version=1,0,0,0">
</OBJECT>
</BODY>
</HTML>

'HTML END

14) Make the following changes (per this example)
   <OBJECT ID="UserControl1" Height="400" Width="400"  <--however big the control is
 CLASSID="CLSID:291EACFF-517D-4B6C-9EF0-A329A541AD8C"
 CODEBASE="Project1.CAB#version=1,0,0,0">
    param name="Message" value="Your New Message here!"
15) Save your changes and run the projectname.htm
16) If it works great, if not... time to comment again  :)

Cheers!  
0
 
GrungeAuthor Commented:
Give me a while to go through all that... but while I do let me just say from first glance that seems to be the most helpful and concise answer i've ever recieved!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GrungeAuthor Commented:
I'm not writing a brandnew control at the moment.. Its a downloaded datepicker supplied as a dll & Ocx.
0
 
newjackCommented:
listening...
0
 
Dave_GreeneCommented:
Then it should be relatively simple, provided they have already signed the control!  If you can find a page where it is used you can just copy and paste the declarations it uses.  It will usually point to a .cab file that resides on the owners server... that way updates occur automatically

Cheers  :)
0
 
GrungeAuthor Commented:
I can't find a page that uses it. The development page I downloaded it from hasn't been updated for a year or so.
http://www.mvps.org/ccrp/
0
 
Dave_GreeneCommented:
Where is this control?
0
 
GrungeAuthor Commented:
0
 
Dave_GreeneCommented:
Ok, you are going to have problems with this one.  

1) you didn't create it.
2) the person who did may or may not have had it signed.
3) you may have to pay for the control.

You could wrap the DLL & OCX up in your own CAB file, but the control will never be signed, and some browsers are set to reject unsigned controls.

I would send the guy an email asking him what his intentions are with this control, who knows maybe he's gotten it signed and it's available... or maybe he'll give you the code... never know.
0
 
GrungeAuthor Commented:
I'm using this one now...it only requires the vbrunSp3
my problem is to distribute this..

http://hjem.get2net.dk/vcoders/cm/resources/vcdtp.htm
0
 
Dave_GreeneCommented:
From the readme.txt file in the cab

Installation Requirements:
vcDTP requires Visual Basic 6 with at least Service Pack 3 applied
and Ssubtmr.dll by Steve McMahon (http://www.vbaccelerator.com)

This site mentions also...

If you wish to distribute the source code files by any other means (i.e. if you want to include it on a CD or any other software media) then the EXPRESS PERMISSION of the author is REQUIRED.


So it's at this point I need to ask you what you intend to do with this control?  If you are going to build your app around it, you are going to need to get permission from both parties... unless, if I read everything correctly... you can download the source code and rebuild the projects into newly named components.

If this is the case and you really want this control, I would get the soure code for both projects and integrate them into one control, rename the control and you have 'your' control.

Then you can either go to verisign and get a control signature, or you can just insist that the people using your controls accept activex controls in their browser options.

Thoughts?
0
 
GrungeAuthor Commented:
Some contradicting txt on the site:

http://hjem.get2net.dk/vcoders/cm/general/vendor.htm#Top

Also..

Release version: Made the DateTime Picker independent of Steve McMahons SSubTmr6.dll. This means that there are no dependencies execpt for the VB6 SP3 Runtime files.
........................................................

The only problem is distributing the VB6-SP3 Runtime files.

I have a link to it however client machines clicking on this actutally activate the .exe on the server

server is currently win98 with pws.

:?)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now