Solved

ACTIVEX CONTROL FROM AN HTML PAGE

Posted on 2003-11-27
7
344 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
[X]
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
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

752 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