Click here to Skip to main content
15,867,686 members
Articles / Desktop Programming / MFC
Article

CPPDumpCtrl - version 1.2

Rate me:
Please Sign up or sign in to vote.
4.88/5 (29 votes)
19 Aug 2002CPOL20 min read 194.6K   6.5K   132   58
Class for view and edit data in Hex, Dec, Bin, Oct, Ascii formats

Sample Image - dumpctrl.gif

Contents

Introduction

CPPDumpCtrl is a Dump Control based on MFC and the CWnd class. It implements basic behavior to edit/view Data in HEX, DEC, BIN, OCT and/or ASCII view.

How to integrate CPPDumpCtrl in your application

To use the PPDumpCtrl control in your project you will need to add a number of files to your project:

  • PPDumpCtrl.h
  • PPDumpCtrl.cpp
  • PPNumEdit.h
  • PPNumEdit.cpp
  • memdc.h // Keith Rule's memory DC helper class.

Where PPDumpCtrl.* is a main CPPDumpCtrl control source and header files, and PPNumEdit.* is a CPPNumEdit control files (class for in-place editing).

Create a CPPDumpCtrl object

Include file PPDumpCtrl.h in the header file where will be use the CPPDumpCtrl control

In your application, create a member variable for the control. Please note that this variable is a pointer:

CPPDumpCtrl* m_hex_ctrl;

Now create the control. For dialog-based applications, in your OnInitDialog:

// Call the base-class method
CDialog::OnInitDialog();<BR>
// Create the CPPDumpCtrl object
m_hex_ctrl = new CPPDumpCtrl;
m_hex_ctrl->Create(CRect(0, 0, 100, 100), this, 100);

Remember to destroy the control or you will get a memory leak. This can be done, for example, in your class destructor:

if (m_hex_ctrl)
    delete m_hex_ctrl;

Initialize CPPDumpCtrl object

For initialize CPPDumpCtrol in your OnInitDialog add following lines:

//Attach the Data Arrays to the CPPDumpCtrl object
m_dump_ctrl.SetPointerData(256, nNewData, nOldData, FALSE); <BR>                                      //where nNewData and nOldData is a 
                                      //pointer to the arrays with data for 
                                      //dumping, and 256 - length of the arrays

Also you can set styles, fonts and colors here

Class Members

Construction

 
CPPDumpCtrlConstructs a CPPDumpCtrl object.
CreateConstructs a CPPDumpCtrl object.

 

Initialization

 
SetPointerDataSets the pointers to data arrays and sets the length of data arrays
SetOffsetViewAddressSets offset for viewing address

 

Appearance

 
SetDefaultStylesSets the styles in default value
SetStylesSets the styles
ModifyStylesChanges the style of a control
GetStylesRetrieves information about the control styles
SetReadOnlySets data for read only
IsReadOnlyChecks may be data changed or not
SetSpecialCharViewSets the character which will drawn instead special characters (code: 0 - 31)

 

Color Functions

 
SetDefaultColorsSets the control colors to the default colors.
SetColorSpecifies the color to use for the control.
GetColorRetrieves the color for the control.

 

Notification

 
SetNotifyEnable notification about changing the data or the view.
GetNotifyIs enabled notification about changing the data or the view..

 

Font Functions

 
SetDefaultFontSets the control font to the default value (Courier, 8pt.).
SetFontSpecifies the font for the control.

 

Miscellaneous Functions

 
SetBeginAddressSets first visible address in the control
GetBeginAddressGets current visible address from the control
SetTrackMouseMoveThis function enables or disables the track mouse.
IsTrackMouseMoveThis function returns whether the track mouse is enabled

 

Selection Functions

 
SetSelectRangeSets the range of the selected block
GetSelectRangeGets the range of the selected block.
IsAddressSelectedWhether checks there is a specified address in the range of the selection
EnableSelectEnable to select data range
IsEnableSelectChecks may be data selected or not

 

Menu Functions

 
SetMenuAssociates a menu to the control.

 

