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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Software >> Programming-Languages
 
  C (727)  C++ (457)  Delphi (508)  Programming-Languages-AllOther (219)
 


 

Back to Questions Page
 
Question
How can would you create an instance of the object in COM
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
We can use CreateInstance And CoCreateInstance to create an 
instance of the object in COM.

HRESULT CreateInstance(void* pfnCreateInstance,REFIID riid, 
void** ppvObj ); 

Parameters
pfnCreateInstance 
[in] A pointer to a creator function. 
riid 
[in] The IID of the requested interface. 
ppvObj 
[out] A pointer to the interface pointer identified by 
riid. If the object does not support this interface, ppvObj 
is set to NULL. 
Return Value
 
0
Balaji
 
 
Answer
To create the instance of COM componet use the following 
WIN32 APIs
To access the component that was there in local system use 
following API
CoCreateInstance(clsid,NULL(used for 
aggregation),CLSCTX_ALL,Interface_GUID,(void**)
&pRequestedInterface );

To access the COM componet remotely use the following API
CoCreateInstanceEx
(CLSID,NULL,CLSCTX_ALL,COSERVERINFO,Interface_GUID,MULTI_QI*
);
 
0
Chandrasekharreddy Siddamreddy
 
 
Question
What should QueryInterface functions do if requested object 
was not found?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Returns a pointer to the current interface if successful or 
E_NOINTERFACE otherwise.
 
0
Jitendra
 
 
 
Question
What are the purposes of AddRef, Release and QueryInterface 
functions
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
To bring the lost object identity back to the component 
thru QueryInterface and manage the life-cycle of the 
component thru AddRef and Release by reference counting.
 
0
Anand
 
 
Answer
Query Interface method is used to get the pointer to the 
interface specified in one of the parameters of this 
method. Client then uses this pointer to call the method of 
the component. 
AddRef and Release are used to increase and decrease the 
count of the instance of component loaded in memory 
respectively. when the count reaches zero the component is 
unloaded.
 
0
Riddhi
 
 
Question
What is IUnknown? What methods are provided by IUnknown?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Iunknow is the base interface for any com component.
it supports three methods
addref()
release()
queryinterface()
 
0
Mahesh
 
 
Answer
IUnknown is a type of COM Interface.

Every COM class implements an interface named IUnKnown.

IUnKnown contains three methods:
 1) HRESULT QueryInterface()
 2) ULONG   AddRef()
 3) ULONG   Release()
 
0
Cheruku Raghu
 
 
Question
What are the special requirements for dialog box resources
used in a form view?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
The user interface for a form view is based on a dialog box 
template, which is created as a modeless child window of 
your view window. Therefore, you should make sure that your 
dialog box does not have a border or a caption. You also 
need to make sure that the constructor for your view is 
passed the resource ID of the dialog box template it will 
be using; it will accept either the integer ID or string 
name for the resource.
 
0
Krishna Akkulu
 
 
Question
What view class enables you to use an edit control as a view?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
If you plan to manipulate simple text in your application, 
CEditView does just that. It uses an Edit control to form 
the user interface for the view. CEditView does not support 
different font or color settings, though. For those 
settings, you use a CRichEditView (discussed later, in the 
section, "Using CRichEditView"). In addition to wrapping 
the Edit control, CEditView also adds support for the 
following command messages:

ID_FILE_PRINT 
ID_EDIT_CUT 
ID_EDIT_COPY 
ID_EDIT_PASTE 
ID_EDIT_CLEAR 
ID_EDIT_UNDO 
ID_EDIT_SELECT_ALL 
ID_EDIT_FIND 
ID_EDIT_REPLACE 
ID_EDIT_REPEAT 
The catch is that the menu items to generate these commands 
are not implemented automatically; you must add these 
yourself.
 
0
Krishna Akkulu
 
 
Question
What function is called by a document class to notify views
that the document has been changed?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
UpdateAllViews()
 
0
Satheeshkedarisetti
 
 
Answer
SetModifiedFlag (TRUE)
 
0
Narendra
 
 
Question
What is the difference between OnInitialUpdate and OnUpdate?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Both are uses for to update the view. OnInitialUpdate() 
updates the view while initialization, this function called 
by framework while initialization. but default 
implemenation calls OnUpdate function. if the window is 
resizable or it has scroll bars, use OnUpdate() to change 
the scroll limits and document changes.
 
0
Satheeshkedarisetti
 
 
Answer
Both update the view, But

OnInitialUpdate, called when the view is first created 
OnUpdate, called when the document updates its views
 
0
Krishna Akkulu
 
 
Answer
OnInitialUpdate( ) is a virtual view function Called by the
framework after the view is first attached to the document,
but before the view is initially displayed. The default
implementation of this function calls the OnUpdate member
function
OnUpdate( ) is a virtual view function Called by the
framework after the view's document has been modified; this
function is called by CDocument::UpdateAllViews and allows
the view to update its display to reflect those modifications.
 
3
Jianhua Wang
 
 
Answer
OnInitialUpdate() is called after a view is first attached 
to the doc and before it gets displayed.We can override it 
to put some initializations containing info abt the doc.It 
calls OnUpdate().
OnUpdate() is called by the framework when the doc has been 
modified.It is actually called by UpdateAllViews() to 
reflect changes in all the views associated with the doc.
 
5
Priyanka
 
 
Question
What interface must be supported by an ActiveX control?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
An ActiveX control is essentially a simple OLE object that 
supports the IUnknown interface.
 
0
Krishna Akkulu
 
 
Question
What four types of properties are supported by an ActiveX
control?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
ActiveX controls have four types of properties:

l Stock-> These are standard properties supplied to every 
control, such as font or
color. The developer must activate stock properties, but 
there is little or no
coding involved.

2 Ambient-> These are properties of the environment that 
surrounds the control -
properties of the container into which it has been placed. 
These can't be changed,
but the control can use them to adjust its own properties. 
For example, it can set
the control's background color to match the container's 
background color.

3 Extended-> These are properties that the container 
handles, usually involving size
and placement onscreen.

4 Custom-> These are properties added by the control 
developer.
 
0
Vinay Thakur
 
 
Question
What is subclassing?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Subclassing is a standard technique in Windows programming 
for customizing the behavior of a window. MFC  wrap 
subclassing into virtual function overriding.
 
0
Somu
 
 
Answer
Subclassing is a technique that allows an application to 
intercept and process messages sent or posted to a 
particular window before the window has a chance to process 
them. This is typically done by replacing the Window 
Procedure for a window with application-defined window 
procedure. I will devide this article into 3: 

Subclassing in SDK programs, 
Subclassing in MFC programs, 
Reflected messages
 
0
Sonali Dongare
 
 
Question
What MFC base classes provide support for ActiveX controls?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Wipro
I also faced this Question!!   © ALL Interview .com
Answer
COleControl
 
0
Kirankumar
 
 
Answer
Every ActiveX control object you develop inherits a powerful
set of features from its MFC base class, COleControl.

From MSDN
 
0
Arvin
 
 
Question
Which tool is used to configure the port range and 
protocols for DCOM communications?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
use DCOMCONFIG.EXE
 
0
Shailesh S Bhute
 
 
Question
What are the different compatibility types when we create a 
COM component?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
As follows:

No Compatibility
Project Compatibility
Binary Compatibility
 
0
Pankajbisane
 
 
Question
What kind of components can be used as DCOM servers?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
There are two kind components
1. InProc
2. OutProc

We can use both as DCOM servers, its upto our design.
 
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