DADiSP – ActiveX
Learn about the DADiSP ActiveX connection…
ActiveX is a broad term that generally refers to a Microsoft binary standard for sharing code and data between separate programs or “components”. The actual protocol is specified by the Component Object Model (COM). COM has undergone many upgrades and enhancements since its original introduction as Object Linking and Embedding (OLE).
One important feature of COM is Automation. Automation allows a “client” program to control a “server” or component program just as if the component functionality was built into the client. For example, DADiSP can fully control Microsoft Word, placing a DADiSP Worksheet into a document and printing the results all from within DADiSP. Likewise, a Visual Basic program can hand off data to DADiSP for processing without DADiSP ever being visible to the user. In this way, DADiSP acts as a powerful data analysis library for any program that supports Automation.
ActiveX components generally expose three basic constructs:
Properties represent the various settings of the component such as color, font, size, etc.
Events are notifications the component makes to the client program. Some possible events are mouse was clicked, canvas was sized, button was pushed, etc. After receipt of the notification, the client can respond appropriately.
Methods are functions the client program can direct the component to execute.
DADiSP Automation Server
DADiSP as an ActiveX server or component supports several extremely powerful methods, including:
- Getdata (window or variable)
- Putdata (window or variable, data)
- Execute (“command string”)
Getdata retrieves data from a DADiSP Window or variable to the client. For example, here’s a Visual Basic code fragment that obtains the series in W2 of a DADiSP Worksheet into a Visual Basic variable:
In this example, Visual Basic acts as the “client” and DADiSP the ActiveX “server”.
We declare DADiSP as an ActiveX object with the
Dim DADiSP As Object
declaration. Visual Basic establishes a connection to DADiSP with the
Set DADiSP = CreateObject("DADiSP.Application")
statement. The connection is made by checking the Registry for ActiveX components and capabilities. For faster ActiveX communication, DADiSP also provides a COM “Type Library” (
dadisp.tlb) that provides in depth information on the ActiveX capabilities offered by DADiSP. Finally,
VbVar = DADiSP.Getdata("W2")
copies the series or table in W2 into the Visual Basic array
VbVar. ActiveX data transfers are quite flexible and efficient. DADiSP transparently supports multi-column data using the COM standard
SafeArray. Byte, Integer, Float, and Double scalar values are also supported.
Here’s a code fragment that generates a Visual Basic array and then transfers the array to DADiSP.
You can also “get” or “put” data to a DADiSP variable. For example:
Execute accepts any valid DADiSP command as input, all the features, functions and capabilities of DADiSP are available to any program that supports ActiveX Automation.
Now for a full example of ActiveX with Visual Basic controlling DADiSP. We’ll use each of the above methods to 1) create data in VB, 2) transfer it to DADiSP, 3) use DADiSP to process the data and 4) retrieve the processed result from DADiSP.
DADiSP.Visible = 1
You could also use the DADiSP SETVISIBLE function:
DADiSP Automation Client
So far, we’ve shown examples of controlling DADiSP from Visual Basic. In this case, Visual Basic is the “client” and DADiSP acts as the ActiveX “server”. However, DADiSP can also function as an ActiveX client to control and make use of the features of ActiveX servers such as Excel, Word, database programs or data acquisition drivers.
The DADiSP SPL syntax for ActiveX is very similar to the Visual Basic syntax mentioned above. For example, to connect to an ActiveX object, you use the
CreateObject function. Properties can be set and retrieved with standard variable assignments and methods executed with the “dot” syntax. For example, the following SPL code fragment connects to Word and makes it visible:
DADiSP can access any function exposed by the ActiveX Automation server. For example, Word has a very elaborate ActiveX hierarchy, consisting of Documents, Ranges, Tables and a host of other objects all accessible to DADiSP.
Finally, the full SPL example below demonstrates the use of these objects to create and copy a DADiSP Worksheet to a Word document.
In conclusion, ActiveX is a very powerful, standardized means of sharing the capabilities of separate programs in a flexible and robust manner. The
SPLActiveX subdirectory included with your DADiSP distribution provides several additional examples of using ActiveX with DADiSP.
Hier geht es weiter
Sie möchten kaufen?
Was sagen unsere Kunden über uns?
Good tutor genuinely interested in student’s needs. This course provided all I needed and more.GS, Great Dunmow, UK
I had just upgraded to Windows 7, and after having Mathcad for several years I found that I could not complete the final stages of installation. After reading help files I finished up confused and really helpless, until I contacted you. THANK YOU.JD, Dorset, UK
I have had a very helpful response, and have passed it on to my Oxford colleagues with success. I am impressed with the way Adept seems to maintain the same staff for many years, which speaks very well for the organisation.HG, Oxford, UK
Just would like to express my sincere appreciation to both Adept Scientific UK and Vissim Support team on their swift efficient and friendly responses of my problems. This is by far the best customer services I have received. Thank you.SQ, Manchester, UK
Zur Zeit ist es uns leider nicht möglich die folgenden Produkte anzubieten. Wir arbeiten jedoch daran Ihnen ein möglichst vielfältiges Produktsortiment zur Verfügung zu stellen. Bitte kontaktieren Sie uns wenn Sie Fragen oder Anregungen haben.