ToolTip Functions

 
SetTooltipTextThis function sets the format string of the text to show in the control tooltip.
ActivateTooltipThis function enables or disables the button tooltip
GetTooltipThis function gets pointer to the tooltip object

 

CPPDumpCtrl::CPPDumpCtrl

PPDumpCtrl ();

Remarks
Constructs a CPPDumpCtrl object. The control styles, font and colors is initially set to default values (see SetDefaultStyles, SetDefaultFont and SetDefaultColors).

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::Create

BOOL Create(const RECT& rect, CWnd* pParentWnd, UINT nID, DWORD dwStyle = WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE);

Parameters

  • rect - The size and position of the window, in client coordinates of pParentWnd.
  • pParentWnd - The parent window.
  • nID - The ID of the child window.
  • dwStyle - Specifies the window style attributes.

Return Value

Nonzero if successful; otherwise 0.

Remarks
Creates and initializes the child window associated with the CPPDumpCtrl object.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetPointerData

void SetPointerData (DWORD nLength, LPBYTE pNewData, LPBYTE pOldData /* = NULL */, BOOL bRedraw /* = TRUE */)

Parameters

  • nLength - Length of data arrays
  • pNewData - The pointer to the array with new data.
  • pOldData - The pointer to the array with old data. If pOldData is NULL then the pointer to the array with old data will be same as the pointer to new data array.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets the pointers to data arrays and sets the length of data arrays.

Example:

BYTE nNewData [1000];
BYTE nOldData [1000];

//Filling the arrays
...

m_dump_ctrl.SetPointerData(1000, nNewData, nOldData);

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetOffsetViewAddress

void SetOffsetViewAddress (DWORD nAddress /* = 0 */, BOOL bRedraw /* = TRUE */)

Parameters

  • nAddress - The offset value for viewing address. For example, viewing address on screen start with 0 always. But if you have specified the offset address then viewing address will be start from it value.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets offset for viewing address

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetDefaultStyles

void SetDefaultStyles (BOOL bRedraw /* = TRUE */)

Parameters

  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets all styles to a default value. The function set following styles to control:

PPDUMP_FIELD_ADDRESS
PPDUMP_FIELD_HEX
PPDUMP_FIELD_ASCII
PPDUMP_BAR_ADDRESS
PPDUMP_BAR_DEC
PPDUMP_BAR_HEX
PPDUMP_BAR_BIN
PPDUMP_BAR_ASCII

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetStyles

void SetStyles (DWORD nStyle, BOOL bRedraw /* = TRUE */)

Parameters

  • nStyle - The new styles of the control.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

The function set the new styles for control

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::ModifyStyles

void ModifyStyles (DWORD nAddStyle, DWORD nRemoveStyle, BOOL bRedraw /* = TRUE */)

Parameters

  • nAddStyle - Added styles.
  • nRemoveStyle - Removed styles.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

The function modifies styles of the control

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetStyles

DWORD GetStyles ()

Return value

The current styles of the control.

Remarks

The function returns the current styles of the control

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetReadOnly

void SetReadOnly(BOOL bReadOnly /* = TRUE */)

Parameters

  • bReadOnly - Specifies whether to set or remove the read-only state of the control. A value of TRUE sets the state to read-only; a value of FALSE sets the state to read/write.

Remarks

This method sets the read-only state of an control.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::IsReadOnly

BOOL IsReadOnly()

Return value

TRUE if the control is read-only.

Remarks

Call this member function to determine if the control is read-only. User can view the data, but cannot change it.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetDefaultColors

void SetDefaultColors(BOOL bRedraw /* = TRUE */)

Parameters

  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Use this function to reset the control colors to their default values.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetColor

COLORREF SetColor(int nIndex, COLORREF crColor, BOOL bRedraw /* = TRUE */)

Parameters

  • nIndex - Specifies the color to be set. This is one of the color values defined in the color enumeration
  • crColor - A COLORREF value specifying the color to set
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Return value

The function returns previous color.

Remarks

Sets the color specified the nIndex.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetColor

COLORREF GetColor(int nIndex)

Parameters

  • nIndex - Specifies the color to be retrieved. This is one of the color values defined in the color enumeration

