Solved

ACTIVEX CONTROL FROM AN HTML PAGE

Posted on 2003-11-27
7
345 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month5 days, 5 hours left to enroll

635 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