C++: how can i share messages between compiler and IDE?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 818 Views - Last Post: 20 November 2018 - 12:33 PM Rate Topic: ****- 2 Votes

#1 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 04:56 AM

the compiler, done by me, it's an exe. the IDE is another exe.
how can i share error messages and percent between the compiler and the IDE?
someone speaked about pop-up messages, but i don't know it.. can anyone explain more about it?
Is This A Good Question/Topic? 0
  • +

Replies To: C++: how can i share messages between compiler and IDE?

#2 andrewsw   User is offline

  • head thrashing
  • member icon

Reputation: 6645
  • View blog
  • Posts: 27,201
  • Joined: 12-December 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 05:50 AM

You need to provide a clear description.

Did you write the IDE as well?
If not, is the IDE expecting any external information?
What kind of information?
What would the IDE do with the information, and when?

Do you mean just information/text? Or for some event to be registered?
Was This Post Helpful? 1
  • +
  • -

#3 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 06:02 AM

i just need the error messages and the compiler work percent.
if you need more information just ask.
what i need is that the IDE gets, on real time, the compiler work percent and the error messages...
but maybe you have right... a register event... i'm learning what i can do, but i need more information too.
if i use a register event, how can i create 1 and use it?
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 08:07 AM

Which IDE to you want to communicate back to? I don't think there is a universal protocol between IDE's and compilers, so you'll need to customize for each IDE.
Was This Post Helpful? 1
  • +
  • -

#5 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 08:18 AM

skydiver do you mean that i must create\registe my own event and send it to my ide for i get the information?
Was This Post Helpful? 0
  • +
  • -

#6 Salem_c   User is online

  • void main'ers are DOOMED
  • member icon

Reputation: 2258
  • View blog
  • Posts: 4,347
  • Joined: 30-May 10

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 12:54 PM

Cross-posted here -> http://www.cplusplus...windows/246188/
Was This Post Helpful? 2
  • +
  • -

#7 andrewsw   User is offline

  • head thrashing
  • member icon

Reputation: 6645
  • View blog
  • Posts: 27,201
  • Joined: 12-December 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 01:09 PM

Despite requests you still haven't stated which ide you are referring to, whether it is your own creation.
Was This Post Helpful? 1
  • +
  • -

#8 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 01:55 PM

it's my own creation IDE... but seems that i can send the HWND by arguments and use it ;)
thank you so much for all.. thank you

honestly: is bad having the same question on some forums? i'm been rude with someone doing these?
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 04:02 PM

If you have complete control over both the IDE and the compiler you can use:
  • named pipe
  • shared memory
  • tcp stream
  • udp packets
  • HTTP
  • etc.

Trying to to send updates between your two components just by using Windows user defined messages, or WM_COPYDATA is the old fashioned way of doing thing from the 80's and early 90's.
Was This Post Helpful? 1
  • +
  • -

#10 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: C++: how can i share messages between compiler and IDE?

Posted 19 November 2018 - 04:26 PM

what we can learn... thank you so much
Was This Post Helpful? 0
  • +
  • -

#11 german-one   User is offline

  • New D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 32
  • Joined: 05-August 18

Re: C++: how can i share messages between compiler and IDE?

Posted 20 November 2018 - 03:36 AM

Usually the compiler is a console application. Have a look at CreatePipe. At the end of the page you'll find a link to an example of how to use it along with CreateProcess etc. That way you're able to call the compiler with the required arguments and to read its output to the defined stream.
Was This Post Helpful? 1
  • +
  • -

#12 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: C++: how can i share messages between compiler and IDE?

Posted 20 November 2018 - 07:31 AM

Yes, but unless the compiler happens to show its progress status (x percent completed) as part of it's console output, then the IDE won't have a clue as to what to show in it's GUI progress bar -- unless there is some intimate knowledge sharing between the IDE and and the compiler. E.g. The compiler sends N files in a particular order, and the compiler processes the files in that specific order and reports the files as part of its console output as each file is completed. Alternatively, the IDE could display something akin to the Bittorrent UI which shows a map/grid of what parts have been completed and it marks of sections of the map/grid as it gets reports from the compiler.

Personally, I would write the compiler's core as DLL. The compiler executable simply loads the DLL. The IDE can also load the DLL and simply call the compiler code in process instead of trying to do all this interprocess communication.
Was This Post Helpful? 2
  • +
  • -

#13 german-one   User is offline

  • New D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 32
  • Joined: 05-August 18

Re: C++: how can i share messages between compiler and IDE?

Posted 20 November 2018 - 08:30 AM

Hmm, I agree. But I'm wondering how IDEs like Code::Blocks work. Do you think they have any other chance than reading the console output of the compiler? As to the progress, I think it could be still possible. Some command line utilities use a single carriage return character to overwrite the progress in the same line as a percentage value.
Was This Post Helpful? 1
  • +
  • -

#14 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: C++: how can i share messages between compiler and IDE?

Posted 20 November 2018 - 11:57 AM

Skydiver: "Personally, I would write the compiler's core as DLL. The compiler executable simply loads the DLL. The IDE can also load the DLL and simply call the compiler code in process instead of trying to do all this interprocess communication."
for the moment my compiler it's a class... it can be updated been a DLL.. but i'm totally new with DLL's.
do you have something for i start?
Was This Post Helpful? 0
  • +
  • -

#15 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: C++: how can i share messages between compiler and IDE?

Posted 20 November 2018 - 12:20 PM

Walkthrough: Creating and Using a Dynamic Link Library (C++)
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2