|
|
|
|
|
|
|
Ans: Create a Windows application. Add a combo box on
form. Add code to Load event as shown below: Private Sub Form1_Load ( ByVal sender As System.Object, ByVal e As System.EventArgs ) Handles MyBase.Load Dim f( ) As FontFamily = FontFamily.Families ComboBox1.Items.Add ( l.GetName ( 0 ) ) Next End Sub |
||
|
|
|
|
|
Device registers have to be accessed with IN and OUT instructions. The IN instruction is used to read and the OUT instruction is used to write to the locations. It uses I/O address bus which comprises of only 16 bits of the entire address bus. The technique is only used for small sized data buffers. Data buffers is an array of device registers, i.e. if a device has only a few device registers it will prefer using I/O mapped technique. Accessing I/O mapped device registers however results into slower access. |
||
|
|
|
|
|
HBRUSH MyEdit :: CtlColor ( CDC* pDC, UINT nCtlColor ) if ( CWnd :: GetFocus( ) == this ) static CBrush mybrush ( RGB ( 255, 0, 0 ) ) ; } } Invalidate( ) ; } Invalidate( ) ; } Now add a member variable of MyEdit class to the dialog class of your dialog-based application. Also add an edit control on to the dialog template. To subclass this control add code to OnInitDialog( ) as shown below: BOOL CMyDlg :: OnInitDialog( ) m_edit.SubclassDlgItem ( IDC_EDIT1, this ) ; // Where m_edit is a variable of MyEdit } |
||
|
|
|
|
|
#include <iostream.h> public : void fun( ) cout << "fun of smart pointer" ; } } ; test t ; test* operator ->( ) return &t ; } } ; smartpointer sp ; } The beauty of overloading operator -> is that even though sp is an object, we can make it work like a pointer. The operator -> ( ) returns the address of the object of the type test. Using this the function fun( ) of the class test gets called. Thus even though fun( ) is not a member of smartpointer class, we can still call it using sp. |
||
|
|
|
|
|
#include <string.h> char str[] = "Good Morning" ; p = strpbrk ( p, "aeiou" ) ; c++ ; } break ; } } |
||
|
|
|
|
|
|
||
|
|
|
|
|
|
||