Inplace editor is NULL


We want to assign properties to the inplace editor, and following the example in the Developers Guide, put the code in the OnGetEditorType event handler.   However, I'm getting an access violation because the inplace editor hasn't always been created:
//from my code
      } else {
         AEditor = edNormal;
         mainGrid2->NormalEdit->PopupMenu = PopupMenu1;   //CRASH, NormalEdit is NULL
Interestingly, BtnEdit isn't NULL when we come through here on a different branch.
According to the Dev Guide, the inplace editor isn't created until it is actually used.  But if that's true, the example of setting spin editors in the Dev Guide couldn't work.   Is there something about NormalEdit that is different?    Do need to put in a workaround by using PostMessage() at this point to assign the property a little later?
Richard U

Set the properties of the inplace editor from the OnGetEditorProp. In this event, the inplace editor instance will always be created.

It isn't working.  When I click in a cell for which I had assigned AEditor = edNormal in OnGetEditorType, then when I get to OnGetEditorProp, both TEditLink* AEditLink (input argument) and mainGrid->NormalEdit are NULL. 

Correction to the above!  AEditLink was NULL, but not mainGrid->NormalEdit.    I had found that setting properties using BtnEdit didn't seem to work, so I switched to AEditLink to TGridEditBtn, which did work. 

So, it is working now, if I accept the mystery that I use mainGrid->NormalEdit for the default editor, but I use (TGridEditBtn*) (AEditLink->GetEditControl()) for the button editor.