Return value

A pointer to a COLORREF value to be receive the requested color value

Remarks

The function return the color for the specified by index.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetNotify

void SetNotify(BOOL bNotify = TRUE)
void SetNotify(HWND hWnd)

Parameters

  • bNotify - If TRUE the control will be send the notification to parent window. Else the notification will not send
  • hWnd - If non-NULL the control will be send the notification to specified window. Else the notification will not send

Remarks

This function sets or removes the notification messages from the control.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetNotify

BOOL GetNotify()

Return value

TRUE if the control will be notified the specified window.

Remarks

This function determines will be send the notification messages from the control or not.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetDefaultFont

void SetDefaultFont(BOOL bRedraw /* = TRUE */)

Parameters

  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets the font to the default value (Courier, 8pt)

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetFont

BOOL SetFont(CFont & font, BOOL bRedraw /* = TRUE */)
BOOL SetFont(LOGFONT & lf, BOOL bRedraw /* = TRUE */)
BOOL SetFont(LPCTSTR lpszFaceName, int nSizePoints /* = 8 */, BOOL bUnderline /* = FALSE */, BOOL bBold /* = FALSE */,<BR>             BOOL bStrikeOut /* = FALSE */, BOOL bItalic /* = FALSE */,<BR>             BOOL bRedraw /* = TRUE */)

Parameters

  • font - A CFont object allowing full control over the appearance of the font.
  • lf - A LOGFONT structure allowing full control over the appearance of the font also.
  • lpszFaceName - The font face name.
  • nSizePoints - The font size in points. The default value is 8.
  • bUnderline - Specifies whether the font is to be underlined. A nonzero value sets the font to be underlined. A 0 value sets the font not to be underlined. The font is not underlined by default.
  • bBold - Specifies whether the font weight is to be bold or not. A nonzero value sets the font to be bold. A 0 value sets the font weight to be normal. The font weight is normal by default.
  • bStrikeOut - Specifies whether the font is to be struck out or not. A nonzero value sets the font to be struck out. A 0 value sets the font not to be struck out. The font is not struck out by default.
  • bItalic - Specifies whether the font style is to be italic or not. A nonzero value sets the font style to be italic. A 0 value sets the font style to be normal. The font style is normal by default.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets the font for all elements of the control

Attention! You must set the font with fixed width (for example: Courier)

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetBeginAddress

void SetBeginAddress(int nAddress = 0, BOOL bRedraw = TRUE)

Parameters

  • nAddress - The address which will be the first address on the screen.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets the first visible address on the screen

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetBeginAddress

int GetBeginAddress()

Return value

The function retrives the first visible address on the screen.

Remarks

Gets the first visible address on the screen

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetTrackMouseMove

void SetTrackMouseMove(BOOL bTrack = TRUE, BOOL bRedraw = TRUE)

Parameters

  • bTrack - If TRUE the track mouse will enable.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

This function enables or disables the track mouse.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::IsTrackMouseMove

int IsTrackMouseMove()

Return value

Function returns TRUE if track mouse is enabled.

Remarks

This function returns whether the track mouse is enabled.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetSelectRange

void SetSelectRange (int nBegin = 0, int nEnd = -1, BOOL bVisible = TRUE)

Parameters

  • nBegin - The address which will be the first selected address.
  • nEnd - The address which will be the end selected address. If nEnd is -1 then the end selected address will be equal with begin selected address.
  • bVisible - Specifies whether the control is to be redrawn so that first address has been seen. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

Sets the range of the selected block.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetSelectRange

void GetSelectRange (LPINT nBegin, LPINT nEnd)

Return values

  • nBegin - The address which will be the first selected address.
  • nEnd - The address which will be the end selected address.

Remarks

Gets the range of the selected block.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::IsAddressSelected

BOOL IsAddressSelected (int nAddress)

Parameters

  • nAddress - The address which will be tested.

Return value

The function returns TRUE if nAddress into the range of selected block. Else FALSE

Remarks

Whether checks there is a specified address in the range of the selection

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::EnableSelect

