# Ruby and C++ exe

**URL:** <https://www.ruby-forum.com/t/ruby-and-c-exe/175450>\
**Category:** Ruby\
**Created:** [September 14, 2009, 6:39am UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450 "2009-09-14T06:39:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 14, 2009, 6:39am UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450/1 "2009-09-14T06:39:25Z")

</div>

Hi,

I am new to Ruby , but have a few years of experience in C++.

My requirement is to create automated test (scripts) that will do the  
testing (mainly acceptance test) of our application (an Exe project  
created on C++). I intend to use Ruby for the automated test.

My concerns are as follows.

How can Ruby connect to my application (exe project on C++). Do I  
require to have a COM interface exposed from my exe application so that  
Ruby can call the interface methods from out of process and execute the  
test?  
Are there any easier alternatives?

Please advice.

Regards,  
George

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 14, 2009, 9:23am UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450/2 "2009-09-14T09:23:39Z")

</div>

Hi,

> Ruby can call the interface methods from out of process and execute the  
> test?  
> Are there any easier alternatives?

[http://www.swig.org/](http://www.swig.org/)

Try this  
Kev

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 14, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450/3 "2009-09-14T13:27:48Z")

</div>

On Mon, Sep 14, 2009 at 3:22 AM, Kevin J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > How can Ruby connect to my application (exe project on C++). Do I

And as an (IMO) tons nicer alternative to SWIG, please give Rice a try:

> **[GitHub - cout/rice: My "Ruby interface for C++ extensions" repo (this is not...](https://github.com/cout/rice)**
>
> My "Ruby interface for C++ extensions" repo (this is not the one you want, probably -- see http://github.com/jameskilton/rice instead) - GitHub - cout/rice: My "Ruby interface for C...

Of course, these might be mis-reading your initial question. Are you  
talking  
about connecting Ruby to an already running process and running tests on  
said process? If so, there might be some stuff in the win32- gems but  
I’ve  
never done this specifically so I’m not sure.

Jason

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 14, 2009, 11:39pm UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450/4 "2009-09-14T23:39:53Z")

</div>

> My requirement is to create automated test (scripts) that will do the  
> testing (mainly acceptance test) of our application (an Exe project  
> created on C++). I intend to use Ruby for the automated test.

SWIG and Rice are good options, but if you want a fast cheap (not the  
safest way of doing this) option… pipe the output of your executable  
into ruby.

system(“executablename.exe”) | manipulate output here.

Again, not recommended but it would still work.

- Mac

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 20, 2009, 10:31am UTC](https://www.ruby-forum.com/t/ruby-and-c-exe/175450/5 "2009-09-20T10:31:03Z")

</div>

win32ole might be useful if your application already has COM interface  
ready  
read more about win32ole here at  
[http://www.rubycentral.com/pickaxe/win32.html](http://www.rubycentral.com/pickaxe/win32.html)

* * *

From: George T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: ruby-talk ML [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Monday, 14 September, 2009 4:39:30 AM  
Subject: Ruby and C++ exe

Hi,

I am new to Ruby , but have a few years of experience in C++.

My requirement is to create automated test (scripts) that will do the  
testing (mainly acceptance test) of our application (an Exe project  
created on C++). I intend to use Ruby for the automated test.

My concerns are as follows.

How can Ruby connect to my application (exe project on C++). Do I  
require to have a COM interface exposed from my exe application so that  
Ruby can call the interface methods from out of process and execute the  
test?  
Are there any easier alternatives?

Please advice.

## Regards, George

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

```
  Now, send attachments up to 25MB with Yahoo! India Mail. Learn 

```

how. [Yahoo Mail](http://in.overview.mail.yahoo.com/photos)
