Author Topic: Dynamic Data Exchange with codeblocks  (Read 2878 times)

Offline exkise

  • Single posting newcomer
  • *
  • Posts: 4
Dynamic Data Exchange with codeblocks
« on: January 04, 2015, 11:53:23 pm »
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 :

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


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Dynamic Data Exchange with codeblocks
« Reply #1 on: January 05, 2015, 12:02:02 am »
What do you want to use the DDE for?
(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!]

Offline exkise

  • Single posting newcomer
  • *
  • Posts: 4
Re: Dynamic Data Exchange with codeblocks
« Reply #2 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 ^^

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Dynamic Data Exchange with codeblocks
« Reply #3 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.
(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!]

Offline exkise

  • Single posting newcomer
  • *
  • Posts: 4
Re: Dynamic Data Exchange with codeblocks
« Reply #4 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.