Launching WinWedge from a VB6 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

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

Contact Us