This one has been frustrating me for MONTHS!!
thanks!
here is my NOT WORKING & I DON'T KNOW WHY code (from
http://www.autohotkey.com/forum/topic17326.html )
Code:
; trying to figure out the DLLCALL equivalence...
;
;
LPDWORD := "UIntP"
PFNCALLBACK := "UInt" ; or should that be Int ?
DWORD := "UInt"
HSZ := "UInt" ; is that right ?
UINTc := "UShort" ; Can this be right ? is it UInt ?? Int ??
NULL := "Int"
LPTSTR := "str"
INTc := "short" ; maybe Int ??? SEE BELOW FOR MS DEFS...
APPCLASS_STANDARD := 0
CP_WINANSI := 1004
CF_TEXT := 1
XTYP_EXECUTE = 0x0050
XTYP_POKE = 0x0090
XTYP_REQUEST = 0x00B0
VarSetCapacity(ddeServer, 256,0)
VarSetCapacity(ddeDataE, 256,0)
VarSetCapacity(ddeData,33000)
VarSetCapacity(ReturnV1,33000)
ddeServer = excel
ddeTopic =
ddeData = [formula(\"SWI-Prolog\",\"r1c1\")]
pidInst := 0
if ( DllCall("DdeInitialize"
, LPDWORD, pidInst
, PFNCALLBACK, 0
, DWORD, APPCLASS_STANDARD
, DWORD, 0 ) )
msgbox ERROR with DDEInitialze !
HddeServer := DllCall("DdeCreateStringHandle"
, DWORD, pidInst
, LPTSTR, ddeServer
, INTc, CP_WINANSI )
HddeTopic := DllCall("DdeCreateStringHandle"
, DWORD, pidInst
, LPTSTR, ddeTopic
, INTc, CP_WINANSI )
ddeDataE =
HddeDataE := DllCall("DdeCreateStringHandle"
, DWORD, pidInst
, LPTSTR, ddeDataE
, INTc, CP_WINANSI )
HddeConversation := DllCall("DdeConnect"
, DWORD, pidInst
, HSZ, HddeServer
, HSZ, HddeTopic
, Null, 0 )
ddeData = [formula(\"SWI-Prolog\",\"r1c1\")]
BddeData := StrLen(ddeData) + 1
ddeResult = 0
;
; THIS IS NOT SEEMING TO WORK
;
ReturnV1 := DllCall("DdeClientTransaction"
, STR, ddeData
, DWORD, BddeData
, Uintc, HddeConversation
, DWORD , HddeDataE
, UINTc, CF_TEXT ; NOTE: should be ZERO with execute
, UINTc, XTYP_EXECUTE
, DWORD, 1000
, LPDWORD, ddeResult ) ;
compare := 0x4000 + 0
msgbox 32,, % DllCall("DdeGetLastError", DWORD, idInst) " :" compare
exitapp
likely you can figure out what i've missed out on ??
also had an idea about the callback....
made a very simple machine code 'do nothing' and return ... and put it into a string... then used the strings address as callback address...
but seems this all was unnecessary....
only SERVER seems to need callback...
would very much like your help to figure out...
a full fledged DDE tool would be nice for AHK...