|
-
Aug 6th, 2001, 09:00 AM
#1
Thread Starter
New Member
Common Dialog (Win 98)
Anyone know how to effectively trap the 'Buffer too small' error in the Common Dialog that ships with Win 98. The code below works fine with Win 95 and NT but the Common Dialog that ships with 98 seems to behave differently in that when the file(s) string is just slightly above the buffer size the trappable error is produced but when the string size is significantly bigger than the buffer no 'result' is returned. i.e. the open file dialog behaves as if 'open' is clicked with no file having been selected and code execution ends. Bit of a specific question but someone might know??
Thanks
Dim result As Long
Dim filebox As OPENFILENAME
With filebox
.
. ' parameter setting stuff
result = GetOpenFileName(filebox)
If result = 0 Then
GoTo ErrDialog
Else ' other code here
End If
ErrDialog: 'result 0
Dim errcode As Long
errcode = CommDlgExtendedError()
If errcode = FNERR_BUFFERTOOSMALL Then
MsgBox "Please select fewer files.", vbExclamation, "Error"
End If
Exit Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|