What could be wrong? Here is the code:
!include LogicLib.nsh
!include nsDialogs.nsh
Name nsDialogs
OutFile nsDialogs.exe
XPStyle on
Var Dialog
Var MyDir
Page custom nsDialogsPage
Page instfiles
Function nsDialogsPage
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateDirRequest} 0 0 100% 12u "Choose a directory"
Pop $MyDir
nsDialogs::Show
FunctionEnd
Section
DetailPrint "hello world"
SectionEnd