|












| |
Contents | Index
Example Visual Basic Code
- Running an application minimized (see VB Help on Shell for more info):
Shell "c:\spcwin32\spcwin32.exe", vbMinimizedNoFocus
- Opening a DDE channel to SPC:
- at design time, create an edit control, with the following properties:
LinkMode = 0 - None
LinkTopic = SPCWIN|system
- then, at run time, set the LinkMode property to 2, which opens the channel for
use with the edit control. You may choose to have this edit control be
hidden, as it will contain the responses given back from SPC:
txtMacro.LinkMode = 2
- Communicating over an open channel:
- set the LinkItem property to be the command you wish to send (enclosed in
brackets [] if needed), and use the LinkRequest method:
txtMacro.LinkItem = "[" & strMacroCommand & "]"
txtMacro.LinkRequest
- this will send the command indicated, and request a response, which will
appear in the text field of the edit control. Alternately, you may use LinkExecute
to directly execute a command, if no response is required:
txtMacro.LinkExecute "CLOSE.APP"
- Notes:
- there is no need to close the channel, it will be closed upon exiting your
application. Should you wish to, you can close it by setting the LinkMode
property back to 0 - None.
- Its sometimes necessary in the course of the application to liberally set the
LinkMode property back to 2, because occasionally it will get reset to 0 if an
error occurs.
|