Moskito as a server |
Top Previous Next |
DDEExecute For the illustration serves here MS Access as a client. Source situation is the following form which corresponds to a search in the Moskito's information about the field part number. In the form are the fields Field part, Graduation, Xand Y co-ordinate and Municipality invested. About the Drop-Down list field part any record can be selected. The button Moskito's view if the DDE binding includes. Moskito is begun (if necessary) by clicking, and the plans to the well-chosen field part are shown in the given graduation in the plan window. To reach this, the following event procedure is assigned to the button.
Private Sub PlanAnzeigen_Click ()
On Error Resume Next
Dim canal, table name, I, TopicList
Canal = DDEInitiate ("Moskito", "system")
If Err Then Err = 0 I = Shell ("C:\Moskito\M4.cmd", 1) If Err Then Exit Sub Canal = DDEInitiate ("Moskito", "system") If
DDEExecute Canal, "wsc\n"& graduation& "\n#P"& X&""& Y & "\n AuskunftWorkproc RELOAD\n"
DDETerminateAll
Sub
The first line of the programme fixes, that the procedure Plan announcements while clicking the button is begun: Private Sub PlanAnzeigen_Click () A mistake treatment routine is furnished: On Error Resume Next The required variables are declared: Dim Canal, I By DDEInitiate if a canal is opened and a linking is produced to Moskito as a server. The syntax of the function is DDEInitiate("Server application", "subject"). The subject fixes which program file should be accessed. Moskito supports the standard subject "System". Canal = DDEInitiate ("Moskito", "system") (With MSWord the subject can be, for example, also an open document or in Access the name of a data bank.) If Moskito is not active, this is registered as a mistake (line 5), the mistake code is put back (line 6) and Moskito begun (line 7). With an other mistake the procedure is finished (line 8). Now otherwise Moskito is active and the linking is produced (line 9). If Err Then Err = 0 I = Shell ("C:\Moskito\M4.cmd", 1) If Err Then Exit Sub Canal = DDEInitiate ("Moskito", "system") If With the instruction DDEExecute if the Moskito's functions become “a zoom absolute” - wsc - and “switched on Layer reload” - AuskunftWorkprocRELOAD - explained. Within the quotation marks any Moskito's function can be explained. Besides, the syntax of the Moskito's function must be understood precisely, in particular blanks (have to go??) at the right places are inserted like here in the functional dialogue ô#P??x co-ordinate??Y co-ordinate”. Vice versa too many blanks may not be also inserted as for example after the opening quotation marks. DDEExecute Canal, "wsc\n"& graduation& "\n#P " & X&""& Y& "\n AuskunftWorkproc RELOAD\n" The transmission of a command line in Moskito (Return) is copied with "\n". Around within the Moskito-functional dialogue on the topical contents of the Access-form fields Graduation, X and Y to be able to fall back, they &are enclosed in &sign. This happens beyond the quotation marks, so that here additional blanks are ignored. After the implementation of the Moskito's orders are closed in line 12 all linkings, DDETerminateAll and finishes the programme. Sub
|