Doesn't ListView_InsertColumn work while handling WM_INITDIALOG?

I called ListView_InsertColumn to insert some columns to a listview while handling the WM_INITDIALOG message, but I couldn't see any columns in the listview, though the return value of ListView_InsertColumn was not -1.

However, it did work if I called that function while handling a button-clicked message.

Why? If that's the case, how can I initialize the listview?

I'm using Visual Studio 2010

Answers


It turns out that it's my oversight. During WM_INITDIALOG, I tried to use the global handle variable gDlg to get the handle of the listview. But the value of gDlg was only assigned by the return value of CreateDialog. I didn't know that WM_INITDIALOG actually occurs before CreateDialog returns;


Need Your Help

How to link Facebook to Iphone App using Xcode

xcode facebook xcode4.3 xcodebuild

I'm using version Xcode 4.3 . At this stage I have a very basic App, so I have no conflicting features of elements.

Range on integer fields in Axapta/Dynamics Ax

axapta x++

Is there a way, in Axapta/Dynamics Ax, to create an Extended Data Type of type integer which only allows enering values in a specified range (i.e., if the extended data type is meant for storing ye...