DLueck
asked on
How to create a object at run time?
I searched the web and found some answer. however most were unclear.
I need to create an object (activex control) on the fly based up what type of monitor the users has choosen. User choice is stored in a database. Pseudo coded would look soemthing like this
If (MonitorType == "SERIAL")
{
createobject name="m1Control" CLASSID="13456778542531243 21s"
codebase="m1control.CAB#ve rsion=1,0, 0,17" height="20" width="120"
viewastext id="m1Control">
}
else
{
createobject name="M2Control" CLASSID=890749587495812749 057194"
height="20" width="120" viewastext id="M2Control">
}
The first activex is seldom change (but we must support) is written in VB. Second activex control is new and written in VC++.
Question is what are the command(s) to do this on the page load event? is this possible?
I need to create an object (activex control) on the fly based up what type of monitor the users has choosen. User choice is stored in a database. Pseudo coded would look soemthing like this
If (MonitorType == "SERIAL")
{
createobject name="m1Control" CLASSID="13456778542531243
codebase="m1control.CAB#ve
viewastext id="m1Control">
}
else
{
createobject name="M2Control" CLASSID=890749587495812749
height="20" width="120" viewastext id="M2Control">
}
The first activex is seldom change (but we must support) is written in VB. Second activex control is new and written in VC++.
Question is what are the command(s) to do this on the page load event? is this possible?
you can dynamically render scripts to the generated page using page.clientscript.register clientscri ptblock .. you can do this on page load .. check the condition and render the code to create the activex control required ..
>>Second activex control is new and written in VC++.
do note that only COM activex controls will work on a web page and that too by default on IE (depending on the security settings) .. for other browsers, the user might need some plugins ..
Rejo
>>Second activex control is new and written in VC++.
do note that only COM activex controls will work on a web page and that too by default on IE (depending on the security settings) .. for other browsers, the user might need some plugins ..
Rejo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Bob,
The activexes request/get data from a patient vitals monitor (blood pressure, heart rate, O2 percentage).
Alot of the monitors are connect to the serial port. However the new ones coming out are starting to be connect by tghe usb port.
So we decide to leave the old one alone (serial port) and make a new one for all the usb type monitors.
In the database I store the monitor type (comm/usb). Based upon the monitor type, that activex control needed to be loaded onto the web page.
hope that answers your question.
The activexes request/get data from a patient vitals monitor (blood pressure, heart rate, O2 percentage).
Alot of the monitors are connect to the serial port. However the new ones coming out are starting to be connect by tghe usb port.
So we decide to leave the old one alone (serial port) and make a new one for all the usb type monitors.
In the database I store the monitor type (comm/usb). Based upon the monitor type, that activex control needed to be loaded onto the web page.
hope that answers your question.
i thought that the sugestion i made was similar to the final approach taken .. the difference been using a literal control instead of using registerclientscriptblock ..
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
Vee_Mod
Community Support Moderator
It might be possible to define both the ActiveX controls in the HTML, and then toggle the visibility.
I am curious what these ActiveX controls do?
Bob