Communication between two applications in VB to implement two applications

xiaoxiao2021-03-06  14

Project: Main Loads a PictureBox, named Picdde loading a CommandButton, named cmdsendMessage

Option expedition

Private Sub LinkAndSendMessage (ByVal Msg As String) Dim t As Long picDDE.LinkMode = 0 picDDE.LinkTopic = "Child | frmChild" picDDE.LinkMode = 2 picDDE.LinkExecute Msg t = picDDE.LinkTimeout picDDE.LinkTimeout = 1 picDDE.LinkMode = 0 picdde.linktimeout = TEND SUB

Private Sub CmdsendMessage_Click () LinkAndsendMessage "Test Communication !!" End Sub

Private sub flow_load () shell app.path & "/child.exe"end Sub

Project: Child Set Its LINEMODE = 1-Source Settings It Linetopic = FRMCHILDOPTION Explicit

Private Sub Form_LinKexecute (cmdstr as string, cancel as integer) msgbox cmdstr cancel = 0nd Sub

转载请注明原文地址:https://www.9cbs.com/read-49972.html

New Post(0)