use ActiveX Control

How can I use an ActiveX Control?

I would need it to display a special type of data.

I tried using the <object> tag but against what is written on msdn, there is no attribute progid for this tag. ( I get an invalid attribute error in VS2005)

How else can I use it?




2/25/2009 1:31:19 PM 93655 articles. 6 followers. Follow

7 Replies

Similar Articles

[PageSpeed] 1

Well that depends on how your distributing it. Did you make it yourself? Is it in a cab file? is it just a raw hot linked DLL?

Little more to go one is helpful.

Evan's Blog
Codeundrum: Code that puzzles.
2/25/2009 2:22:03 PM

nope it's commercial and a dll. But users who would potentially use the app already have it installed on their pc anyway and it is on the server too.

I'm not really sure if it needs to be client side since I just want to display the data ( It could also be used to edit the data but that is not needed).

I added a reference to it and tried using it by specifing it in the class atrribute. But when leaving away runat I don't get an error but the control is not displayed (small red cross in place of the control) when i put runtat=server I get "could not load type" error. 


it seems I can use the dll programmatically. I can create the object and tell it to Open a file and it works, but the data I not displayed on the screen . So mabye I should create and display the control using code?


2/26/2009 8:27:18 AM

This works:

<object id="CDCtrl" classid="clsid:45C31980-E065-49A1-A3D7-E69CD40DAF66" 
    style="width: 182px; height: 172px; border-width: medium">
I got the classid by searching windows registry for the control name. Small remaining issue is that no border is displayed, bigger one to actually get the data into the control because when trying to reference it in I always get a null reference exception. Because control is running on client?
2/26/2009 12:32:00 PM

Can you tell me what the control is, and who makes it? Since it's commercial I can go take a quick look and give you some help.

Evan's Blog
Codeundrum: Code that puzzles.
2/26/2009 2:11:01 PM

So here is my not so straightforward solution. a better one would be nice.

The control accecpts different types (MIME types) of data and this parameter must be passed when loading data.  So setting the "data" property of the control as param in the object tag does not work directly, I tried. This makes it pretty uncool to get the data into the control.

I have a hidden field, a public property in the code-behind and a JavaScript function. On Page load the field value property is set to the datavalue (which is a CLOB) and the JS function is run with ClientScript.RegisterStartupScript. The function does nothing else than transfer value from field to control. EDIT: Note that it has to be a field because a hidden text box is not visible to JavaScript.

Is there a limit of characters a (hidden) field can contain? Because this data can contain quite alot of characters.

here code:


    <script type="text/javascript" language="javascript">
        ShowValue = function()
            document.CDCtrl.Data("chemical/cdx") = document.getElementById("ctl00_MainContent_cdx_data").value;            

<input id="cdx_data" type="hidden" runat="server"/>

<object id="CDCtrl" name="CDCtrl" classid="clsid:45C31980-E065-49A1-A3D7-E69CD40DAF66" 
    style="width: 182px; height: 172px; border-width: medium">
    <param name="ViewOnly" value="True" />
    <param name="DataEncoded" value="True" />    

vb code behind:

    Protected Sub Page_Load( _
        ByVal sender As Object, _
        ByVal e As System.EventArgs) _
        Handles Me.Load

        'TO DO:
        ' parameterize property access
' Mol = read only property; gets data through bll

        Me.cdx_data.Value = Mol("AB-000001")

        ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "ShowValue()", True)
    End Sub





3/2/2009 8:11:31 AM

Similar Artilces:

using a .Net Control as activex control in VCL form
Hi , We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010 VCL form as a control. We will place the control on the VCL form along with other VCL controls's. I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runti...

Using an ActiveX control in a web form
Hi, I'm currently using a 3rd party ActiveX control as part of an old VB6 application simply running the .ocx ActiveX client side without any problems. What I would like to do is use this .ocx ActiveX control in an ASP.NET web form. I am assuming that this cannot be run server side, and therefore would like to use it client side with the user downloading the control and executing it locally. However if this can be done server side then that is even better. I have placed the .ocx on the server and registered it, I am now looking for a way of using the control in a web page. When I...

Using Win Form controls in web forms
Hi All,   Please tell me if i can't use the window forms controls in my webform. What if i simply import the Namespace. Definitely this will help me to expose the class & methods, but will they work accordingly when get rendered. I am totally confused.. please help me. Thanks Simple answer:  You can't.  Webforms controls render as HTML; while this may be possible to achieve with Winforms controls by invoking the design-time rendering, I doubt it's going to work very well.What control are you trying to use?Peter BrunoneMS MVP, ASP.NETFounder, Easy...

Updating Data on web page from ActiveX control using VC++ .net MFC
background;  I have built this activex control (VC++ .net MFC using VS2005 .net paltform 2.0) that gathers data from an external device (deviceA).  The device is connect to the pc by USB port.  Getting the data into the activex control is working fine.  However, after I parse the data from the data packets, I need to update 5 fields on the web page. Basic layout of the web page is ActiveX                parentwindow -> frame1 -> frame2 -> fram3 usercontrol The usercontrol is on the web pa...

