All of the DPLOTLIB functions eventually result in a call to one of the Win32 API Dynamic Data Exchange Management Library (DDEML) functions, typically DdeClientTransaction. The calls to DdeClientTransaction are sychronous; that is, the call does not return until the transaction is completed. However, a synchronous transaction does allow the calling application to receive additional user input before it returns. That user input may include clicking a button which would normally cause another call to a DPLOTLIB function. The DDEML will not allow multiple synchronous transactions from the same application, and the DPLOTLIB.DLL functions also contain checks to prevent this from happening. Although the error messages you'd get in this case are generally non-fatal and will allow your application to continue execution, in general it is much better to prevent this sort of thing to start with. You can do this by disabling whatever controls might result in additional DPLOTLIB calls until the current process has been completed. This is how the example programs handle the problem (starting with version 2.2). For example, the VB example btest2 program contains 3 push buttons (Command1, Command2, Command3) that each result in a plot:
Private Sub Command1_Click()
' Declarations
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
' DPLOTLIB calls
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
End Sub
You'll of course want to make sure that it is not possible to exit the routine without enabling those push buttons, else you'll be left with an application with nothing to do.
Page url: http://www.dplot.com/lib/index.htm?timing_issues.htm