R
RFleming
Hello,
I am trying to change a DDEML callback function I have used in VB6
successfully for years now to vb.net. However, I can't seem to get my
mind around how to setup a delegate and pointers to get the
DDEInitialize to start the callback. I was hoping a more
seasoned .net programmer might be able to help translate the following
snippet of code from VB6 to VB.net.
API Declare Below:
Public Declare Function DdeInitialize Lib "user32" Alias
"DdeInitializeA" (pidInst As Long, ByVal pfnCallback As Long, ByVal
afCmd As Long, ByVal ulRes As Long) As Integer
Private Sub Start_DDECallback()
DDEML_CallBack_Handle = DdeInitialize(g_lInstID, AddressOf
DDECallback, APPCLASS_STANDARD Or APPCMD_CLIENTONLY Or MF_SENDMSGS Or
MF_POSTMSGS Or MF_CONV Or MF_ERRORS, 0)
End Sub
Public Function DDECallback(ByVal uType As Long, ByVal uFmt As Long,
ByVal hConv As Long, ByVal hszString1 As Long, ByVal hszString2 As
Long, ByVal hData As Long, ByVal dwData1 As Long, ByVal dwData2 As
Long) As Long
********CODE HERE TO HANDLE DDE STUFF
END FUNCTION
Any help would be greatly appreciated!
Thanks
Ryan
I am trying to change a DDEML callback function I have used in VB6
successfully for years now to vb.net. However, I can't seem to get my
mind around how to setup a delegate and pointers to get the
DDEInitialize to start the callback. I was hoping a more
seasoned .net programmer might be able to help translate the following
snippet of code from VB6 to VB.net.
API Declare Below:
Public Declare Function DdeInitialize Lib "user32" Alias
"DdeInitializeA" (pidInst As Long, ByVal pfnCallback As Long, ByVal
afCmd As Long, ByVal ulRes As Long) As Integer
Private Sub Start_DDECallback()
DDEML_CallBack_Handle = DdeInitialize(g_lInstID, AddressOf
DDECallback, APPCLASS_STANDARD Or APPCMD_CLIENTONLY Or MF_SENDMSGS Or
MF_POSTMSGS Or MF_CONV Or MF_ERRORS, 0)
End Sub
Public Function DDECallback(ByVal uType As Long, ByVal uFmt As Long,
ByVal hConv As Long, ByVal hszString1 As Long, ByVal hszString2 As
Long, ByVal hData As Long, ByVal dwData1 As Long, ByVal dwData2 As
Long) As Long
********CODE HERE TO HANDLE DDE STUFF
END FUNCTION
Any help would be greatly appreciated!
Thanks
Ryan