How to access the properties and methods of the ActiveX control on the client side in Web Form using javascript or vbscript
Hi All, I have looked almost every where for this, and I'll be really appreciated if someone can help me with this. I found a article in MS KB article, #317392, but it is not extactly what I wanted. How do you reference an ActiveX control's methods and properties with javascript in the ASPX? Following is what I have. Some how the following line in the btnclick() does not seems to be working. AlarmCtl.StartTimer() I have done this with just .HTML and it works just fine. Can any one help. Thanks in advance. //===========================...

Use Web Control In a Web Control
Is this possible?I am working with an aspx page that consists of many different web controls.One of the web controls contains search criteria.  One of the criteria is a date range where I am trying to add a popup calendar --> which is another web controlCan I register the popupcaledar control on the questionaire control?  I have tried, but nothing seems to be registered.Any ideas will GREATLY help.Relax and have some Home Brew!Prosecute the Owner - Don't PERSECUTE the Breed!Breed Specific Legislation targets the WRONG end of the LEASH! Without seeing your code we can'...

user control data entry form, use same codebehind as web form?
Hi All, I have a quesiton about the approach I'm taking. I have a series of report forms which I have been in the process of consolidating to a single, generic page and subs/functions in a single code-behind. All the reports can use the same set of data entry elements (a dropdown, a radio list, and a textbox). I'm trying to convert these elements to a user control. However, this user control seems to need to inherit differently than the rest of the code-behind. I've been using a single class in the code behind. Is it feasible to separate out the data entry? the code behind im...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

I have a web user control being used by another web user control, but the one being used will not display the labels in the resx file.
I am using DotNetNuke version 3.13 (might be 3.013) on a Window's XP machine, SP2. I have what I find to be an extremely odd situation. I have a project called TDS.Controls. This project is a web control library. Each control has its own resx file, which is located in the App_LocalResources directory. Each control inherits from Framework.UserControlBase, just like DotNetNuke's User control in DNN\Controls\User.ascx.vb. As a matter of fact, this control is doing the exact same thing I am trying to do. It is a web user control with its own resx file being used by another web user control (See ...

hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

Use Web Custom control or Web User control?
Friends,  I have a generic aspx page and its functions which is used in many .NET web application. The generic page contains a HTML Div control, server drop down list, server buttons, server textbox and it have different server and client functions to do its tasks for calling aspx pages in web applications. My problem is I do not know whether I should make that generic page as a web user control (but this is tedious because all other application folders must store frontpage aspx and code behind files of the generic page) or as a web custom control (This seems to be good beca...

Web form control to use??
Please advise what is best form control to use for my webform. I will be retrieving data from a database where I need to display different types of items with different repetitive answers. For example: I retrieve a user. This user will have his/her profile like: Symptoms : where there are about 50 symptoms types and possible values are yes/no dosage used : where there may be a possible of 100 dosage types and possible values could be numeric values. I was going to dynamically add a radio button list for the symptoms and tables cells for the dosage types and their quantities, but is ...

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

how to call controls of web control form in coding of other forms?
hello everyone i have one problem i have created one webcontrol shoppingcart in which there are two labels one of qty and other of amt which are initially enable =falsenow on other page(aspx page) i have one txtbox of qty as txtqty i want tat as soon as user enters qty txtqty and clicks on add cart button it shd be display d value in lblqty of web control shopping cart make sure i m using datalist on aspx page so give me suggestions on tat basis and my coding is in vb. plz give ur suggestions as fast as possible. Neeti what do you mean by webcontrol.... it this user control or normal ...

How to get the HREF value of the Anchor tag in a web page using the web browser control in
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Web resources about - use ActiveX Control -

ActiveX - Wikipedia, the free encyclopedia
... 1996 and is commonly used in its Windows operating system. In principle it is not dependent on Microsoft Windows, but in practice, most ActiveX ...

유자드 웹-무료 웹브라우저(Flash, ActiveX) on the App Store on iTunes
Get 유자드 웹-무료 웹브라우저(Flash, ActiveX) on the App Store. See screenshots and ratings, and read customer reviews.

Activex - ARN
The source for IT industry news, views and analysis across the channel, business and technology

Microsoft warns of Video ActiveX flaw; Vista unaffected
A new vulnerability has been found in ActiveX that affects users running …

South Korea looking to scrap ActiveX payment requirement bad news for Internet Explorer
In 1999, South Korea pushed a law that forced online vendors to adopt Microsoft ActiveX, in order to utilize the SEED cipher developed by the ...

ActiveX for Windows - Free downloads and reviews - CNET
The most downloaded ActiveX software, including Audio Capture ActiveX Control, VB Activex Controls (HVEE 2008), and Innobate Product Key Recovery ...

Microsoft offers patches to ward off ActiveX attacks
In rare out-of-cycle security update, Microsoft fixes hole that put IE users at risk of attacks via ActiveX and other controls. Read this article ...

RIM releases patch for buggy ActiveX control
Research In Motion has patched a piece of software for Windows PCs that could leave them vulnerable to attack when loading new applications onto ...

IE's new ActiveX vulnerability: drive-by exploiting msvidctl.dll
IE has a new ActiveX vulnerability, now being exploited by drive-by downloads: in msvidctl.dll. In IT Blogwatch, bloggers unpick fact from fiction. ...

Activex Articles on Engadget
Activex articles, stories, news and information.

Resources last updated: 12/12/2015 3:05:58 PM