Vital C++ COM ActiveX Interview Preparation Guide
Download PDF

C++ COM ActiveX frequently Asked Questions by expert members with experience in C++ COM ActiveX. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts

22 C++ COM ActiveX Questions and Answers:

Table of Contents:

Vital  C++ COM ActiveX Job Interview Questions and Answers
Vital C++ COM ActiveX Job Interview Questions and Answers

1 :: Define the syntax and semantics for a function template?

Templates is one of the features of C++. Using templates, C++ provides a support for generic programming.

We can define a template for a function that can help us create multiple versions for different data types.

A function template is similar to a class template and it syntax is as follows:
template <class T>
Return-type functionName (arguments of type T)
{
//Body of function with type T wherever appropriate
}

2 :: Explain Component Object Model?

COM defines an API to allow for the creation of components for use in integrating custom applications or to allow diverse components to interact.
But in order to interact, components must adhere to a binary structure specified by Microsoft.

As long as components adhere to this binary structure, components written in different languages can interoperate.

3 :: How COM provide the language transparency?

COM defines an API to allow for the creation of components for use in integrating custom applications or to allow diverse components to interact.

But in order to interact, components must adhere to a binary structure specified by Microsoft.
As long as components adhere to this binary structure, components written in different languages can interoperate.

4 :: Explain IUnknown interface?

IUnknown interface provides clients like DirectX control of to get pointers to other interfaces. All COM interfaces are inherited from IUnknown interface. It is used In multiple inheritance where the various interfaces can share one implementation of IUnknown.

5 :: Why COM need GUIDs?

A globally unique identifier (GUID) is used for unique IDs. No two GUIDs are the same no matter what computer they were generated on. The attribute clsid defines the GUID of the associated ActiveX control to use.

6 :: Explain GUID?

GUID stands for Globally Unique Identifier.
A 16-byte number generated by Microsoft programs that uniquely identifies a network or user or computer or document. It is one of the elements of information that can be passed when you connect to an Internet site, and it may be stored in cookies.

7 :: Explain type library?

A file or component within another file that contains standard descriptions of exposed objects, properties, and methods

A type library contains a binary description of an interface exposed by a COM-component. In this sense, they contain the same information that is contained in an IDL (Interface Definition Language) file.

8 :: Explain ActiveX and OLE?

Object Linking and Embedding (OLE) is about using documents generated by one application inside another application.

ActiveX is a Microsoft rebranding of OLE with more focus on smart Windows controls.

9 :: Explain dual interfaces?

A dual interface allows its methods to be accessed as dispinterface methods or as vtable methods.

Dual interface is one that supports both - IDispatch interface and vtbl-based interface. Therefore, it might be used in scripting environment like VBScript and yet to use power and speed of vtbl-based interface for non-scripting environment.

10 :: Explain shallow and deep copy?

A shallow copy just copies the values of the data as they are. Even if there is a pointer that points to dynamically allocated memory, the pointer in the copy will point to the same dynamically allocated.

11 :: Explain object serialization?

A serialized object represents the type of data stored in the object, its information. Object serialization is a process of reading or writing an entire object from a file. This helps in saving session state information by servlets, for sending parameters for Remote Method Invocation (RMI) calls.

12 :: Define STL, standard template library?

STL contains classes, algorithms, and iterators. It contains set of ready to use C++ classes that can be used with built in type and user defined operations. STL uses templates to achieve the results.

13 :: Why does COM need GUIDs?

A globally unique identifier (GUID) is used for unique IDs. No two GUIDs are the same no matter what computer they were generated on. The attribute clsid defines the GUID of the associated ActiveX control to use.

14 :: What is Globally Unique Identifier?

A 16-byte number generated by Microsoft programs that uniquely identifies a network or user or computer or document. It is one of the elements of information that can be passed when you connect to an Internet site, and it may be stored in cookies

15 :: What is object serialization?

A serialized object represents the type of data stored in the object, its information. Object serialization is a process of reading or writing an entire object from a file. This helps in saving session state information by servlets, for sending parameters for Remote Method Invocation (RMI) calls.

16 :: What is ActiveX?

ActiveX is a Microsoft rebranding of OLE with more focus on smart Windows controls.

17 :: What is OLE?

Object Linking and Embedding (OLE) is about using documents generated by one application inside another application.

18 :: What is STL, standard template library?

The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators; it provides many of the basic algorithms and data structures

The STL includes the classes vector, list, deque, set, multiset, map, multimap, hash_set, hash_multiset, hash_map, and hash_multimap.

19 :: What is IUnknown interface?

The IUnknown interface lets clients get pointers to other interfaces on a given object through the QueryInterface method, and manage the existence of the object through the IUnknown::AddRef and IUnknown::Release methods.

IUnknown methods can be used to switch between interfaces on an object, add references, and release objects.
You must implement IUnknown as part of every interface.

20 :: Do you know what is a type library?

A file or component within another file that contains standard descriptions of exposed objects, properties, and methods

A type library contains a binary description of an interface exposed by a COM-component. In this sense, they contain the same information that is contained in an IDL (Interface Definition Language) file..

21 :: Tell me how does COM provide language transparency?

COM defines an API to allow for the creation of components for use in integrating custom applications or to allow diverse components to interact.

But in order to interact, components must adhere to a binary structure specified by Microsoft.

As long as components adhere to this binary structure, components written in different languages can interoperate.

22 :: What is Component Object Model?

COM defines an API to allow for the creation of components for use in integrating custom applications or to allow diverse components to interact.

But in order to interact, components must adhere to a binary structure specified by Microsoft.

As long as components adhere to this binary structure, components written in different languages can interoperate.
C++ COM ActiveX Interview Questions and Answers
22 C++ COM ActiveX Interview Questions and Answers