PDA

Click to See Complete Forum and Search --> : setting properties


Thai
Aug 29th, 2000, 01:57 PM
I am trying to set the property of an ActiveX control I made in html/vbscript.

Here is the ActiveX Control's code:

Private MyJobKey As Variant

Public Property Let JobKey(ByVal NewValue As Variant)
MyJobKey = NewValue
End Property

Public Property Get JobKey() As Variant
JobKey = MyJobKey
End Property

Private Sub Command1_Click()
MsgBox Me.JobKey
End Sub


Here is the code for the vbscript:

<object
ID="MyControl"
classid="CLSID:48A068E9-B3C8-4EB8-B0E8-60AF511F30EB"
width=80
height=30>
</object>

<script language=vbscript>
MyControl.JobKey = 1
</script>



So the script should have set the MyControl's JobKey to 1, but when I click on Command1 the message box doesn't display 1. Any ideas?

Thanks!
Thai

The_Fog
Sep 1st, 2000, 06:26 AM
New activeX Com!

Create the following code in a class called "GlobalKey"

Public function jobKey(myKey as integer)
MsgBox (myKey)
End funtion

save and compile it as Key.dll
then use regsvr32 to register the dll.

"regsvr32 key.dll"

New Script:

<script language="vbscript">
set myControl = CreateObject("Key.GlobalKey")
s = myControl.jobKey(1)
</script>


This will result in a msgbox (containing "1")displayed by the Com-Object.
Hope this helped.

The Fog