GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  DotNet
Go To First  |  Previous Question  |  Next Question 
 DotNet  |  Question 90 of 165    Print  
Using ActiveX Control in .Net
ActiveX control is a special type of COM component that supports a User Interface. Using ActiveX Control in your .Net Project is even easier than using COM component. They are bundled usually in .ocx files. Again a proxy assembly is made by .Net utility AxImp.exe (which we will see shortly) which your application (or client) uses as if it is a .Net control or assembly.
• Making Proxy Assembly For ActiveX Control: First, a proxy assembly is made using AxImp.exe (acronym for ActiveX Import) by writing following command on Command Prompt:

C:>AxImp C:MyProjectsMyControl.ocx
This command will make two dlls, e.g., in case of above command
MyControl.dll
AxMyControl.dll

The first file MyControl.dll is a .Net assembly proxy, which allows you to reference the ActiveX as if it were non-graphical object.
The second file AxMyControl.dll is the Windows Control, which allows u to use the graphical aspects of activex control and use it in the Windows Form Project.
• Adding Reference of ActiveX Proxy Assembly in your Project Settings: To add a reference of ActiveX Proxy Assembly in our Project, do this:
o Select ProjectàAdd Reference… (Select Add Reference from Project Menu).
o This will show you a dialog box, select .Net tab from the top of window.
o Click Browse… button on the top right of window.
o Select the dll file for your ActiveX Proxy Assembly (which is MyControl.dll) and click OK
o Your selected component is now shown in the ‘Selected Component’ List Box. Click OK again

Some More On Using COM or ActiveX in .Net
• .Net only provides wrapper class or proxy assembly (Runtime Callable Wrapper or RCW) for COM or activeX control. In the background, it is actually delegating the tasks to the original COM, so it does not convert your COM/activeX but just imports them.
• A good thing about .Net is that when it imports a component, it also imports the components that are publically referenced by that component. So, if your component, say MyDataAcsess.dll references ADODB.dll then .Net will automatically import that COM component too!
• The Visual Studio.NET does surprise you in a great deal when u see that it is applying its intellisense (showing methods, classes, interfaces, properties when placing dot) even on your imported COM components!!!! Isn’t it a magic or what?
• When accessing thru RCW, .Net client has no knowledge that it is using COM component, it is presented just as another C# assembly.
• U can also import COM component thru command prompt (for reference see Professional C# by Wrox)
• U can also use your .Net components in COM, i.e., export your .net components (for reference see Professional C# by Wrox)



  
Total Answers and Comments: 1 Last Update: January 13, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 13, 2006 06:37:44   #1  
samiksc Member Since: October 2005   Contribution: 233    

RE: Using ActiveX Control in .Net

ActiveX control is actually a COM component. For using a COM component in a .net project you can follow one of the following two procedures --

  1. For private COM components -- In the .net project click Add reference and navigate to COM tab. Select the COM component which will create a proxy for the component which is conforming to .net. This proxy is called Runtime Callable Wrapper (RCW)
  2. For shared COM components -- Use the command line utility 'tlbimp' to create a RCW from COM component. Using this utility allows you to give the RCW a name specify namespace and other advanced settings. Then add a reference to the imported DLL from your .Net project as usual.

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : dataadapter.fill(ds)The beauty of this method is it automatically implicitly opens the connection to database and closes it once done.We dont need to worry about opening and closing the connection to the database. ...

Latest Answer : not possible but format can,.. ...

Latest Answer : ItemTemplate ...

Latest Answer : AlternatingItemTemplate Like the ItemTemplate element, but rendered for every otherrow (alternating items) in the Repeater control. You can specify a different appearancefor the AlternatingItemTemplate element by setting its style properties. ...

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

Latest Answer : ControlToValidate and ErrorMessage are the two properties for every validation control.. ...

Which control would you use if you needed to make sure the values in two different controls matched?

Latest Answer : There are following types of validation controls provided by ASP.Net:RequiredFieldValidatorCompareValidatorRangeValidatorRegularExpressionValidatorCustomValidatorThese controls are server side controls. However in up-level browsers that is IE 4.0 and ...

A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under control of 
Latest Answer : Namespace - It is a logical group of classes means it defines boundary for classes. In a single program 2 namespace cannot be have same name. Assemblies - These physical structure of coding and it can store manifest (metadata). Assembly can be ...

ASP ASP.NET ASP is interpreted. ASP.NET Compiled event base programming. Control events for text button can be handled at client javascript only. Since we have server controls 
Latest Answer : To summarize the points of differences are as follows:Code behind in asp.net allows separation of business logic from UI, which is not possible in asp.ASP.Net uses ADO.Net objects which are represented using XML, and hence they are lightweight and can ...


 Sponsored Links

 
Related Articles

High Level Data Link Control (HDLC)

High Level Data Link Control HDLC The High Level Data Link Control protocol was developed by the International Organization for Standardization ISO It is used for switched and non switched networks and is a bit oriented architecture The High Level Data Link Control has been accepted and used widel
 

Synchronous Data Link Control (SDLC)

Synchronous Data Link Control SDLC The SDLC or the Synchronous Data Link Control was first developed by IBM It is basically a linked layer protocol which can be used with systems network architecture or the SNA environment In this system all the functions in a network can be defined and slotted into
 

ERP Operation and Control

ERP Operation and Control The selection of the most suitable management system is it a difficult decision to make but once it is decided the next step is the operation and maintenance of ERP It is necessary to know well all the capacities and abilities in order to exploit the system to its fullest e
 

ERP Systems as Quality Control Support

ERP Systems as Quality Control Support For the past few years ERP systems have became one of the most powerful tools for quality control management But ERP is just an informatics system that provides support to the integrated business management mosgoogle center Goals of the Quality Control Module i
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Supply Chain Management : Quality Control in Industrial Engineering

Supply Chain Quality Control in Industrial Engineering When it comes to the industrial engineering aspect of supply chain management quality control and quality assurance are two duties that must be undertaken The former refers to the process whereby measures are taken to make sure defective product
 

VSAM Control Interval and Control Area

VSAM Control Interval and Control Area In this Mainframe tutorial you will learn about VSAM Control Interval What is a Control Interval in VSAM and Control Area what is VSAM control area attributes in the control area index component mosgoogle center What is a Control Interval in VSAM Control Interv
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape