Secretarial knowledge > Graduation design

Implement communication between desktop GIS ArcView and VB5 applications


Abstract This paper briefly introduces the concept of desktop geographic information system. By analyzing the communication relationship between desktop geographic information system ArcView and VB5 applications, and combining examples, the application value of ArcView and VB 5 communication in developing desktop geographic information system is discussed. Keyword Desktop Geographic Information System, ArcView and VB5, Application Communication? 1. Introduction to Desktop Geographic Information System? Geographic Information System (GIS) is a specific spatial information system that uses modern methods to collect, store, analyze and manage A spatial information system that displays, simulates, and distributes data related to geospatial. It is an integrated product of modern earth science, informatics, environmental science, surveying and mapping, computer science, management science, applied mathematics, and various applied disciplines. Since the Canadian surveyor RTTomlinson first proposed the term GIS in the 1960s, GIS applications have emerged on mainframes, minicomputers, workstations, and microcomputer platforms. For example, the products of ESRI in the United States have spread over the above four hardware platforms. Due to the rapid development of PC technology in the 1980s and the sharp decline in PC hardware prices and the increasing performance in recent years, desktop GIS has developed rapidly. Among them, ArcView of the US ESRI company is used more in China. 2. Introduction to ARCVIEW? The current English version of ArcView 2.1 or above is a visually superior desktop geographic information system. It integrates spatial graphics, relational database, statistical graphics, spatial analysis, network communication, and object-oriented programming. The graphical user interface is intuitive. And it has its own development tool, Avenue, for making specific ArcView applications. Avenue is an object-oriented programming language in the WI NDOWS environment, and the system functions of ArcView are programmed by it. Any Windows application developed by the Avenue language has a corresponding Project, Project consists of some Document and Script, and Document is composed of Document Window and Document GUI, so the model of the Avenue application is shown in Figure 1. The Document in Figure 1 is the only way for human-computer communication. According to its function, it can be divided into five types: V iew, Table, Chart, Layout and Script Editor. The Document GUI is a graphical user interface corresponding to a Document, by Menu bar. Button bar and Tool bar are used to correspond to different functions. Figure 1Avenue application model? When we specifically developed the desktop GIS ArcView, we found that the existing ArcVie w system function can not fully meet the requirements, we must re-engineer the ArcView system and add new features. Since ArcV iew's development language is Avenue, its development efficiency is low. Therefore, in actual development, it is necessary to make full use of ArcView's own powerful map management functions, and to use the advantages of high-level language in rapid development and application. Will achieve good results. 3. ArcView and VB5 application communication methods? The most common IPC methods are DDE, OLE, and external function calls, file access, and WINDOWS scrapbooks for dynamic link libraries. All of the above methods enable different WINDOWS applications to communicate with each other. The DDE method was originally implemented as a message-based protocol in WINDOWS to exchange information between different WINDOWS applications. With the release of WINDOWS 3.0, DDE has been heavily applied in actual application development by enabling the DDE service to invoke the DDE management library using the application programming interface. ArcView communicates with external applications through DDE and DLL methods. This article uses an example to detail the use of DDE functionality. In actual application, ArcView can be used as both Clint and Server to implement communication between application programs, including transmitting or receiving data, executing requests, and returning analysis results. By using the DDE method, the backwardness of the development language of ArcView itself can be overcome, and the powerful map management function of ArcView itself can be fully utilized, and the desktop geographic information system conforming to the characteristics of the times can be created. Practice has proved that system development using ArcView and VB5 application communication is an effective desktop GIS development method. 4. Example Analysis? In this example, the VB5 application issues an Avenue request to ArcView to create new documents such as views and layouts, and the application asks ArcView for the currently active document. At this point the VB5 application is the target and ArcView is the source. If VB5 and ArcView are already installed, follow the steps below to create an application: • Start VB5 and create the default form Form1. • Create controls on Form1 based on the following properties, then zoom in on the form to arrange the controls neatly. ObjectProperty Setting?Text BoxNametxtDDE?Command ButtonCaptionSend Request?NamecmdRequest?Combo BoxNamecboDocType? Add the following code in the description section of Form1: ?Const NONE=0, MANUAL=2?Sub Startup?Dim t?Const DDE_NO_APP=282?'this will start ArcView if it isn't running?On Error GoTo FireUp?txtDDE.LinkMode=NONE'Clear DDE link?txtDDE.LinkTopic="ArcView|System"'Create dialog?txtDDE.LinkMode=MANUAL'Create manual link?Exit Sub?FireUp :?If Err=DDENOAPP Then?ChDir "C:\ARCVIEW2\BIN"?t=Shell?t=DoEvents?Resume?Else?MsgBox "Unknown error."?Stop?End If?End Sub? Added in the FormLoad event The following code: ?Sub FormLoad?cboDocType.text=""?cboDocType.AddItem "View"?cboDocType.AddItem "Layout"?cboDocType.AddItem "SEd"Startup'Start the startup program?End Sub? Add the following code to the FormUnload event :?Sub FormUnload ?txtDDE.LinkMode = NONE'Close DDE conversation? End Sub? Add the following code to the cboDocTypeClick event: ?Sub cboDocTypeClick?cmd="av.GetProject.AddDoc av.GetProject.GetActive.Get.Ge tWin.Open "?txtDDE.LinkExec Ut cmd?End Sub? Add the following code to the cmdRequestClick event: ?Sub cmdRequestClick ? 'LinkItem is a Avenue script that can return a value?txtDDE.LinkItem = "av.GetActiveDoc.GetName"?txtDDE.LinkRequest?End Sub? Store VB5 project And compiled into an EXE file. You can now run the Visual Basic application. If ArcView is not running, the application will activate it. Select a document name from the dropdown combo box to create a document in ArcView. To access the currently active document, tap the Send Request button and the document name will be displayed in the text box. All DDE communication in this example is implemented through a text box. In VB5, any text box, picture box, and label can be targeted in a conversation, and any form can be considered a source. The operating environment of the above example is: Visual Basic 4.0 or above, ArcView 2.1 or above, Windows 3.1 or above. References 1. Bian Bian, editor, Principles and Methods of Geographic Information Systems, Beijing: Surveying and Mapping Press, August 1996. 2, Guo Dazhi, Sheng Yehua, etc., "Geographic Information System Foundation and Application", Coal Industry Press, May 1997. 3, Mike McKelvy & Ronald Martinsen, "Visual Basic 5 Development User Manual", Mechanical Industry Press, April 1998.

recommended article

popular articles