logga($log,"Initializing DDE.....") ; logga is a function I use to create a log for my application, just ignore that
$return=_DdeInitialize("OnDDE_", BitOR($APPCMD_CLIENTONLY, $CBF_SKIP_ALLNOTIFICATIONS))
if $return=0 then
logga($log,"OK")
Else
logga($log,"DDEinitialize ERROR:"&$return)
EndIf
$hszService = _DdeCreateStringHandle("MYSERVER")
$hszTopic = _DdeCreateStringHandle("MYTOPIC")
$hConvSrv = _DdeConnect($hszService, $hszTopic)
if $hconvSrv=0 Then
logga($log,"DDEConnect ERROR")
Else
logga($log,"Connected")
endif
;-----------------------------------intializing ADVISE LOOP---------------------------------------------
$hszItem = _DdeCreateStringHandle("MYITEM")
$res = _DdeClientTransaction($XTYP_ADVSTART+$XTYPF_ACKREQ, $hConvSrv, 0, 10000, $hszItem, $CF_TEXT)
;
;......................
;-----------------------------------------------------------------------------------------------------------------
; Func ON_DDE_AdvData
;
; $hSz1 and $hSz2 are strings containing the topic and item
; $uFmt ???? I don't know...my server sends 1 but can't figure out the meaning
; $hData is a handle to data, I use it calling _DdeGetDataAsString and it works fine
; $hConv handle to the DDE conversation
;-----------------------------------------------------------------------------------------------------------------
Func OnDDE_AdvData($hSsz1,$hSsz2,$uFmt,$hData,$hConv)
; DO SOMETHING WITH DATA
endfunc
Hi tts...and thanks to doudou for this excellent job.
I just wrote a simple client script to receive data from a DDE server (stocks quote...) in advise mode, hope it is useful.
I still can't figure out the meaning of $uFmt passed to the OnDDE_AdvData function...any hints from someone?
EDIT: OK found, It's the clipboard format :-b