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   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories >> Software >> Programming-Languages >> VC++ >> Win32API
 
 


 

Back to Questions Page
 
Question
In win32 application if defining a variable of CString then 
it gives the error "CString:Undeclared identifier" how to 
solve the problem? What headerfile need to include??
Rank Answer Posted By  
 Question Submitted By :: Bikash
I also faced this Question!!   © ALL Interview .com
Answer
Afaik CString is a MFC class. You cannot use it in win32 
application unless you set your application to use MFC 
libraries. To use MFC in win32 application, go to project 
settings and in general tab, set it to use MFC libraries in 
shared DLL. Then you can include MFC framework files like 
afxwin.h.
 
0
LastHope
 
 
Question
In Win32 application can we use CString datatype?
Rank Answer Posted By  
 Question Submitted By :: Bikash
I also faced this Question!!   © ALL Interview .com
Answer
Afaik CString is a MFC class. You cannot use it in win32 
application unless you set your application to use MFC 
libraries. To use MFC in win32 application, go to project 
settings and in general tab, set it to use MFC libraries in 
shared DLL. Then you can include MFC framework files like 
afxwin.h.
 
0
LastHope
 
 
Question
How to load Bitmap at Dialogbakground in an MFC application?
Rank Answer Posted By  
 Question Submitted By :: Satyagmk
This Interview Question Asked @   SunSoft-Technologies
I also faced this Question!!   © ALL Interview .com
Answer
In OnInitDialog:
-----------------
1. Create CBitmap from the bitmap.
2. Create a memory DC (CDC)
3. Put the CBitmap into the memory DC (Use 
CDC::SelectObject function).


In OnPaint:
------------
4. Get your dialog DC (CDialog::GetDC)
5. Do BitBlt or StretchBlt on dialog DC with memory DC as 
source DC (this will paint the bitmap on your dialog).
6. Release dialog DC (ReleaseDC function)
 
5
John K Gummadi
 
 
 
Question
What are the COM components
Rank Answer Posted By  
 Question Submitted By :: Satyagmk
This Interview Question Asked @   SunSoft-Technologies
I also faced this Question!!   © ALL Interview .com
Answer
http://forums.microsoft.com/MSDN/ShowPost.aspx?
PostID=721310&SiteID=1
 
0
Sds
 
 
Question
what are the design patterns of an MFC application
Rank Answer Posted By  
 Question Submitted By :: Satyagmk
This Interview Question Asked @   SunSoft-Technologies
I also faced this Question!!   © ALL Interview .com
Answer
It is MVC(Model View Controller)pattern
 
0
Samir
 
 
Question
what is the difference between MFC and Win32
Rank Answer Posted By  
 Question Submitted By :: Satyagmk
This Interview Question Asked @   Microsoft
I also faced this Question!!   © ALL Interview .com
Answer
Win32 is a set of Windows APIs written in C and MFC is a 
framework built arround Win32. All MFC functions internally 
use Win32 APIs. And MFC is written in C++.
 
4
John K Gummadi
 
 
Answer
MFC is a set of classes funtions and structures where win32 
is combination of functions and structures
 
0
Raj
 
 
Question
System call executable binary file into a process
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
WinExec()
 
0
Manish
 
 
Answer
But WinExec() is compatible with 16-bit Windows.
Applications should use the CreateProcess
function.http://msdn.microsoft.com/en-us/library/ms687393(VS.85).aspx
 
0
Nutan
 
 
Question
what API used to hide window
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
ShowWindow(hwnd, SW_HIDE); // to hide window
ShowWindow(hwnd, SW_SHOW); // to show window
 
0
Sanjay
 
 
Question
how to Initialize contents of a dialog?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
Using OnInitDialog API
 
0
Mahesh
 
 
Answer
In MFC, the contents of a dialog are initialized if they are
associated with their corresponding data members. This is
done through "UpdateData(FALSE)" function. The control data
is transferred to the data members through "UpdateData(TRUE)".

In WIN32, the dialog data in controls can be initialized
during WM_INITDIALOG call. The control data can be updated
to the dialog members using apppropriate "SendMessage"
functions.
 
2
Naviyr
 
 
Question
About GDI object?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
GDI object (is a graphical device object) used to write on a
device context for graphical output. 
GDI objects are: Pen, Brush, Font,Line, Rectangle etc.
These objects are created using their corresponding win32
function. For eg, CreatePen, CreatePenIndirect are used to
create a pen object.
After these objects are created they would need to be
selected to the device context before processing using
"SelectObject" function. 
GDI objects are not associated with any device context
during its creation. SelectObject function does that
assocaition.
Once an object is selected into the device context it would
be available until the object is destroyed through
DeleteObject or the program exits.
 
0
Naviyr
 
 
Answer
GDI(Graphical Device Interface)having the collection of 
Objects(pen,brush,cusror,bitmap..) thats are Interface to 
the Graphics. To handle Grahics Objects we are using the 
HDC (Handle Device Context)In Win32 API.for selecting the 
object we r using the SelectObject(HDC,Object) function. 
and after compleetion For Releasing Object we r  using 
ReleaseObject(HWND,HDC).
 
0
Ali Saida Shaik
 
 
Question
Message to limit the size of window
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
BOOL MoveWindow(
  HWND hWnd,      // handle to window
  int X,          // horizontal position
  int Y,          // vertical position
  int nWidth,     // width
  int nHeight,    // height
  BOOL bRepaint   // repaint option
);

This cud be used in the WM_PAINT event section and in 
WM_INITDIALOG section.
 
0
Jayendran G
 
 
Answer
WM_SIZE message is received by the window procedure when a
user resizes a window. In order to limite the size of a
window, you could handle the WM_SIZE message appropriately.
 
0
Naviyr
 
 
Answer
WM_SIZE message to an application is posted after the 
resizing operation, instead WM_SIZING should be handled and 
the lpRect member can be modified.
 
0
Somasundaram
 
 
Question
what is the function to repaint a window immediately?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
Invalidate() -- To repaint the entire client area
InvalidateRect() -- To repaint a specific portion of the 
client area.
 
0
Guest
 
 
Answer
InvalidateRect/Validate functions causes WM_PAINT message to
be placed in the windows message queue. On the other hand,
UpdateWindow will cause WM_PAINT message to be sent directly
to the window procedure for repaint activity.
 
0
Naviyr
 
 
Question
write About send message and post message
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
SendMessage is a blocking call.  ie., when a SendMessage() 
API is called from an application, the lines written after 
this API call cannot be executed until the message is 
processed and returned by the window procedure.

Whereas PostMessage() just posts the message into the 
windows corresponding message queue and returns immediately 
irrespective of the message is processed or not.
 
0
Karthikeyan
 
 
Answer
SendMessage is calling window proc and waiting for reply. 
where are PostMessage api is sending message in message 
queue and will not wait. Then message will be in Message 
queue till it will not be proceded by window proc.

In sort SendMessage waits till processing completion where 
as PostMessage does not wait.
 
0
Shah Chaitanya
 
 
Answer
Both are Win32 API members.

SendMessage(...) its NonQueued Messages. 


PostMessage(...) its Queued Messages.

SendMessage(...) Meassages can also be placed in a message 
queue by calling PostMessage(...).
 
0
Cheruku Raghu
 
 
Answer
send message doesn't follows message loop route.
while post massage follows.

examples of send message:WM_QUIT
examples of post message :WM_CLOSE,WM_COMMAND,...
 
0
Pooja
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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