Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the use of AFX_MANAGE_STATE ?

Answers were Sorted based on User's Feedback



what is the use of AFX_MANAGE_STATE ?..

Answer / yassar arafath.o.s

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 ?    21 Yes 4 No

what is the use of AFX_MANAGE_STATE ?..

Answer / rupesh bari

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 ?    10 Yes 2 No

what is the use of AFX_MANAGE_STATE ?..

Answer / debasis mahapatra

When mfc42.dll is loaded as part of a process, it stores
data in some truly global variables. If you call MFC
functions from an MFC program or extension DLL, mfc42.dll
knows how to set these global variables on behalf of the
calling process. If you call into mfc42.dll from a regular
MFC DLL, however, the global variables are not synchronized
and the effects will be unpredictable.
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

Is This Answer Correct ?    1 Yes 2 No

what is the use of AFX_MANAGE_STATE ?..

Answer / anonymous

None explains the question correctly.this is totally absurd
so kindly post the correct answer not wrong one damn

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More MFC Interview Questions

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

7 Answers   HP,


What interface must be supported by an ActiveX control?

2 Answers  


What is userdefine Messages in MFC?

1 Answers   HCL,


How we can findout Memoryleaks, In what way it can be avoided

6 Answers   Infosys,


1)To Remove WS_MINIMIZEBOX in a Frame ?

1 Answers  


1)why we cant create more than one instance of the class Derived from CWinApp

5 Answers   Alstom,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,


What are the special requirements for dialog box resources used in a form view?

2 Answers  


Which Macro is a Super set of other two macro DECLARE_SERIAL,DECLARE_DYNAMIC and DECLARE_DYNCREATE. ?

2 Answers   Sony,


what is the difference between SDI and MDI

15 Answers   CMC, HCL, Siemens,


What are the types of button controls?

10 Answers  


Does the application have more than one object? If no, then what is the reason?

5 Answers  


Categories