I use the code bellow to display the dialog explorer!
I did not put all the code but only the main parts!

the problem is that in my form (show in modal mode) i click on a button and use the OpenFile function.
But the dialog box is not display in modal, then i can click several times on the button and then have a lot of dialog at the screen.
Does any one have an idea to prevent this.
Thanks!

'in the class

Private filestruct As OPENFILENAME

' Window handle of parent
Public Property Let parentHwnd(ByVal value As Long)
filestruct.hwndOwner = value
End Property

' Prepare struct for open and save
Private Sub PrepareStruct()
Dim i As Long
filestruct.lStructSize = Len(filestruct)
filestruct.hInstance = app.hInstance
filestruct.lpstrCustomFilter = vbNullString
filestruct.nMaxCustFilter = 0
filestruct.nFilterIndex = 1
filestruct.lpstrFileTitle = vbNullString
filestruct.nFileOffset = 0
filestruct.nFileExtension = 0
filestruct.lCustData = 0
filestruct.lpfnHook = 0
filestruct.lpTemplateName = vbNullString
filestruct.lpstrFile = left(filestruct.lpstrFile + String(256, Chr(0)), 256)
filestruct.nMaxFile = 255
filestruct.nMaxFileTitle = 0
For i = 1 To Len(filestruct.lpstrFilter)
If Mid(filestruct.lpstrFilter, i, 1) = "|" Then
Mid(filestruct.lpstrFilter, i, 1) = Chr$(0)
End If
Next i
End Sub

' Open a file
Public Function OpenFile() As String
Dim i As Long
PrepareStruct
SetFlag OFN_FILEMUSTEXIST
SetFlag OFN_PATHMUSTEXIST
SetFlag OFN_NOTESTFILECREATE
SetFlag OFN_LONGNAMES
If GetOpenFileName(filestruct) = 0 Then
OpenFile = ""
Exit Function
End If
' Remove ascii null
For i = 1 To Len(filestruct.lpstrFile)
If Mid(filestruct.lpstrFile, i, 1) = Chr(0) Then
filestruct.lpstrFile = left(filestruct.lpstrFile, i - 1)
Exit For
End If
Next i
OpenFile = filestruct.lpstrFile
End Function

' Save a file
Public Function SaveFile() As String
Dim i As Long
PrepareStruct
SetFlag OFN_NOTESTFILECREATE
SetFlag OFN_LONGNAMES
If GetSaveFileName(filestruct) = 0 Then
SaveFile = ""
Exit Function
End If
' Remove ascii null
For i = 1 To Len(filestruct.lpstrFile)
If Mid(filestruct.lpstrFile, i, 1) = Chr(0) Then
filestruct.lpstrFile = left(filestruct.lpstrFile, i - 1)
Exit For
End If
Next i
SaveFile = filestruct.lpstrFile
End Function


'Function GetFilePath
'Objective
' Open an explorer to choose a file
'Parameter
' sFilePath the entire path of the file
'Note
' sFilePath is an empty string if the user click Cancel
' during the choice of a file name
Public Sub GetFilePath(ByRef sFilePath As String, _
sdefaultExt As String, _
sInitialFile As String, _
sInitialDir As String, _
sFilter As String, _
bSave As Boolean)
Dim sTempPath As String
Dim OpenDialog As New CFileOpenSave
On Error GoTo errGetFilePath
dbg.LogTrace "Enter GetFilePath"
'display the filedialog form
OpenDialog.defaultExt = sdefaultExt
OpenDialog.filter = sFilter
OpenDialog.initialFile = sInitialFile
OpenDialog.initialDir = sInitialDir
OpenDialog.SetFlag OFN_HIDEREADONLY
OpenDialog.SetFlag OFN_EXPLORER
If bSave Then
OpenDialog.SetFlag OFN_OVERWRITEPROMPT
sFilePath = OpenDialog.SaveFile
Else
sFilePath = OpenDialog.OpenFile
End If
If sFilePath <> "" Then
dbg.LogTrace "Exit GetFilePath"
Set OpenDialog = Nothing
Exit Sub
End If
dbg.LogTrace "Exit GetFilePath"
Set OpenDialog = Nothing
Exit Sub
errGetFilePath:
Set OpenDialog = Nothing
dbg.LogTrace "Error GetFilePath : " & err.description
Resume errGetFilePath1
errGetFilePath1:
End Sub


'in the form
private sub cmd_click()
dim exp as new COpenSaveFile
exp.ParentHWnd = Me.HWnd
exp.GetFilePath sFileName, "*.txt", "", "", "", False
end sub


thanks again!