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!

adding properties to an activex control

Status
Not open for further replies.

GeorgeLAZAR

Programmer
Nov 22, 2000
3
RO
I have written an ActiveX control in VB6. I have added 4 properties with the
Interface wizard, but I can't set my properties in an HTML page using
JavaScript. The problem must be within the VB code. Shall I do something
more?
I can "see" my properties on the list using the Object browser in Interdev,
but I can't set them.
Can anyone please answer to my question?

Thank you for your help.

George LAZAR
 
Have you got Public Property Let PropertyName(Byval vData As variable_type) in your control??

Can you set then in another development environment?? Have you tested the control in a VB application, before trying to use it in JavaScript??

Can you paste some / all (if not too much!!) code for me to take a look at??

Simon
 
Hi,

I am trying to &quot;pass parameters from HTML to ActiveX with <param name=&quot;myName&quot; value=&quot;myParam&quot;>&quot;
but am NOT able to access the param values in activeX control.

I made the control safe for initialization by implementing the IObjectSafety interface and digitally signed the .cab file .

I am guessing that the problem should be with my browser settings bcoz after I run the activeX control it displays a message
&quot;This page provides unsafe information to activeX control. Your current security setting prohibit running controls in this manner.
As a result, this page may not display correctly.&quot;

1.What should my browser security settings be??
i am trying this on Win2000 machine and I have IE5.5 version.

.html
--------
<OBJECT ID=&quot;UserControl1&quot;
CLASSID=&quot;CLSID:...&quot;
CODEBASE=&quot;Project1.ocx&quot;>
<PARAM NAME=&quot;myTest&quot; VALUE=&quot;1&quot;>
</OBJECT>

userControl
---------------
Dim myTest As Long
Public temp As Long

Public Property Get myVar() As Long
myVar = myTest
End Property

Public Property Let myVar(ByVal NewTest As Long)
myVar = NewTest
PropertyChanged &quot;myVar&quot;
End Property

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty &quot;myVar&quot;, myTest, &quot;&quot;
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
myVar = PropBag.ReadProperty(&quot;myTest&quot;, &quot;2&quot;)
End Sub

Private Sub UserControl_Click()
temp = myVar
Load Form1
Call Form1.ControlRef(Me) 'pass the reference before showing
Form1.Show 1
End Sub

Private Sub UserControl_Initialize()
Call UserControl_Click
End Sub

Form1.frm
-------------
Dim cCtl As UserControl1
Private Sub Form_Activate()
Print cCtl.myVar
End Sub
Sub ControlRef(cC As UserControl1)
Set cCtl = cC
End Sub

Thanks a lot.
sus

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top