ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Programming-Languages >> VC++ >> COM-DCOM
 
 


 

Back to Questions Page
 
Question
Write a JCL to copy only selected members from a 
partitioned data set to another partitioned data set. (Use: 
IEBCOPY)
Rank Answer Posted By  
 Question Submitted By :: Arun Garg
This Interview Question Asked @   Wipro
I also faced this Question!!   © ALL Interview .com
Answer
Use this URL:

http://publib.boulder.ibm.com/infocenter/zoslnctr/v1r7/index.jsp?topic=/com.ibm.zjcl.doc/zjclt_smplcopypartds.html
 
0
Pankajbisane
 
 
Question
how do you know it is general dll or com dll
Rank Answer Posted By  
 Question Submitted By :: Ashis Nishanka
I also faced this Question!!   © ALL Interview .com
Answer
COM Dll contails IUnknown interface but general DLL doesn't.
 
1
Bijender Singh
 
 
Answer
Open the dll in dependency walker application 
(depends.exe). If the dll is having following functions
DLLRegisterServer
DLLUnRegisterServer
DLLCanUnloadNow
DLLGetClassObject

It is a COM DLL otherwise it is not.
 
2
Chandrasekharreddy Siddamreddy
 
 
 
Answer
second answer is correct, checking dll not means, checking
in source code.So IUnKnowns pointer checking no
possible.Simply check using dependancy walker as in 2
 
0
Techy Break
 
 
Answer
COM DLLs export above listed 4 functions and it's mandatory 
for any DLL to be qualified as a COM DLL.
Where in regular DLLs we get a list of exported functions 
which from client application we will invoke.
 
0
Sandeep Mishra
 
 
Question
Futures of COM
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   MIT
I also faced this Question!!   © ALL Interview .com
Answer
Futures of COM
1.Transparency
2.Extensibility
3.Indirection
4.Versioning
5.Server lifetime management.
 
0
Aj
 
 
Answer
1. Defines a binary standard for component interoperability 
2. Is programming language-independent 
3. Is provided on multiple platforms (Microsoft® Windows®, 
4. Microsoft Windows NT™, Apple® Macintosh®, UNIX®) 
5. Provides for robust evolution of component-based         
applications and systems 
6. Is extensible
 
0
Chandrasekharreddy Siddamreddy
 
 
Question
Differentiate normal DLL to COM DLL
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
A normal DLL can export any function. 
 A COM DLL is the one which exports COM APIs like
            * DllGetClassObject.
            * DllRegisterServer.
            * DllUnregisterServer.
            * DllCanUnloadNow.
 
0
Pranesh Archak
 
 
Answer
COM Dll exposes Interface on the contrary to normal DLL 
that exports functions. Clients create the pointer to 
COMDLL's interface to call the methods defined by the 
component that implements the interface. 
That results in isolation of implementation and definition 
of method in the interface. Client doesnt need to relink or 
recompile the code if method in the com dll changes as far 
as the definition of the interface remains same.
 
0
Riddhi
 
 
Answer
Classic DLLs are function libraries while ActiveX(COM)
DLLs are objects. The difference is like the difference
between procedural and object oriented programming.
     API style Declare statements are needed for routines in
a 'normal' DLL and and an ActiveX(COM) DLL is treated like a
class object.
 
0
Saravanan K
 
 
Question
When you call CoInitialize(NULL) function how it works 
internally.
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
This function is used to initialize a component object 
model.
 
0
Dipa
 
 
Answer
CoInitialize() is initializing the COM object libraries for
that particular thread.
 
2
Rathakrishnan
 
 
Answer
CoInitialize(NULL) function internally assigns a ID to the 
calling thread i.e., Appartment ID. Without this ID SCM 
doesn't allow you to access the COM Component.
 
0
Chandrasekharreddy Siddamreddy
 
 
Answer
CoInitial(NULL) will take your main thread into the 
appartment.
 
0
Krishna Sagar
 
 
Answer
CoInitialize will initialize the COM library and will move 
the executing thread to a STA or Single Threaded Apartment
Apartment is the logical entity where threads live.
 
0
Sandeep Mishra
 
 
Question
how you call a dll as a COM dll.
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
If a dll is registerable and can keep the interface in COM
Runtime library then we can call that dll as COM dll
 
3
Rathakrishnan
 
 
Answer
Inorder to call your DLL as COM dll, you have to follow 
some rules to develop the dll. If those rules are there 
then only your DLL will be called as COM dll.

COM is a specification set of rules to develope binaries, 
COM is not a language.
 
