hi,

i am trying to use the mIRC DDE server, but i am having problems.

i just want it display, in mirc window, some text. in mirc.hlp:

/dde mirc command "" /echo blahblahblah

seens to be the way to do that. but i get errors when i try to use DdeCreateStringHandleA() with a null string. so, i tried to use a 0, but...

the DdeGetLastError() after the DdeClientTransaction() give me error 4006, invalid params.

anybody have any sample sourcecode, or any tip?

ancev



dde_null db "",0
dde_service db "mIRC",0
dde_topic db "command",0
dde_command db "/echo blahblahblah"

conversation dd ?
;null dd ?
instance dd ?
topic dd ?
system dd ?



dde_notify:
push 0
push APPCMD_CLIENTONLY + APPCLASS_STANDARD + \
CBF_FAIL_ALLSVRXACTIONS + CBF_SKIP_ALLNOTIFICATIONS
push ofs callback
push ofs instance
callW DdeInitializeA

cmp eax, DMLERR_NO_ERROR
jne @@exit

push CP_WINANSI
push ofs dde_service
push [instance]
callW DdeCreateStringHandleA
mov [system], eax

push CP_WINANSI
push ofs dde_topic
push [instance]
callW DdeCreateStringHandleA
mov [topic], eax

; push CP_WINANSI
; push ofs dde_null
; push [instance]
; callW DdeCreateStringHandleA
; mov [null], eax

push 0
push [topic]
push [system]
push [instance]
callW DdeConnect
mov [conversation], eax

int 3
push 0
push TIMEOUT_ASYNC
push XTYP_POKE
push CF_TEXT
push 0 ;or [null]
push [conversation]
push ofs dde_command
callW lstrlenA
push eax
push ofs dde_command
callW DdeClientTransaction

push [instance]
callW DdeGetLastError

push [conversation]
callW DdeDisconnect

push [instance]
callW DdeUninitialize

@@exit:
ret


callback:
sub eax, eax
ret 8*4


Posted on 2002-04-27 13:07:50 by ancev
If you are using a script for mIRC the script probably changed the DDE service name..
use '/ddeserver on <servicename>'. so in your case: /ddeserver on mIRC

i attached a DDE sample for mIRC using ircN script. you can test it on your mirc by changing the service name to ircN with: '/ddeserver on ircN' or recompile it with the correct name.

you can also change it by going to options->general->servers.
Posted on 2002-04-27 17:17:11 by savage
savage,

thanks :)

DdeGetLastError() was right, i was using a invalid parameter :tongue:

ancev
Posted on 2002-04-27 17:47:04 by ancev