VBLady
Newcomer
Has anyone done this? Attempted to use the sdk's API calls in .Net? My DDEInitialize function is failing with DMLERR_INVALIDPARAMETER. Here is the call:
My guess is it might be the callback function that is the bad parameter. In .Net I had to declare a delegate.. which I'm not entirely sure I did correctly.
Then in the function declaration for the DDEInitialize, I used the delegate type for the parameter:
If anyone has done this before, please chime in.. I would really appreciate it.
Frances
Visual Basic:
Dim iResult As Integer = DdeInitialize(idInst, AddressOf DDECallback, APPCMD_CLIENTONLY, 0)
My guess is it might be the callback function that is the bad parameter. In .Net I had to declare a delegate.. which I'm not entirely sure I did correctly.
Visual Basic:
Delegate Function DDECall(ByVal uType As Long, ByVal uFmt As Long, ByVal hConv As Long, _
ByVal hszTopic As Long, ByVal hszItem As Long, ByVal hData As Long, _
ByVal dwData1 As Long, ByVal dwData2 As Long) As Long
Public Function DDECallback(ByVal uType As Long, ByVal uFmt As Long, ByVal hConv As Long, _
ByVal hszTopic As Long, ByVal hszItem As Long, ByVal hData As Long, _
ByVal dwData1 As Long, ByVal dwData2 As Long) As Long
DDECallback = 1
End Function
Then in the function declaration for the DDEInitialize, I used the delegate type for the parameter:
Visual Basic:
Public Declare Function DdeInitialize Lib "user32" Alias "DdeInitializeA" (ByVal pidInst As Long, ByVal pfnCallback As DDECall, ByVal afCmd As Long, ByVal ulRes As Long) As Integer
If anyone has done this before, please chime in.. I would really appreciate it.
Frances