Answer Posted / srividya_gopalan
Component Object Model is a method to facilitate
communication between different applications and languages.
The following steps explain the way to create the COM
server in C#:
Create a new Class Library project.
Create a new interface, say IManagedInterface, and declare
the methods required. Then provide the Guid (this is the
IID) for the interface using the GuidAttribute defined in
System.Runtime.InteropServices. The Guid can be created
using the Guidgen.exe. [Guid("3B515E51-0860-48ae-B49C-
05DF356CDF4B")]
Define a class that implements this interface. Again
provide the Guid (this is the CLSID) for this class also.
Mark the assembly as ComVisible. For this go to
AssemblyInfo.cs file and add the following statement
[assembly: ComVisible (true)]. This gives the accessibility
of all types within the assembly to COM.
Build the project. This will generate an assembly in the
output path. Now register the assembly using regasm.exe (a
tool provided with the .NET Framework)- regasm
\bin\debug\ComInDotNet.dll \tlb:ComInDotNet.tlb This will
create a TLB file after registration.
Alternatively this can be done in the Project properties ->
Build -> check the Register for COM interop.
The COM server is ready. Now a client has to be created. It
can be in any language. If the client is .NET, just add the
above created COM assembly as reference and use it.
| Is This Answer Correct ? | 24 Yes | 5 No |
Post New Answer View All Answers
Explain the boxing and unboxing concept in .net?
Will the asp.net validators run in server side or client side?
How you will handle session when deploying application in more than a server?
Describe state management in asp.net?
Explain asp.net application life cycle?
What is hidden field in asp.net?
What do you mean by query string?
If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
1.what is the application pool. 2.what is the HttpModile and Http Handler. 3.C# 3.0 Features ? 4.Anonoymous Type,methopd and claas in 3.0? 5.difference between statsic and const ? 6.session vs application 7.state management clint side and server side ? 8.Genric list 9.c# 3.0 vs 3.5
What is session and application variable in asp net?
How many types of cookies are available in asp?
What is web api vs wcf?
What is the difference between response.redirect and server.transfer?
Difference between Response.redirect vs server.transfer?
What are the events that happen when a client requests an asp.net page from iis server?