3
Chandrasekharreddy Siddamreddy
 
 
Question
Do COM keep track of all the object references(Accounting)?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Microsoft , Microsoft
I also faced this Question!!   © ALL Interview .com
Answer
yes
 
1
Naresh
 
 
Answer
Object references in COM is accounted using two methods of
IUnknown Interface (AddRef and Release).

AddRef: Increments a reference count whereas "Release"
decrements the count.
When the count of the reference is zero the DLL is unloaded
from memory.
 
3
Naviyr
 
 
Answer
Component uses reference count for memory 
management.whenever a client gets an interface,reference 
count get incremented. When client finishes using interface 
reference count get decremented. If the reference count 
goes to 0, component deletes itself from memory. When 
client uses existing interface to create another reference 
client has to increment reference count by calling "AddRef" 
and release when client finshes using interface.
 
5
Vidhya
 
 
Question
Define and explain COM?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Microsoft
I also faced this Question!!   © ALL Interview .com
Answer
COM (Component Object Model) technology in the Microsoft
Windows-family of Operating Systems enables software
components to communicate. COM is used by developers to
create re-usable software components, link components
together to build applications, and take advantage of
Windows services.
 
2
Rajesh Kumar Sitaraman
 
 
Answer
component object module is com.It defines standard binary
interface between object modules.this interface defines the
function calling methodology standardised structure.
 
0
Shan
 
 
Answer
COM is a specification of how to build the components that 
link with each other dynamically. It provides the standard 
that the component should follow to ensure that they 
operate with each other. 
Benefits of COM
1) Language Independence: components can be written in any 
language and can link with the other component written in 
different language. So the component doesnt become obselete 
as new prog languages evolve
2)Customizing applications: application is no longer static 
entity since new modules can be easily added or existing 
can be modified.
3)Distributed Applications: Its easier with COM as 
applications is already fragmented in components. component 
can be replaced by the remote component on local m/c that 
fwd request over n/w to actual component.
 
0
Riddhi
 
 
Answer
COM (Component Object Model) technology in the Microsoft
Windows-family of Operating Systems enables software
components to communicate. COM is used by developers to
create re-usable software components, link components
together to build applications, and take advantage of
Windows services.
 
3
Deepak
 
 
Answer
COM is a specification, set of rules, to develope the 
binaries( either DLL or EXE or OCX ).

If you follw the rules provided by the COM you will get the 
following benifits
1. Language Indipendent
2. Location Transperency
3. Version compatability
 
0
Chandrasekharreddy Siddamreddy
 
 
Answer
COM:
Interface between the component and application.can be 
easily upgraded on network.
 
0
Rameshnaidu
 
 
Question
How to  Use structs in COM interfaces when Automation 
compatibility is not an issue?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Structs, also known as User Defined Types (UDTs), can be 
used in Automation- compatible interfaces 
An Automation- compatible struct may contain only primitive 
Automation types as its members. 

Nesting structs is not allowed, but VARIANT is allowed thus 
enabling nested structs (you can store a struct in a 
VARIANT).

In order for a struct to be usable for Automation-
compatible interfaces, the struct must be described in a 
type library and it must be declared with its own GUID: 

[uuid(21602F40-CC62-11d4-AA2B-00A0CC39CFE0)]
struct MyStruct
{
	[helpstring("A long value")]
	long nLongValue;

	[helpstring("A string")]
	BSTR bstrStringValue;
};

// Later in the IDL file
[uuid(...), version(...), helpstring(...)]
library MyLib
{
	...
	struct MyStruct;
};
For more info see : http://vcfaq.mvps.org/com/4.htm
 
0
Krishna Akkulu
 
 
Question
C is aggregated by B, which in turn aggregated by A. Our 
client requested C. What will happen?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
QueryInterface to A will delegate request to B which, in 
turn, will delegate request for the interface to C. This 
pointer will be returned to the client.
 
0
Krishna Akkulu
 
 
Question
What is a moniker ?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
An object that implements the IMoniker interface. A moniker 
acts as a name that uniquely identifies a COM object. In 
the same way that a path identifies a file in the file 
system, a moniker identifies a COM object in the directory 
namespace.
 
0
Venkat
 
 
Answer
actual resource or object provide by the system.
 
0
Asd
 
 
Question
Let?s assume we have object B and aggregated object C (in-
proc server), created by B. Can you access any interface of 
B from C? What?s the difference between aggregated and 
contained objects?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
For the first question, Yes, we can since the QueryInterface
() rules of thumb suggest that if we can query an interface 
of C from B, we should be able to query the viceversa.
The IUnknown implementation of both the objects has to do 
the 'magic'.

