TALtech Logo
search
Products Support Resources Free Software
   TALtech Home:  Support:  WinWedge Support:  DDE and the WinWedge:  DDE Examples for Access:


Launching and Terminating the WinWedge from Access

Function LaunchWedge ()

' This function will launch the Wedge feeding it the name of a configuration file on
' the command line causing the Wedge to automatically load the config file and
' activate itself

CmdLine = "C:\winwedge\winwedge.exe C:\winwedge\test.SW3"
' Change "CmdLine" to specify the correct path for your copy of WinWedge.Exe
' Make sure that the complete path is specified for your configuration file as well
RetVal = Shell(CmdLine)

x = Now + .00002
Do While Now < x
DoEvents
Loop
If RetVal = 0 Then
Beep

' wait for roughly 2 seconds
' give wedge time to load and activate itself
' allow other Windows processes to continue

' launch failed
' warn user and exit

MsgBox ("Cannot Find WinWedge.Exe")

Exit Function
Else
AppActivate "Microsoft Access"
End If

' launch succeeded
' set the focus back to Access

End Function

Function KillWedge () ' This function unloads the Wedge from memory

chan = DDEInitiate("WinWedge", "Com1")

' initiate DDE channel with wedge on
' COM1

DDEExecute chan, "[AppExit]"

' send AppExit command to Wedge

' no need for a DDETerminate statement here because Wedge is no longer running

End Function


See Also:
Collecting Data Directly To A Table In An Access Database
Transmitting Variables Out The Serial Port From Access
Back to Top

TALtech Home  |  Products  |  Resources  |  Free Software  |  Support  |  Buy Now  |  Register Your Products  | 
Site Map  |  Contact TALtech  |  News