CapitolSoft Banner
To add a method to your RAD C++ control, you first need to invoke the "Add Method to C++ Control" dialog by clicking the right mouse button on the control tool button (in the RadVC toolbox) and then selecting "Add Method" context menu item:

CppCtrl_MethodDlg.jpg (27485 bytes)

For our "Circle" control, we will add a method called "void AboutBox()". When called, this method displays a simple textual message box.

When Clicked on the "OK" button in "Add Method" dialog, RadVC opens the control implementation file (circle.cpp) and highlights the "AboutBox" function..

void CCircle::AboutBox()
{

}

Now add the code to display a message box inside the function body as follows:

void CCircle::AboutBox()
{
    ::MessageBox(m_hWnd,
        _T("Circle RAD C++ Control\nCopyright(R), 2001"),
        _T("AboutBox"),
        MB_OK);
}

 

Next >> Part 8: Adding Resources to the Control

 

Related Links:

Control Development Kit (CDK) Home

 

 

Microsoft Visual C++, Microsoft Visual Basic and Microsoft Visual Studio are registered trademarks of Microsoft Corporation.
Copyright © 1998-2000 Capitolsoft Corporation. All rights reserved.
Disclaimer: Capitolsoft Corporation is an independent business organization incorporated with the State Commission of Virginia and hence has no connection with U.S. Capitol or any other federal agency of U.S. government. Opinions expressed by the individuals in this site are of their own alone and hence do not necessarily reflect the views of Capitolsoft Corporation.

 

This page was last updated on November 21, 2005
Hit Counter