Announcement

Collapse
No announcement yet.

DDE client - how to simply send a message to another app?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Florent Heyworth
    replied
    Hi Wayne

    how are you trying to communicate with MIRC - are you using
    XTYP_POKE or XTYPE_EXECUTE, XTYP_REQUEST? In DDE you have
    an item and a command which you need for XTYP_POKE type
    requests. If no special item is specified then create
    a string handle (DdeCreateStringHandle()) with "command"
    as the name of the item.

    If that still gives you trouble post some source code so
    we can have a look at it. You may want to use an optional
    data handle (don't forget to specify the item) as follows:

    Code:
        DO
            lData = DdeCreateDataHandle( lId, STRPTR(sCmd(i)), LEN(sCmd(i)), 0, hItemMessage, %CF_TEXT, 0 )
            lResult = DdeClientTransaction( lData, &HFFFFFFFF???, hConvHandle, hItemMessage, %CF_TEXT, %XTYP_POKE, 3000, BYVAL 0 )
            CALL DdeFreeDataHandle( lData )
            INCR i
        LOOP WHILE i < UBOUND(sCmd(),1)+1
    Cheers

    Florent

    ------------------

    Leave a comment:


  • Tom Hanlin
    replied
    Wayne, we need more information to help! Can you show us the code?


    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Mike Trader
    replied
    Wayne,
    There are a few guys that hang out in
    #mircscripts
    that might be able to help. When I was doing alot of coding in Mircs language they were very helpfull. The channel is on:
    Othernet.org

    ------------------
    Kind Regards
    Mike

    Leave a comment:


  • Wayne Diamond
    replied
    Florent, your code is definately working, but Im just having problems getting it working correctly - the main difference between your demo and what I need to do is that your demo uses an Item as well as a Topic ... I'm trying to talk to mIRC (the irc chat program), because if I can talk to that I can talk to anything. mIRC wants the servicename "mirc", the topic "command", and the actual message - "/echo hello" , but there shouldn't be an Item...
    When I make the Item "blah", it works in the sense that mIRC prints something on screen, but it's just a few jumbled characters. When I try to create a ddestringhandle of "", it GPFs with "can't read from 0x00000000". I've also tried CHR$(0) on it's own for the Item, but that didn't work either
    Any ideas?


    ------------------

    Leave a comment:


  • Peter P Stephensen
    replied
    Forent,

    Nice code! Please put it in the source code forum so we can find
    it when we need it.

    Regards
    Peter

    ------------------

    Leave a comment:


  • Wayne Diamond
    replied
    Florent, according to POFFS2 youve just answered the question of about thirty people!
    Got a lot to do away from the computer for the next few hours but I'll eagerly be racing home to try your demo (which - unlike the petzold dde one - seems readable!)
    Many, many thanks again kind sir, hope you get your weekend off to a good start

    Best regards,
    Wayne


    ------------------

    Leave a comment:


  • Florent Heyworth
    replied
    example code moved to source code forum at http://www.powerbasic.com/support/pb...ad.php?t=23058


    [this message has been edited by florent heyworth (edited may 19, 2001).]

    Leave a comment:


  • Wayne Diamond
    replied
    Michael,
    The problem is I didn't write and have no control over the server component, its 3rd party... it's just a program with a DDE server built in so that other programs can have limited control over it simply by sending various commands using DDE, so I need to write a DDE client - SendMessage is good for IPC but probably won't work for DDE (or will it?)

    Thanks,
    Wayne


    ------------------

    Leave a comment:


  • Michael Mattias
    replied
    ...DDE client? all I need to do is send messages, I don't need to receive them....
    Um, if this is the disease, DDE does not seem the cure. The "E" in "DDE" stands for "exchange."

    If all you need to do is send messages, how about, "SendMessage" ???


    MCM
    (PS. I suspect you may not have meant this literally.)

    Leave a comment:


  • Scott Turchin
    replied
    Patience....
    Friend of mine is working on one but has taken some time out to do some other things.
    I'll shoot him an email tonight and ask him out PBDDE is going....

    Scott


    ------------------
    Scott

    Leave a comment:


  • DDE client - how to simply send a message to another app?

    I've been through all of POFFS2 but it seems that despite a lot of people asking, nobody has ever been able to put together some DDE code for PB ?? (other than the Petzold example, which seems to make a mountain out of an ant-hill)
    Does anybody have any source for a DDE client? all I need to do is send messages, I don't need to receive them. This only involved some five or so lines in VB, but I was shielded from the APIs so I'm not entirely sure what's involved in a DDE message send
    Thanks,
    Wayne


    ------------------
Working...
X