ctharam


{ City } vizianagaram
< Country > india
* Profession * software engineer
User No # 101750
Total Questions Posted # 1
Total Answers Posted # 28

Total Answers Posted for My Questions # 2
Total Views for My Questions # 7239

Users Marked my Answers as Correct # 38
Users Marked my Answers as Wrong # 12
Questions / { ctharam }
Questions Answers Category Views Company eMail

1)dynamic creation of a Button ?

TCS,

2 MFC 7239




Answers / { ctharam }

Question { 16860 }

How to create a Modeless Dialog?


Answer

to create Modeless DialogBox as programming level is:

For Example:-

CModeLess *ModeLessDialogBox = new CModeLess();

ModeLessDialogBox->Create(null,IDB_DIALOG1);

ModeLessDialogBox->ShowWindow(SW_SHOW);

Is This Answer Correct ?    1 Yes 2 No

Question { 17546 }

What is the base class for MFC Framework ?


Answer

CObject is the root base class for most of the Microsoft Foundation Class Library (MFC).

The CObject class contains many useful features that

1) Serialization
2) Debugging
3) Dynamically create Objects
4) Compatibility with Collection Classes
5) Derive your class from CObject

Use the normal syntax to derive CTharam class from CObject

class CTharam : public CObject
{
// add CTharam-specific members and functions...
}

Is This Answer Correct ?    1 Yes 0 No


Question { 9764 }

Tell me about different kinds of synchranization objects ?


Answer

They are 4 kinds of synchronization objects in MFC.
1) Critical Section
2) Semaphore
3) Mutex
4) Event


MFC provides the following synchronization classes to protect shared resources.

1) CCriticalSection
2) CSemaphore
3) CMutex
4) CEvent

Is This Answer Correct ?    0 Yes 0 No

Question { 11431 }

What is CArchive class dowes?


Answer

CArchive does not have a base class.

Later you can load the objects from persistent storage, reconstituting them in memory. This process of making data persistent is called "serialization."

You can think of an archive object as a kind of binary stream. Like an input/output stream, an archive is associated with a file and permits the buffered writing and reading of data to and from storage. An input/output stream processes sequences of ASCII characters, but an archive processes binary object data in an efficient, nonredundant format.

You must create a CFile object before you can create a CArchive object.

Is This Answer Correct ?    0 Yes 0 No

Question { 15098 }

What is serialization ?which function is responsible for
serializing data ?


Answer

Serialization means conversion of Objects from bytes into streaming...and store those data in a External storage like Hard Disk.

Serialize is called by CArchive::ReadObject and CArchive::WriteObject.


Use CArchive::IsLoading or CArchive::IsStoring to determine whether the archive is loading or storing.

IsStoring():-
-------------

// example for CObject::Serialize
void CAge::Serialize( CArchive& ar )
{
CObject::Serialize( ar );
if( ar.IsStoring() )
ar << m_years;
else
ar >> m_years;
}


IsLoading() :-
---------------

int i;
extern CArchive ar;
if( ar.IsLoading() )
ar >> i;
else
ar << i;

Is This Answer Correct ?    0 Yes 0 No

Question { Nagarro, 34255 }

What is the use of OninitDialog ?


Answer

OnInitDialog() is a virtual function.It is called just
before the dialog box is displayed.It initializes the dialog
box controls.We can override this function in our derived
dialog class. By default , it returns TRUE

Ex:-

BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
m_cMyEdit.SetWindowText("My Name"); // Initialize control values
m_cMyList.ShowWindow(SW_HIDE); // Show or hide a control, etc.

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

Is This Answer Correct ?    1 Yes 0 No

Question { 13446 }

What function is used to disable a control at runtime?


Answer

practiced by me, which is a real time example.

EX:-
BOOL Csample_button_name_changeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Below Code, To Enable or Disable a button as runtime
CButton *pLogin1 = (CButton*)GetDlgItem(IDCANCEL);
pLogin1->SetWindowTextW(L"Reset");
pLogin1->EnableWindow(FALSE);

return TRUE;
}

Note:- pLogin1->EnableWindow(TRUE); // to enable a Cancel button

Is This Answer Correct ?    0 Yes 0 No

Question { 18488 }

