Author Topic: COM server  (Read 4968 times)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
COM server
« on: November 25, 2010, 10:44:36 am »
Does CB provides a COM server at all? OR just a DDE server?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: COM server
« Reply #1 on: November 25, 2010, 11:04:56 am »
C::B is portable, COM is not :)

Why would you need C::B as a COM object?
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: COM server
« Reply #2 on: November 25, 2010, 11:08:24 am »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: COM server
« Reply #3 on: November 25, 2010, 11:09:12 am »
Because I use C::B to edit and navigate through my code, but use VisualDSP++ to do the compiling and debug (DSP embedded C++ code).

So, I'd like to have a easy way to jump from one editor to the other. I already have a VBscript that I can call from C::B that sends me to he same file and line on the VisualDSP++ IDE.

Now I want to do the inverse, from the VisualDSP++ IDE have a script to jump to the same line and file on C::B...

Any ideas?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: COM server
« Reply #4 on: November 25, 2010, 01:30:44 pm »
Because I use C::B to edit and navigate through my code, but use VisualDSP++ to do the compiling and debug (DSP embedded C++ code).

So, I'd like to have a easy way to jump from one editor to the other. I already have a VBscript that I can call from C::B that sends me to he same file and line on the VisualDSP++ IDE.

Now I want to do the inverse, from the VisualDSP++ IDE have a script to jump to the same line and file on C::B...

Any ideas?
You can do it with DDE or more easy with calling C::B directly.

If you uncheck "Settings -> General settings -> Allow only one running ..." and check "Settings -> General settings -> Use an already running ..." and "Settings -> General settings -> Bring it on ...", you just have to call C::B with the appropriate parameters (e.g. --file=name[:line] to open a file in a running instance of C::B).
In this case all the DDE-stuff is done by C::B itself and you don't have to care about it.

The same also works on linux (but IPC via unix-socket is used in this case).

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: COM server
« Reply #5 on: November 25, 2010, 01:42:39 pm »
If you uncheck "Settings -> General settings -> Allow only one running ..." and check "Settings -> General settings -> Use an already running ..." and "Settings -> General settings -> Bring it on ...", you just have to call C::B with the appropriate parameters (e.g. --file=name[:line] to open a file in a running instance of C::B).
In this case all the DDE-stuff is done by C::B itself and you don't have to care about it.

Shouldn't it be CHECK "Settings -> General settings -> Allow only one running ..." ?? I don't want another one to be opened...

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: COM server
« Reply #6 on: November 25, 2010, 01:51:43 pm »
Actually, I don't see any difference here whether "Settings -> General settings -> Allow only one running ..." is checked or unchecked... I'm puzzled  :shock:

What should be the difference??

Another point, if C::B is minimized, it's not automatically maximized, it only gains the focus... Don't you think it should be automatically maximized in this case?

Btw, thank you very much for your reply, I really like this solution...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: COM server
« Reply #7 on: November 25, 2010, 01:57:16 pm »
If you do not run another instance of C::B, that does not allow DDE-/IPC (started with -nd/-ni), it does not matter.
But if you have a running instance of C::B, that does not run a DDE-/IPC-Server, it will fail, if "Allow only one running instance" is checked, because the signal can be send, but "nobody" will answer and no new instance can be started.

That's the normal situation for me, if I work in C::B on C::B.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: COM server
« Reply #8 on: November 25, 2010, 02:03:12 pm »
Actually, I don't see any difference here whether "Settings -> General settings -> Allow only one running ..." is checked or unchecked... I'm puzzled  :shock:

What should be the difference??

Another point, if C::B is minimized, it's not automatically maximized, it only gains the focus... Don't you think it should be automatically maximized in this case?

Btw, thank you very much for your reply, I really like this solution...

If "Bring it on top..." is checked the MainFrame of C::B is raised via the (wxWidgets) Raise()-function, but it seems not always work as expected:

Quote from: http://docs.wxwidgets.org/stable/wx_wxwindow.html#wxwindowraise
wxWindow::Raise

void Raise()

Raises the window to the top of the window hierarchy (z-order).

In current version of wxWidgets this works both for managed and child windows.