473,666 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically create an ActiveX control with a UI and put it in my page?

1 New Member
I've got an ActiveX control that I created and use in an HTML file. In that case, I have it in an <object> tag in the body. Works great.

Now I'm wanting to defer the creation of the object until some time AFTER the page loads. So I'm putting a place for it in the <body> using a <div id="myOCX"></div> placeholder.

I created a Javascript function that can create the ActiveX control, and it actually works. I can see that I get some logging information in some files. The problem is that the ActiveX control isn't visible. I don't see it. Normally the HTML file had something like this:

Expand|Select|Wrap|Line Numbers
  1. <OBJECT
  2.       classid="clsid:xxxxxxxx-9473-40C2-951E-84B24727AD65"
  3.       width="100%"
  4.       height="100%"
  5.       align="center"
  6.       hspace="0"
  7.       vspace="0"
  8. >
The intent is to fill up the container it's in.

So if I have a Javascript function like this:

Expand|Select|Wrap|Line Numbers
  1. function makeOCX() {
  2.    var newOCX = new ActiveXObject("gwdOCX.TheOCX");   // note - this works 
  3. }
How do I make this the right size and get it to show up in the placeholder <div> I set up for it?
Dec 19 '07 #1
1 2252
gits
5,390 Recognized Expert Moderator Expert
hi ...

i'm not familiar with activeX but typically you could be able to do the following:

Expand|Select|Wrap|Line Numbers
  1. function makeOCX() {
  2.    var newOCX = new ActiveXObject("gwdOCX.TheOCX");   // note - this works 
  3.    newOCX.visible = true;
  4. }
  5.  
may be you could set the dimensions the same way ... newOCX.width = 'whatever', etc. ...

hope it helps,

kind regards
Dec 20 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
8542
by: mikeyjudkins | last post by:
Ive been banging my head on the wall for hours with this one, hopefully someone will know what Im doing wrong here :\ The Goal: I have an xml file that is generated on the fly via JSP which I want to load into a Microsoft.XMLHTTP ActiveX object and manipulate via javascript on the client side. Data is retreived from the server at the request of the javascript without having to reload the page. The Problem:
3
2319
by: fumihiko | last post by:
Hi, I created an activex control (C++), and it uses another COM dll (C++). This COM dll links with a static library that dose some calculation. (both are debug multithreaded dll) I created a C# client having activex control embedded at the very beginning (added in the design window); then, I created another same activex control at the runtime. After the 2nd activex control is created, I start to get errors on the function calls to the...
6
3687
by: Vinay | last post by:
Hi all, Can we create an ActiveX (.OCX) control in ATL project type? Is project type for creation of .OCX file can only be ActiveX MFC type? If yes, Could you suggest me some Links? My Requirement: To create an ActiveX control that could be include in a web Page. This control has a DataGrid on it. Iam unable to do so in MFC ActiveX projects. Im using VS 6.0.
0
1956
by: bcox | last post by:
I would like to be able to set parameter values for an ActiveX control hosted on an ASP.NET .aspx page from a C# code behind file. The ActiveX registration code is contained in <OBJECT></OBJECT> tags hosted in the .aspx file. The control in question is a file viewer. I need to be able to set the filename <PARAM NAME="Filename" VALUE="filename.ext"> reference under the <OBJECT></OBJECT> tags dynamically.
8
4310
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
3
22846
by: EJ1003 | last post by:
Hello I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control. Please guide me on this, how to do it, if any sample is provided will be of great help Thanks EJ
1
1022
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a variable (targetId) in to the usercontrol (IntergySite.aspx) by calling its setter method. Currently, I am using if-then-else and hardcoded the User Control Object to do casting and call the setter method. Question: Is there any way I could load,...
4
3422
by: qualitynice | last post by:
HELP :-)... I'm creating an embedded activex object in an asp.net page using the HtmlGenericControl class. I'm doing this because when I tried to embed it directly in the aspx page, it stopped working once I changed it to run on the server (runat="server"). It said the GUID was wrong. I found code showing how to implement an activex control using the HtmlGenericControl class from the code behind file, but I can't figure out how to call...
7
6651
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.