What is the difference between the ASSERT and VERIFY macros?


Answer

ASSERT:-
--------
This function is available only in the Debug version of MFC.

Ctharam* tharamage = new Ctharam(21); //Ctharam is derived from CObject.
ASSERT(tharamage != NULL);
ASSERT(tharamage ->IsKindOf(RUNTIME_CLASS(Ctharam)));
// Terminates program only if tharamage is NOT a Ctharam*.


VERIFY:-
-------
1)
In the Debug version of MFC, evaluates its argument.

ex:- VERIFY(booleanExpression )

2)

In the Release version of MFC, VERIFY evaluates the expression

Ex:-
// get the display device context
HDC hdc;
VERIFY((hdc = ::GetDC(hwnd)) != NULL);

// give the display context back
::ReleaseDC(hwnd, hdc);

Is This Answer Correct ?    1 Yes 0 No

Question { Microsoft, 16396 }

Tell us something about MFC?


Answer

1)MFC means (M)icrosoft (F)oundation (C)lasses
2)which is a Framework for doing Dialog Based Applicationa and Web Based Application.
3)which is wrapper of Win32 API.
4)which is embedded with all kind of Hardware Devices.
5)re-use of coding.
6)which is having Dynamic DLLs.
7)it supports OOP concepts.

Is This Answer Correct ?    0 Yes 0 No

Question { 22670 }

What is the use of New Keyword


Answer

Objects can be created by using the new keyword followed by the name of the class that the object will be based on, like this:-
1) Customer object1 = new Customer();

NOTE:- When an instance of a class is created, a reference to the object is passed back to the programmer. In the previous example, object1 is a reference to an object that is based on Customer.

2) Customer object3 = new Customer();
Customer object4 = object3;

NOTE:- This code creates two object references that both refer to the same object. Therefore, any changes to the object made through object3 will be reflected in subsequent uses of object4. Because objects that are based on classes are referred to by reference, classes are known as reference types.

Is This Answer Correct ?    0 Yes 0 No

Question { Adea, 7707 }

What are object oriented concepts?


Answer

1) Class
2) Object
3) Encapsulation
4) Abstraction
5) Inheritance
6) Polymorphism
7) Message Passing
8) Dynamic Binding

Is This Answer Correct ?    0 Yes 0 No

Question { Kanbay, 9470 }

what are value types and reference types? where they are stored?


Answer

Data Type are 2 Kinds. they are 1) Value Data Type 2) Reference Data Type.

1) Value Data Types are stored in Stack Memory Location( bool,byte,char,decimal,double,enum,float,int,long,struct,short and uint)


2) Reference Data Type are stored in Heap Memory Location(Class,Object,Array,Interface,Delegate and Dynamic).

Is This Answer Correct ?    0 Yes 0 No

Question { 13395 }

wt is namespace? wt is the use?


Answer

namespace is showing about Hierarchy of all Classes in .Net Framework.

Is This Answer Correct ?    0 Yes 0 No

Question { 16686 }

Why not virtual functions to handle messages?


Answer

Virtual functions are not space-efficient because they require vtables, and vtables consume memory even if the functions in them are not overridden.

The amount of memory used by a message map, in contrast, is proportional to the number of message entries it contains.

Since it's extremely rare for a developer to implement a window class that includes handlers for all of the different types of messages, message mapping conserves a few hundred bytes of memory just about every time a CWnd is wrapped around an HWnd.

Is This Answer Correct ?    1 Yes 0 No

Question { HCL, 98938 }

what is the difference between SDI and MDI


Answer

SDI:-
1)(S)ingle (D)ocument (I)nterface
2)it can load only one document at a time
3)it has 4 kind of classes. they are CWinApp,CView,CDocument and CFramewnd
4)multiple view at same window
5)Notepad is an example

Where as in
MDI:-
1)(M)ultiple (D)ocument (I)nterface
2)it can load more than one document (0r) multiple documents at a time
3)it has 5 kind of classes.they are CChildWnd,CMDIChildWnd,CView,CDocument and CframeWnd
4)multiple views in different windows
5)MS -Word Document is an Example

Is This Answer Correct ?    22 Yes 1 No

 [1]   2    Next