+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

VC++ Interview Questions and Answers

1
Explain the important features of VC++.

Microsoft VC++ is a Microsoft product and used as an IDE (Integrated Development Environment).

It has tools for coding and debugging visual codes. The main features of this are:-

  1. Smart pointers
  2. New containers
  3. Expression parsing
  4. Polymorphism
  5. Exception Handling
  6. Garbage collection
2
What is the difference between SDI and MDI?

SDI is called as Single Document interface which is used to load only one document at a time, but it can have multiple views in the same window using splitter windows property. For example is a notepad in windows.

MDI is also called as Multiple Document Interface which has multiple child windows, each of have an individual document. For example Microsoft Word.

3
How to change the Mouse Pointer Over a Button at runtime?

Assuming that you have set the button's ID as IDC_BTNSAMPLE in the resource editor :-
// You have to handle the WM_SETCURSOR message handler to do that
BOOL CTestDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (pWnd == GetDlgItem(IDC_BTNSAMPLE))
{ // To load a standard cursor
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
// To load your own custom cursor. Assuming that you have created a
// Cursor in the resource editor and named it as IDC_CURSAMPLE
::SetCursor(AfxGetApp()->LoadCursor(MAKEINTRESOURCE(IDC_CURSAMPLE)));
// Remember to return TRUE here return TRUE;
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}

4
What is CMutex? How can we use it?

CMutex is a synchronization class which uses synchronization object named as mutex. It allows multiple program thread can share the same resource by taking turns. At the starting of the program it creates a mutex at beginning and then a system gives a unique ID or name for it. After that, any thread which needs the resource can use the mutex to lock the resource. For example access of a file. To use CMutex construct its object when it is needed to be accessed. Give the name of mutex and to the application will own it. You can access mutex when constructor returns again to the start. When you are done accessing the controlled resource then call CSyncObject::Unlock.

5
How can server communicate with more than one client?

Server can communicate with more than one client with using threading concepts there are java threads which are allocated to every client
when he logs in to server,the thread handles the client.

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US