Solved

ACTIVEX CONTROL FROM AN HTML PAGE

Posted on 2003-11-27
7
340 Views
Last Modified: 2010-05-01
Hi,

I am trying to run an OCX control from an HTML file. The Control loads up fine and i can
interact with it (ie click events work)  but i need to set a variable within this OCX to some
value that I specify from the PARAM tag. Whatever i do i can't seem to set an internal
variable with this HTML:

<HTML>
<HEAD>
<BODY>

<OBJECT
    ID=OrderLine1
    CLASSID=CLSID:4729F5C6-EFC0-4C8A-834F-3B77AF539C49
>

<PARAM NAME="_ExtentX" VALUE="5054">
<PARAM NAME="_ExtentY" VALUE="7620">
<PARAM NAME="OrderID" VALUE="5">

</OBJECT>

</BODY>
</HTML>



The OCX code is this:

Option Explicit

Public OrderID As String

Private Sub Description_Click()
    MsgBox OrderID
End Sub

Private Sub UserControl_Resize()
    Width = 2865
    Height = 4320
End Sub



What do i need to do to set this parameter? is there an event i need to use to set this?
Please help


Thanks
0
Comment
Question by:const71
  • 4
  • 3
7 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
ID: 9833235
Instead of use a public variable to simulate a property, why don't you create a real property ? You don't gain nothing doing in that way since vb, internally, creates those properties anyway.
Besides, in this way no propertychange event is raised
0
 

Author Comment

by:const71
ID: 9833266
That worked!  now if i need to use this OrderID to populate my fields in the OCX by running a query, is it best to do this in the Property's  LET  method?

thanks for the help!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9833305
Since it is not an object, you have to use property Get/Let.
To populate those "fields" you need to do it at Poperty Let since there is where the property changes.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:const71
ID: 9833352
Great! thanks for all the help
0
 

Author Comment

by:const71
ID: 9833499
It seems the Let property isnt being called. Is it possible the properties are being assigned elsewhere?  

Any ideas?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9833580
could you post the code behind property let?
0
 

Author Comment

by:const71
ID: 9861841
Sorry for delay.. the problem is that it is not the LET function that gets called but the ReadProperties method.


I added my initialization code at the end of all the propertiy settings and it worked wonderfully...


thanks again
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now