void EnableSelect(BOOL bEnable /* = TRUE */)

Parameters

  • bEnable - If TRUE then user can select the block of the data.

Remarks

Calls the function for enable select the data or disable it.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::IsEnableSelect

BOOL IsEnableSelect()

Return value

TRUE if user can select the block of the data.

Remarks

Determines can user select the data or not.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetSpecialCharView

void SetSpecialCharView(TCHAR chSymbol = NULL, BOOL bRedraw = TRUE)

Parameters

  • chSymbol - the character which will draw instead the special characters (0 - 31). If NULL the symbol will not changed.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default..

Remarks

Sets the character which will drawn instead special characters (0 - 31).

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetMenu

BOOL SetMenu(UINT nMenu, BOOL bRedraw = TRUE)

Parameters

  • nMenu - ID number of the menu resource. Pass NULL to remove any menu from the control.
  • bRedraw - Specifies whether the control is to be redrawn. A nonzero value redraws the control. A 0 value does not redraw the control. The control is redrawn by default.

Remarks

This function associates a menu to the control. The menu will be displayed clicking the data in the control.

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::SetTooltipText

void SetTooltipText(int nText, BOOL bActivate)
void SetTooltipText(CString sFormatTip, BOOL bActivate)

Parameters

  • nText - ID number of the string resource containing the format string of the text to show.
  • sFormatTip - Pointer to a null-terminated string containing the format string of the text to show.
  • bActivate - If TRUE the tooltip will be created active.

Remarks

This function sets the format string of the text to show in the control tooltip.

Format string

The Format string can contain the any text, and also special symbols of substitution of the data.

Special symbols must be the following format:

<code>%</CODE> [<CODE>direction</CODE>] [<CODE>length</CODE>] [<CODE>type</CODE>]
  • direction - specifies the order of an arrangement the multi bytes data
    • blank - the order corresponds specified in style of the control (PPDUMP_DATA_LOW_HIGH)
    • '+' - the order from the high byte to the low byte
    • '-' - the order from the low byte to the high byte
  • length - specified how much byte in the alone data (0 - 4) or blank. Where 0 or blank then use default length specified in style (PPDUMP_WORD_DATA = 2 byte or ~PPDUMP_WORD_DATA = 1 byte).
  • type - specified the type of the format:
    • 'R' - hex address
    • 'H' - hex data
    • 'D' - dec data
    • 'B' - bin data
    • 'O' - oct data
    • 'A' - ascii data
    • 'n' - carriage return + line feed (equivalently "\r\n")
    • 't' - tabulation. The tooltip doesn't support tab symbol. Therefore tab have the program emulation (4 characters). This feature well works with the established font for tooltip with identical width of symbols.

Example:

CString str = _T("Address : %RH Hex : %2H"); //Format string
m_hex_ctrl.SetTooltipText(str); //Sets format string

The result on the client area of the control:

Image 2

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::ActivateTooltip

void ActivateTooltip(BOOL bActivate = TRUE)

Parameters

  • bActivate - If TRUE the tooltip will be activated.

Remarks

This function enables or disables the control tooltip..

CPPDumpCtrl Overview | Class Members | Styles

 

CPPDumpCtrl::GetTooltip()

CToolTipCtrl * GetTooltip()

Return value

The pointer to the tooltip object.

Remarks

This function gets pointer to the tooltip object

CPPDumpCtrl Overview | Class Members | Styles

 

 

Styles and Color Index

The Control's styles:

Fields of the data

 
PPDUMP_FIELD_ADDRESS The address field of data is exist
PPDUMP_FIELD_HEXThe hex field of data is exist
PPDUMP_FIELD_DEC The dec field of data is exist
PPDUMP_FIELD_BINThe bin field of data is exist
PPDUMP_FIELD_OCTThe oct field of data is exist
PPDUMP_FIELD_ASCIIThe ascii field of data is exist

PPDUMP_FIELD_ALL
All fields of data is exist

 

