1. | How would you find the brushes or fonts used by the system to draw menus, dialog boxes and text? GetStockObjct |
2. | How would you start a new thread? Afxbeginthread – for worker thread only global fuction passed as parameter For ui thread , a class derived from CWinThread passed as parameter |
3. | When should an application call _beginthread rather than CreateThread? If apliation is using C run-time library (CRT) then. |
4. | How would you check if a process has terminated? GetexitCode() |
5. | Why would you use a critical section instead of a mutex? Are there any situations when a mutex would have to be used? Mutexes are slower thatn CS. If we want to synchronise two thread across different processes then |
6. | Name five IPC mechanisms supported by Window XP. What about Windows CE? |
7. | What is the difference between implicit and explicit loading of a dll? Static linking which loads automatically.- loaded throughout life of program Explicit – can use loadlibrary – take the fuction ptr use and unload library. |
8. | What is the Message Compiler and when would it be used? |
9. | How would you declare a string which could be used in an ANSI or UNICODE build? Which header would you include to support functions which could use either version of this string? Enclosed inside _T() macro for unicoade for ansi normal one (Without) |
10. | What are BSTRs and when are they used? They double byte strings used for COM. |
11. | What is the difference between a variable of type INT and a variable of type INT_PTR? One is the varialbe, another is pointer to some location |
12. | How would you determine the correct size of icons for fitting into a standard windows caption? |
13. | Why is it bad to call FindWindow based on a Window Title? |
14. | What is the difference between GetWindowRect and GetClientRect? How do you find the client rect of a child window inside another window relative to the parent? Window - It’s the size of window frame. Clients- working area. Get the handle to the child window. And call getclientrect |
15. | What form of Unicode encoding is standard on Windows? What other character encoding formats are you likely to encounter? |
16. | You find yourself drawing a string where letters appear as box characters on the screen. Why might this happen, and what would you do about it? What if the string contains characters from different code pages? It’s a different character set. |
17. | What interface do all COM classes implement and what is its purpose? Interface is the way of communicating with com. |
18. | What do you do if you have a pointer to a COM object implementing one interface but need to use another? |
19. | What is the difference between a SendMessage and a PostMessage? One sent to window never returns until handler is executed. Posted to message queue. Returns immediately Later on picked up and proccessed |
20. | Why do windows have class names and window names? It is registered to widows database to keep track of the activities. |
21. | We are building using a "Pocket PC 2003" SDK, for compatibility, but also running on "Mobile 5 Pocket PC" devices. On the |
22. | Describe the different approaches you can use to synchronise threads/processes in win32. 1. Critcal section – user for syncroinising threads from same process . Mutexes – user for syncroinising threads from different process . Semaphore – maintains resource counting against process use. |
23. | Describe the basics of the WNDPROC architecture. Its call back . having switch statement for proceeding messages. |
24. | What is a GUID and where is it used? Globally uniq id to identify a com distinctly. |
1 Introduction This paper describes the use of object-oriented software design patterns, as presented in Design Patterns: Elements of Reusable Object-Oriented Software by Gamma et al., within the Microsoft Foundation Class Library (MFC). MFC is used for implementing applications for Microsoft Windows operating systems. Because of the size of the MFC library, a complete analysis would have been beyond the scope of this assignment. Instead, we identified various possible locations for design patterns, using the class hierachy diagram of MFC, and studied the source carefully at these locations. When we did not find a pattern where we expected one, we have documented it anyway, with examples of how the particular problem could have been solved differently, perhaps more elegantly, using design patterns. We have included a brief introduction to MFC in Section 2 , as background information. The analysis has been split into three parts, with one section for each major design pattern ca...
Comments