Questions? Search our site or call us at 1-800-722-6004

Launching WinWedge from a VB Application

The following routine will Launch WinWedge:

Sub RunWedge()

' the shell statement passes a wedge config file as a command line arg. 
' This causes the wedge to automatically load the config file and activate itself.
x% = Shell("c:\winwedge\winwedge.exe c:\winwedge\ddetest.SW3")
TwoSecsFromNow = TimeValue(Now) + TimeValue("00:00:02")
Do While TimeValue(Now) < TwoSecsFromNow
DoEvents ' give wedge time to load
Loop

End Sub ' WinWedge should be loaded now

The following routine will close WinWedge:

Sub closeWedge()

Hot = 1 : Warm = 2 : Notify=3 : None = 0
Text2.linkmode = None ' disable links before setting topic
Text2.LinkTopic = "winwedge|com2" ' set the link topic
' there is no need to set the LinkItem property when sending DDE commands
Text2.LinkMode = Warm ' set the link mode to "Warm" or "Hot"
' Close WinWedge
Text2.LinkExecute "[APPEXIT]"

End Sub

Categories: Macro / Code Sample, Visual Basic 6.0, C/C++, .NET, Data Collection, Serial (RS232), WinWedge

Last Updated: 2013.08.30

Need more help?

Don't hesitate to call or email us with your questions

Our office is open 9AM - 5PM Monday Through Friday (E.S.T.)

Technical Support: 215-496-0202

Toll-Free: 1 (800) 722-6004
Skype: taltech1 (Voice only)
Email: support@TALtech.com