Fields of the control bar

 
PPDUMP_BAR_ADDRESSThe address field of control bar is exist
PPDUMP_BAR_HEXThe hex field of control bar is exist
PPDUMP_BAR_DECThe dec field of control bar is exist
PPDUMP_BAR_BINThe bin field of control bar is exist
PPDUMP_BAR_OCTThe oct field of control bar is exist
PPDUMP_BAR_ASCIIThe ascii field of control bar is exist

PPDUMP_BAR_ALL 
All fields of control bar is exist

 

Miscellaneous

 
PPDUMP_SEPARATOR_LINESDraws the separators between the fileds of data
PPDUMP_READ_ONLYThe control for read only (The address field can be change all the same)
PPDUMP_WORD_DATAWork with word data, else with byte
PPDUMP_NAMED_FIELDSDraws the headers of the data fileds
PPDUMP_SELECT_DATAUser can select the range of the data
PPDUMP_DATA_LOW_HIGHUser can select the order of the multi-byte data . If it flag is set then first byte is a low byte, else high byte
PPDUMP_TRACK_MOUSE_MOVEUser can select the order of the multi-byte data . If it flag is set then first byte is a low byte, else high byte

 

Color Enumeration :

for data

 
PPDUMP_COLOR_DATA_FGThe foreground color of the equal data in nNewArray and nOldArray
PPDUMP_COLOR_DATA_CHANGE_FGThe foreground color of the different data in nNewArray and nOldArray
PPDUMP_COLOR_DATA_BKThe background color of the data

 

for in-place edit

 
PPDUMP_COLOR_EDIT_FGThe foreground color of the editing data without error
PPDUMP_COLOR_EDIT_BKThe background color of the editing data without error
PPDUMP_COLOR_EDIT_ERR_FGThe foreground color of the editing data with error
PPDUMP_COLOR_EDIT_ERR_BKThe background color of the editing data with error

 

miscellaneous

 
PPDUMP_COLOR_ADDRESS_FGThe foreground color of the address field
PPDUMP_COLOR_CARET_BKThe background color of the data under the caret
PPDUMP_COLOR_TEXT_HEADERThe foreground color of the header
PPDUMP_COLOR_SEPARATORSThe color of the separator lines
PPDUMP_COLOR_MOUSE_TRACKThe color of track rectangle mouse

 

Messages

The control has the three messages. First two transfer the following structure as parameter:

typedef struct tagNM_PPDUMP_CTRL {
NMHDR hdr;
int  iAddress; //The editing or beginig address (excepting the offset address)
UINT iValue;   //The changed value (for UDM_PPDUMPCTRL_CHANGE_DATA message only)
} NM_PPDUMP_CTRL; 

UDM_PPDUMPCTRL_BEGIN_ADDR - User has changed first address on the screen. New address was passed as parameter iAddress. The iValue member has no value.

UDM_PPDUMPCTRL_CHANGE_DATA - Sends to parent window when user tries to change value at any address. The address passes as parameter iAddress, and new value passes as parameter iValue. The control doesn't change data directly. It just notifies the parent on necessity of change. The parent should change data and redraw control itself.

Here example:

Add to the header file.

afx_msg void NotifyEditData(NMHDR * pNMHDR, LRESULT * result);

To the implement file.

ON_NOTIFY (UDM_PPDUMPCTRL_CHANGE_DATA, IDC_EDIT1, NotifyEditData)
and
void CParentDlg::NotifyEditData(NMHDR * pNMHDR, LRESULT * result)

{
    *result = 0;


    //Gets pointers to structure NM_PPDUMP_CTRL
	   NM_PPDUMP_CTRL * pNotify = (NM_PPDUMP_CTRL*)pNMHDR

    //Really changing data ...
    SetNewValueData(pNotify->iAddress, pNotify->iValue);

    //Redraw the control
    m_dump_ctrl.RedrawWindow();
}

Third message UDM_PPDUMPCTRL_MENU_CALLBACK sends to window when the user tries to display the menu. This message transfer the following structure as parameter:

typedef struct tagNM_PPDUMP_MENU {
NMHDR hdr;
HMENU nMenu;    //Handle to the menu
int   iArea;    //The area of the field data under the mouse
int   iAddress; //The address (excepting the offset address) under the mouse
} NM_PPDUMP_MENU; 

