Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance Issues with Dialog Box Templates

Status
Not open for further replies.

quiuser

IS-IT--Management
Jan 9, 2004
4
US
Hi,

We are using a Dialog Box template to display the list of attachments linked to a record. However, when users invoke this dialog box, the CPU usage shoots up to more than 80% and stays there till the dialog box is closed. Appreciate any help! Thanks in advance

Following is the sample code used

Do
Begin Dialog CurrentAttachmentTemplate 200,150,175,120,"Current Attachments...",.CurrentAttachmentProc
ListBox 8,8,120,94,files$,.Files

PushButton 132,8,40,14,"Open",.View
PushButton 132,26,40,14,"Download",.Download
PushButton 132,44,40,14,"Detail",.Detail
PushButton 132,62,40,14,"Delete",.Delete
PushButton 132,80,40,14,"Close",.Cancel

PushButton 40,102,100,14,"Create a New Attachment",.New
End Dialog

Dim CurrentAttachments As CurrentAttachmentTemplate
r% = Dialog(CurrentAttachments,6,0)
:
:

Loop While (Not ((r% = 4 And del% = 1) Or r% = 5 Or (r% = 6 And rn% = 2)))
:
:
Exit Sub


Function CurrentAttachmentProc(ControlName$, Action%, SuppValue%)

On Error Goto currentattach_error_handler


If Action% = 1 Then
If iGroup.Mode = MODE_UPDATE Then
DlgEnable "Delete", False
DlgEnable "New", False
End If

If PopulateCurrentAttachment Then
count = UBound(files, 2)
ReDim fileNames(count) As String

For j = 0 To count
fileNames(j) = files(1, j)
Next j

DlgListBoxArray "Files", fileNames
DlgValue "Files", selectedFile
Else
DlgEnable "View", False
DlgEnable "Download", False
DlgEnable "Detail", False
DlgEnable "Delete", False
End If
ElseIf Action% = 2 And ControlName$ = "View" Then
:
:
Exit Sub
 

Have tried to capture the Idle event of the dialog box and made sure that the dialog box does not send any further idle events. This seems to have fixed the issue

quiuser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top