mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 1
P
Mostly harmless
OP Offline
Mostly harmless
P
Joined: Aug 2004
Posts: 1
I would like to paste text from a Visual Basic 6 application into an mIRC channel. I can currently copy the textbox text to the clipboard and manually paste the text to the mIRC chat channel that I am in, but I would like this to all be initiated by clicking on a command button in the VB6 app. I have been looking at some examples using DDE with VB and mIRC, but have not had much success yet.

When I click the button, I see a warning in mIRC
" You are not on a channel"

I have listed the code as I have it now. I am trying to post to a channel called #marac.

I have checked that the DDE server is on, with the /DDEServer command. I see a response from mIRC that the DDE Server is ON.

I am fairly new to using DDE with applcations other than an Excel spreadsheet, and I have been trying to piece together different code ideas that I have seen. I would appreciate any suggestions. This is probably not too difficult for someone who has seen this before.

Private Sub cmdPost_Click()

'**********************************************

'This routine places the text in the txtSpot text box
'and creates a DDE connection to the MiRC chat program
'so that the spot information can be pasted into the
'chatroom


txtCall.Text = UCase(txtCall.Text)
txtSpot.Text = txtCall.Text + " " + cboCounty.Text + "," + dbcoState.Text + " " + txtFreq.Text + " " + " " + cboMode.Text + " " + txtComment.Text



On Error GoTo errHandler
'Create a DDE connection
If txtSpot.LinkMode = vbNone Then
txtSpot.LinkTopic = "mIRC|COMMAND" ' Set link topic.
txtSpot.LinkMode = vbLinkManual ' Set link mode.
End If


txtSpot.LinkExecute "/dde mirc command " & Chr$(34) & Chr$(34) & " " & "msg/ #marac testing..."

Exit Sub

errHandler:


MsgBox Err.Description

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Try:

txtSpot.LinkExecute "/msg #marac testing..."


Link Copied to Clipboard