News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Dynamic Data Exchange with codeblocks

Started by exkise, January 04, 2015, 11:53:23 PM

Previous topic - Next topic

exkise

Hello !

I'm currently trying to communicate with Code::Blocks. I've read this page which tells us that it is possible to send command to codeblocks via Dynamic Data Exchange.

Maybe it is a lack of knowledge from me, but I find that the documentation is not really helping.

I went to the msdn page about using DDE but I'm not familliar with this protocol either.

I've seen this code example from msdn :


    static BOOL fInInitiate = FALSE;
    char *szApplication;
    char *szTopic;
    atomApplication = *szApplication == 0 ?
    NULL     : GlobalAddAtom((LPSTR) szApplication);
    atomTopic = *szTopic == 0 ?
    NULL     : GlobalAddAtom((LPSTR) szTopic);

    fInInitiate = TRUE;
    SendMessage((HWND) HWND_BROADCAST, // broadcasts message
        WM_DDE_INITIATE,               // initiates conversation
        (WPARAM) hwndClientDDE,        // handle to client DDE window
        MAKELONG(atomApplication,      // application-name atom
            atomTopic));               // topic-name atom
    fInInitiate = FALSE;
    if (atomApplication != NULL)
        GlobalDeleteAtom(atomApplication);
    if (atomTopic != NULL)
        GlobalDeleteAtom(atomTopic);


Using this non-talking sample and other code part from different place, I couldn't manage to get codeblocks to respond to my WM_DDE_INITIATE message.

Could you, please, tell me what do I have to send to get codeblocks to anwser me ?

Any help could be usefull :)


oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

exkise

Well, that's a weird question, I'd like to use the commands described in the doc ^^

oBFusCATed

Looking at the code I suppose you have to set the topic to "CodeBlocksDDEServer".
You can check for yourself in src/src/app.cpp.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

exkise

Thanks, I'll look at that.

If I manage to get something to work properly, I'll post an example of working code.