Fourth message UDM_PPDUMPCTRL_SELECTION sends to window when the user finished selecting of the data. It isn't sends else selection is disabled or selection equal to alone data. This message transfer the following structure as parameter:

typedef struct tagNM_PPDUMP_SEL {
NMHDR hdr;
int   iFirstAddr; //The first address of the selection
int   iLastAddr;  //The last address of the selection
} NM_PPDUMP_SEL; 

Hotkeys

This control has following hotkeys

In view mode (without editing data)

HotkeyDescription
Moving of the caret
LEFTThe caret moves on one address backward
RIGHTThe caret moves on one address forward
UPThe caret moves on one line up
DOWNThe caret moves on one line down
HOMEThe caret moves to the beginning of a line
ENDThe caret moves to the end of a line
CTRL+HOMEThe caret moves to first address
CTRL+ENDThe caret moves to end address
PAGE UPThe caret moves on one screen up
PAGE DOWNThe caret moves on one screen down
The beginning of editing ...
CTRL+Has HEX, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Das DEC, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Bas BIN, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Oas OCT, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Aas ASCII, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
ENTERin first field of the data

In editing mode

HotkeyDescription
Moving of the caret
CTRL+LEFTThe edit moves on one address backward
CTRL+RIGHTThe edit moves on one address forward
CTRL+UPThe edit moves on one line up
CTRL+DOWNThe edit moves on one line down
CTRL+HOMEThe edit moves to the beginning of a line
CTRL+ENDThe edit moves to the end of a line
PAGE UPThe edit moves on one screen up
PAGE DOWNThe edit moves on one screen down
Continuation of editing ...
CTRL+Has HEX, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Das DEC, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Bas BIN, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Oas OCT, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
CTRL+Aas ASCII, if the field is exist in the control bar and not set PPDUMP_READ_ONLY style
TABto the next field
SHIFT+TABto the previous field
End of editing
ENTEROK
ESCCancel

History

07 Aug 2002First release
13 Aug 2002Release version 1.1
- Added new style PPDUMP_DATA_LOW_HIGH
- Added support tootip
- Added new message UDM_PPDUMPCTRL_SELECTION and structure NM_DUMP_SEL
- Added support mouse wheel (Thanks to Darren Schroeder)
- Fixed problem with large arrays (Thanks to Bill Morrison - Rosinante Software)
- Other minor fixed
19 Aug 2002

Release version 1.2
- Added new formating chars to the format string of the tooltip text
- Added function SetSpecialCharView and GetTooltip
- Two functions SetTrackMouseMove, IsTrackMouseMove and new style PPDUMP_TRACK_MOUSE_MOVE
- Fixed Leak memory with GetDC()
- NOW the control based on CWnd instead CEdit
- NOW the control can create statically and dinamically

Thanks to ...

  • Yaroslav Petrikevich and Andrey Moiseyev for their ideas on the features of the control.
  • Davide Calabro for his class CButtonST in which decisions of some questions have been found.
  • Chris Maunder for his articles devoted subclassing of the control.
  • Keith Rule for his class CMemDC.
  • Tomasz Sowinski for his help with Tooltip.
  • Many people assisting to me the answers on CodeProject's forum.

 

Known Problems

  • If you can help me, please let me know so that I can incorporate them into the next release.

 

Planned Enhancements

  • If you have any other suggested improvements, please let me know so that I can incorporate them into the next release.

 

Contacting the Author

