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   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  VC++  >>  MFC
 
 


 

 
 MFC interview questions  MFC Interview Questions
 ATL interview questions  ATL Interview Questions
 COM DCOM interview questions  COM DCOM Interview Questions
 Win32API interview questions  Win32API Interview Questions
 ActiveX interview questions  ActiveX Interview Questions
 VC++ AllOther interview questions  VC++ AllOther Interview Questions
Question
what is the use of AFX_MANAGE_STATE ?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the use of AFX_MANAGE_STATE ?
Answer
# 1
By default, MFC uses the resource handle of the main 
application to load the resource template.
If you have an exported function in a DLL, such as one that 
launches a dialog box in the DLL, this template is actually 
stored in the DLL module. You need to switch the module 
state for the correct handle to be used. You can do this by 
adding the following code to the beginning of the function:
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
This swaps the current module state with the state returned 
from AfxGetStaticModuleState until the end of the current 
scope.

If all your resources lies in the single DLL you can even 
change the default handle to the DLL handle with the help 
of AfxSetResourceHandle function
 
Is This Answer Correct ?    2 Yes 0 No
Yassar Arafath.o.s
 
  Re: what is the use of AFX_MANAGE_STATE ?
Answer
# 2
When building a regular DLL that dynamically links to MFC,
you need to use the macroAFX_MANAGE_STATE to switch the MFC
module state correctly. This is done by adding the following
line of code to the beginning of functions exported from the
DLL:

AFX_MANAGE_STATE(AfxGetStaticModuleState( ))

The AFX_MANAGE_STATE macro should not be used in regular
DLLs that statically link to MFC or in extension DLLs.
 
Is This Answer Correct ?    1 Yes 0 No
Rupesh Bari
 
 
 

 
 
 
Other MFC Interview Questions
 
  Question Asked @ Answers
 
Does the application have more than one object? If Yes, Briefly explain. Soltius-Infotech1
Which CPrintInfo member variable must be set for multiple page printouts?  1
Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer HP3
How can i change the color of a dropdowncombobox elements  1
What is the use of OninitDialog ? HCL7
what is the use of Mutex and critical section  2
Name the Synchronization objects?  2
What is the use of CCmdTarget ?  3
What is the use of UpdateData funciton ?  6
what is the size of a process E-Logic2
Psychic Window Technique E-Logic2
In VC++ How to transfer between one exe to another exe while running.. Wipro4
What interface must be supported by an ActiveX control?  1
What is the difference between the ASSERT and VERIFY macros?  3
How we can findout Memoryleaks, In what way it can be avoided Infosys4
What function is used to retrieve the currently selected index in a list box?  2
What is the difference between the SDI and MDI Invensys2
What is #progma and where it is used? L&T3
How many types of dialog box are their Honeywell4
What is the initial function to be called in MFC and what it will do Infosys5
 
For more MFC Interview Questions Click Here 
 
 
 
 
 
   
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