Code::Blocks Forums

User forums => Help => Topic started by: exkise on January 04, 2015, 11:53:23 pm

Title: Dynamic Data Exchange with codeblocks
Post by: exkise on January 04, 2015, 11:53:23 pm
Hello !

I'm currently trying to communicate with Code::Blocks. I've read this page (http://www.codeblocks.org/docs/main_codeblocks_en3.html#x3-230001.11.2) 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 :

Code
    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 :)

Title: Re: Dynamic Data Exchange with codeblocks
Post by: oBFusCATed on January 05, 2015, 12:02:02 am
What do you want to use the DDE for?
Title: Re: Dynamic Data Exchange with codeblocks
Post by: exkise on January 05, 2015, 12:05:06 am
Well, that's a weird question, I'd like to use the commands described in the doc ^^
Title: Re: Dynamic Data Exchange with codeblocks
Post by: oBFusCATed on January 05, 2015, 12:23:37 am
Looking at the code I suppose you have to set the topic to "CodeBlocksDDEServer".
You can check for yourself in src/src/app.cpp.
Title: Re: Dynamic Data Exchange with codeblocks
Post by: exkise on January 05, 2015, 08:39:05 pm
Thanks, I'll look at that.

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