Please send any comments or bug reports to me via email.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer SvyazInvest
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Bigger files support Pin
Anonymous11-Aug-04 2:30
Anonymous11-Aug-04 2:30 
QuestionHow to use as an hex editor? Pin
Eldad2-Sep-02 21:40
Eldad2-Sep-02 21:40 
AnswerRe: How to use as an hex editor? Pin
Eugene Pustovoyt3-Sep-02 7:53
Eugene Pustovoyt3-Sep-02 7:53 
Generalok - i'm a liar.. here's something else Pin
Darren Schroeder19-Aug-02 11:35
Darren Schroeder19-Aug-02 11:35 
GeneralRe: ok - i'm a liar.. here's something else Pin
Eugene Pustovoyt19-Aug-02 18:23
Eugene Pustovoyt19-Aug-02 18:23 
GeneralOne more thing.... Pin
Darren Schroeder19-Aug-02 11:22
Darren Schroeder19-Aug-02 11:22 
GeneralRe: One more thing.... Pin
Eugene Pustovoyt19-Aug-02 18:31
Eugene Pustovoyt19-Aug-02 18:31 
GeneralRe: One more thing.... Pin
Eugene Pustovoyt20-Aug-02 18:20
Eugene Pustovoyt20-Aug-02 18:20 
Add the follow lines to the OnPaint() function in the PPDumpCtrl.cpp.

OMG | :OMG: SCROLLINFO si;
si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
si.nMin = 0;
si.nMax = nPagesData;
si.nPos = nPagesData ? (m_nBeginAddress / m_nDataInLines) : 0;
si.nPage = 1;
m_pVScroll.SetScrollInfo(&si, FALSE);

instead

m_pVScroll.SetScrollRange(0, nPagesData, FALSE);
m_pVScroll.SetScrollPos(nPagesData ? (m_nBeginAddress / m_nDataInLines) : 0, FALSE);



Best regards,
Eugene Pustovoyt
QuestionUnicode support? Pin
Dirk Vandenheuvel19-Aug-02 5:02
Dirk Vandenheuvel19-Aug-02 5:02 
AnswerRe: Unicode support? Pin
Eugene Pustovoyt19-Aug-02 6:41
Eugene Pustovoyt19-Aug-02 6:41 
GeneralRe: Unicode support? Pin
Dirk Vandenheuvel23-Aug-02 0:03
Dirk Vandenheuvel23-Aug-02 0:03 
GeneralRe: Unicode support? Pin
Eugene Pustovoyt23-Aug-02 7:37
Eugene Pustovoyt23-Aug-02 7:37 
GeneralRe: Unicode support? Pin
Eugene Pustovoyt6-Sep-02 22:15
Eugene Pustovoyt6-Sep-02 22:15 
Generalnit pick question Pin
Darren Schroeder14-Aug-02 15:26
Darren Schroeder14-Aug-02 15:26 
GeneralRe: nit pick question Pin
Eugene Pustovoyt14-Aug-02 18:06
Eugene Pustovoyt14-Aug-02 18:06 
GeneralAddress Field issues Pin
Rosinante12-Aug-02 5:38
Rosinante12-Aug-02 5:38 
GeneralRe: Address Field issues Pin
Eugene Pustovoyt12-Aug-02 7:13
Eugene Pustovoyt12-Aug-02 7:13 
GeneralRe: Address Field issues Pin
Rosinante12-Aug-02 7:47
Rosinante12-Aug-02 7:47 
QuestionMousewheel anyone? Pin
Darren Schroeder11-Aug-02 14:21
Darren Schroeder11-Aug-02 14:21 
AnswerRe: Mousewheel anyone? Pin
Eugene Pustovoyt11-Aug-02 18:08
Eugene Pustovoyt11-Aug-02 18:08 
GeneralRe: Mousewheel anyone? Pin
Darren Schroeder12-Aug-02 1:55
Darren Schroeder12-Aug-02 1:55 
GeneralRe: Mousewheel anyone? Pin
Eugene Pustovoyt12-Aug-02 4:36
Eugene Pustovoyt12-Aug-02 4:36 
GeneralImplementation of PPDumpCtrl in a CView Pin
javelot11-Aug-02 9:51
javelot11-Aug-02 9:51 
GeneralRe: Implementation of PPDumpCtrl in a CView Pin
Darren Schroeder11-Aug-02 14:25
Darren Schroeder11-Aug-02 14:25 
GeneralRe: Implementation of PPDumpCtrl in a CView Pin
Eugene Pustovoyt11-Aug-02 18:02
Eugene Pustovoyt11-Aug-02 18:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.