By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,042 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,042 IT Pros & Developers. It's quick & easy.

DDE in VB.NET

P: n/a
This project: http://www.ozemail.com.au/~markhurd/vbnetdde.zip
(created by Mark Hurd) implements some DDE functionality in a VB.NET
application. Unfortunately, the example project does not implement
any way to send WM_DDE_EXECUTE messages; it only receives them.

The project does, however, contain an example on how to send a
WM_DDE_REQUEST message to another application via DDE:

Private Sub PostRequest(ByVal hWnd As System.IntPtr, ByVal
Item As String)

Dim ItemAtom As Short
Dim FormatID As Short

Try
ItemAtom = GlobalAddAtom(Item)

FormatID =
CShort(System.Windows.Forms.DataFormats.GetFormat( System.Windows.Forms.DataFormats.Text).Id)

DataReceived = False

If PostMessage(hWnd, WM_DDE.REQUEST, Handle,
PackDDElParam(WM_DDE.REQUEST, FormatID, ItemAtom)) = 0 Then
' Clear the Item atom so we don't free it
ItemAtom = 0
End If

Log(" Request sent(" &
hWnd.ToInt32.ToString("x").ToUpper() & ", " & FormatID & "," & Item &
")" & NewLine)
Finally
If ItemAtom <0 Then GlobalDeleteAtom(ItemAtom)
End Try
End Sub
I've tried the obvious things, like changing WM_DDE.REQUEST to
WM_DDE.EXECUTE in the code above, but have only been able to get NACKs
back or get no acknowledgment at all.

Is there anyone out there who can help me figure this one out?

- Don

Oct 16 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.