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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem: passing parameters from HTML to ActiveX

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am having problems with &quot;passing parameters from HTML to ActiveX with <param name=&quot;myName&quot; value=&quot;myParam&quot;>&quot; .

Steps followed:
--------------------
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
Error:
&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;

Problems:
-------------
I am trying this on Win2000 machine and I have IE5.5 version.
1.What should my browser security settings be?? OR what causes the above error message??
2. the param value is not displayed ever...

.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.
vuy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top