.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

Can .NET Framework components be used from a COM program?

Posted By :Shashi Ray     Posted Date :December 10, 2008    Points :10   Category :C# 
Yes

Managed types you build today can be made accessible from COM, and in the common case the configuration is totally automatic. There are certain new features of the managed development environment that are not accessible from COM. For example, static methods and parameterized constructors cannot be used from COM. In general, it is a good idea to decide in advance who the intended user of a given type will be. If the type is to be used from COM, you may be restricted to using those features that are COM accessible.
Depending on the language used to write the managed type, it may or may not be visible by default.
Specifically, .NET Framework components are accessed from COM by using a COM callable wrapper (CCW). This is similar to an RCW (see previous question), but works in the opposite direction. Again, if the .NET Framework development tools cannot automatically generate the wrapper, or if the automatic behavior is not what you want, a custom CCW can be developed.

Shashi Ray

You can also find related Interview Question to Can .NET Framework components be used from a COM program?  below: 

Can I use COM objects from a .NET Framework program?

  
Yes.

Any COM component you have deployed today can be used from managed code, and in common cases the adaptation is totally automatic.
Specifically, COM components are accessed from the .NET Framework by use of a runtime callable wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET Framework-compatible interfaces. For OLE automation interfaces, the RCW can be generated automatically from a type library. For non-OLE automation interfaces, a developer may write a custom RCW and manually map the types exposed by the COM interface to .NET Framework-compatible types.


Shashi Ray (More...)

How to use Win32 API from a .NET Framework program?

  
Using platform invoke, .NET Framework programs can access native code libraries by means of static DLL entry points.

Here is an example of C# calling the Win32 MessageBox function:


using System;
using System.Runtime.InteropServices;

class MainApp
{
[DllImport("user32.dll", EntryPoint="MessageBox")]
public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);

public static void Main()
{
MessageBox( 0, "Hello, this is PInvoke in operation!", ".NET", 0 );
}
} (More...)

What are the main components of .NET Framework?

  
.NET Framework provides enormous advantages to software developers in comparison to the advantages provided by other platforms. Microsoft has united various modern as well as existing technologies of software development in .NET Framework. These technologies are used by developers to develop highly efficient applications for modern as well as future business needs. (More...)

What is .NET Framework?

  
The .NET Framework has two main components: the common language runtime and the .NET Framework class library.
You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness.
The class library, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services. (More...)

What is the .NET Framework?

  
The .NET Framework is an environment for building, deploying, and running Web Services and other applications. It consists of three main parts: the Common Language Runtime, the Framework classes, and ASP.NET. (More...)

Does the .NET Framework only apply to people building Web sites?

  
The .NET Framework enables you to create great Web applications. However, it can also help you build the same applications you build today. If you write any Windows software (using ATL/COM, MFC, Microsoft® Visual Basic®, or even standard Microsoft® Win32®), .NET offers many advantages to the way you currently build applications. Of course, if you do develop Web sites, then the .NET Framework has a lot to interest you-starting with ASP.NET. (More...)

What programming languages will the .NET Framework support?

  
The .NET Framework is language neutral; virtually any language can target the .NET Framework. Currently, you can build .NET programs in a number of languages, including C++, Microsoft® Visual Basic.NET, _JScript®, and Microsoft's newest language-C#. A large number of third-party languages will also be available for building .NET Framework applications. These languages include COBOL, Eiffel, Perl, Python, Smalltalk, and others. (More...)

What is the relationship between the .NET Framework and COM+ Services?

  
The .NET Framework gives you full access to COM+ services, while also making it easier to build serviced components.
.NET Framework components can be added to a COM+ application. There they can take advantage of automatic component services such as transactions, object pooling, queued components, events, and so on. (More...)

What is the relationship between the .NET Framework and DCOM?

  
DCOM is the COM infrastructure for cross-process communication. The .NET Framework supports a number of pluggable channels and formatters for cross-process communication. When making transitions between managed and unmanaged code, the .NET Framework uses the COM infrastructure, specifically, DCOM. All scenarios using COM+ services use managed-to-unmanaged transitions, and thus use DCOM by default. The .NET Framework also supports SOAP, the Simple Object Access Protocol, for cross-process communication where interoperability is critical. (More...)

Is the .NET Framework just a new name for Windows DNA?

  
No. Windows DNA is architecture for building tightly-coupled, distributed Web applications. As the needs of distributed applications changed to require more loosely-coupled principles, Microsoft evolved the architecture to .NET. The .NET Framework is a part of the .NET architecture. (More...)

What programming languages will the .NET Framework support?

  
The .NET Framework is language neutral; virtually any language can target the .NET Framework. Currently, you can build .NET programs in a number of languages, including C++, Microsoft® Visual Basic.NET, _JScript®, and Microsoft''s newest language-C#. A large number of third-party languages will also be available for building .NET Framework applications. These languages include COBOL, Eiffel, Perl, Python, Smalltalk, and others. (More...)

What is the relationship between the .NET Framework and COM+ Services?

  
The .NET Framework gives you full access to COM+ services, while also making it easier to build serviced components.
.NET Framework components can be added to a COM+ application. There they can take advantage of automatic component services such as transactions, object pooling, queued components, events, and so on. (More...)

Can I call a Win32 API function from a C# program?

  
Yes, you can.The .NET Framework provides a set of services called Platform Invoke, also known as PInvoke. Refer to the .NET Framework documentation for examples of using PInvoke services. (More...)

What are basic components of Notification services?

  
Notification Services applications are based on a subscriber/subscription model.
The Key components in a Notification Services application are

Subscriber
A user or application that requests and receives the notification

Subscription
A request for information, delivery mechanism, and destination for requested notifications. For example change of a stock price.

Event
A piece of information, in which the subscriber is interested. For example as soon as a stock price has changed an event can be generated that's processed within SQLNS.

Notification
A message containing the information requested by the subscriber in the subscription (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend