MFC Tips

For last two month I’m really busy in the world of virtualization,so unable to write any meaningful here. But lately  one of my student had some issues in MFC, so sharing those tips with you all


1. Deleting Columns in List Control

One of the things that sound simple but when you use the conventional way of removing the columns from the list it doesn’t work. The answer is provided by

Microsoft KB Article


2. Clicking on the Tree Control

When you click on the Tree Control and select item, the GetSelectedItem method return the previously selected item handle.

The solution was to use the following line in the message map

ON_NOTIFY(TVN_SELCHANGED, <Tree Control Id>, <methodName>)

instead of

ON_NOTIFY(NM_CLICK, <Tree Control Id>, <methodName>)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: