Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ACTIVEX CONTROL FROM AN HTML PAGE

Posted on 2003-11-27
7
342 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

828 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