|
-
Feb 19th, 2001, 05:08 PM
#1
Thread Starter
New Member
Hi,
I am a newbie to activeX Controls and have a question about passing "PARAM" from HTML page to an
activeX control.
I am trying to pass parameters from HTML page onto an activeX Control using "PARAM NAME="" VALUE="".but am having problems with accessing the param value inside the activeX Control.
activeX.html
---------------
<OBJECT CODEBASE=/Project1.ocx
CLASSID="...."
<PARAM NAME="test" VALUE="100">
</OBJECT>
In my UserControl1.ctl how do i access the value of the param "TEST"
In my activeX Control(UserControl1.ctl) I am using get() and set() methods as:
Private mtest As String
Property Get test() As String
' Use the Set statement for object references.
test = mtest
End Property
Public Property Set test(NewParent)
mtest = NewParent
End Property
Private Sub myButton_Click()
Print ("mtest=" + mtest)
End Sub
But, when I run it and click on the button it doesn't display anything for mtest.
Can someone please help me with this??
thanks a lot.
-
Nov 29th, 2001, 06:52 AM
#2
New Member
hi
I have now the same problem as you.
When you could solve the problem, it woud be nice if
you can help me
thanks
gerd
-
Dec 4th, 2001, 07:10 AM
#3
Fanatic Member
You also need to implement the code to get the PARAM details from the HTML page when the control first loads. This is done using a Property Bag (A stupid name I know but blame Microsoft).
Try adding the following to your code.
Code:
Private mTest as String
Const m_defaultTest = ""
Private Sub UserControl_InitProperties()
mTest = m_defaultTest
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
mTest = PropBag.ReadProperty("Test", defaultTest)
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Test", mTest, defaultTest)
End Sub
Property Get test() As String
test = mTest
End Property
Public Property Let test(NewValue as String)
mTest = NewValue
End Property
Private Sub myButton_Click()
Print ("mtest=" + mtest)
End Sub
I've not tested the above so you may find a few bugs but let me know how you get on.
Martin J Wallace (Slaine)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|