For the second question, Aggregation bounds outer and inner 
objects together and gives the user the interface pointers 
of either objects to access it directly so that the user 
never knows the objects are aggregated. 

But when containment is used, the interface of inner object 
never exposed to the client directly rather the outer 
object receives the calls and forwards internally. Here 
also, the user doesn't know the objects are contained.
 
0
Mms Zubeir
 
 
Answer
1. Yes, we can access. In aggresstion will use deligation 
concept to directly interact with innner components.

2. Explantion given in answer (1). I will give how we are 
achieving that
When we create the Outer Componet Instance internally will 
create innner componet instance and keep the IUnknown 
pointer of Inner component in Outer Component and Outer 
componet IUnknown pointer in InnerComponet to deligate the 
calls.
 
0
Chandrasekharreddy Siddamreddy
 
 
Question
What is In-proc?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
In-proc server is a COM component, when instance is the 
server is loaded into the caller process space. In-Proc 
server can be easily identified by .dll extension.

Out-of-Proc server is a COM component that run in its own 
process space and for any instances created by the users, a 
proxy is created within the users process space. Proxy is 
responsible for interacting with the server to carry out 
operation on behalf of the client. (.exe extension).
 
0
Guest
 
 
Answer
In-proc server is a com dll, when you create a com dll 
using ATL or other technology, then the dll loads in the 
process space of the client applications process space that 
is called in-proc server.
 
0
Ashish
 
 
Answer
There are two kind of components: in-process and out-of-
process. This is identified by where the component runs 
when it is invoked. That is, (i) if a component sits inside 
the calling process's address space, it is an in-process 
component and (ii) if a component runs in its own address 
space when invoked, it is an out-of-process component.
The data transmission between out-of-process component and 
the calling process must be carried out by some IPC 
mechanism while it is not required for the other one.
 
0
Zubeir
 
 
Answer
In-proc servers always run calling application address 
space.
 
0
Chandrasekharreddy Siddamreddy
 
 
Question
What is the difference, if any, between OLE and COM?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
COM is a standard and OLE is build upon that standard
 
0
Ahmed Ali
 
 
Answer
OLE is a set of technologies to support linking and 
embedding. COM lies in OLE as one of the technologies. COM 
defines a binary standard / set of rules for developing 
reusable components.
 
0
Zubeir
 
 
Answer
OLE 
Is Windows 3.0's most exciting technology: the abilty to 
Embed and Link Objects between applications. It's first 
incarnation was based on DDE dialogs.

COM
When OLE expanded, it was obvious that DDE was not firm 
grounds, so Microsoft decided to create a new foundation. A 
binary compatible, language independent, extremely 
lightweight (practicaly no runtime) protocol. That is the 
Component Object Model. It defines binary interfaces and 
allows programmes to commit to them (implement) and use 
those functional contracts.

OCX
One of the most natural uses of COM was the replacement of 
old Visual Basic controls (VBX) for 32 bit more usable Ole 
Custom Controls (OCXs). There was a set of interfaces that 
allowed you to expose your object to be used on fellow 
programmer's toolbox.

ActiveX
Enter the Internet and Internet Explorer. Microsoft wanted 
to make the Web Browser experience richer and so you could 
embed an OCX as part of a page content. Problem was, the 
ammount of required interfaces was too large and 
downloading such entities on demand required time. So the 
standard was trimmed down to the necessary interfaces and 
renamed ActiveX. An ActiveX control is simply any COM 
object.

And all this is history, I mean, the new grounds for 
Microsoft technology is now .NET and not COM. Problem is, 
there isn't a replacement for OLE (embedding, drag and 
drop, etc) -at least that I know of- based upon .NET.
 
0
Chandrasekharreddy Siddamreddy
 
 
Question
What happens when client calls CoCreateInstance?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
- Reads Root\Classes\ProgId for the matching ProgID
- Reads Root\Classes\ProgId for the matching CLSID. The 
  CLSID is read from the above step.
- From the CLSID key, the server type and image filename is 
  known.
- Depending upon the server type, it starts the server.
- Calls CoGetClassObject function to get a handle to the 
factory object.
- Then calls createinstance on the factory interface to get 
the pointer to the derived object.
 
0
Guest
 
 
Answer
Client Involes
      |
CoCreateInstance(IID_IMyInterface)
      |
DLLGetClassOject() - This is there in server DLL
      |
CoGetClassObject(IID_IClassFactory) - this will return 
IClassFactory Interface Pointer. Then call to
IClassFactory->CreateInstace() here we are instatiating the 
our class and returning the IMyInterface pointer to client.
 
0
Chandrasekharreddy Siddamreddy
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com