Solved

ACTIVEX CONTROL FROM AN HTML PAGE

Posted on 2003-11-27
7
339 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:const71
Comment Utility
Great! thanks for all the help
0
 

Author Comment

by:const71
Comment Utility
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
Comment Utility
could you post the code behind property let?
0
 

Author Comment

by:const71
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 …
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…
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…

743 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

14 Experts available now in Live!

Get 1:1 Help Now