[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Embedded Ruby in a MSVC++ project?

Lee Fisher

9/18/2003 10:39:00 PM

| I'm working on a project in MS Visual C++, unfortunately the code is
| completely tied to that environment and that IDE so I'm trapped.

Visual Studio has an SDK to interface to the IDE, for doing tool
plugins, etc. Recently, the VS team added a new free level to this VSIP
program. Previously, the VSIP SDK was only available for a fee. This
would only be interesting if the answer to this embedding Ruby question
involves tweaking VS.
http://msdn.microsoft.com/vstudio...
http://www.vs...
http://www.vsippartners.com/programove...

Also, you can extend VS w/o having to use VSIP in a few ways.
http://msdn.microsoft.com/vstudio/using/understand/tools/de...

The microsoft.public.vsnet.general newsgroup is the place to discuss
topics like this. My apologies that some of the people on that forum
might not know much about Ruby. :-)
http://msdn.microsoft.com/vstudio/support/community/de...

Hope this is helps,
Lee

3 Answers

Ben Giddings

9/18/2003 11:43:00 PM

0

Lee Fisher wrote:
> Visual Studio has an SDK to interface to the IDE, for doing tool
> plugins, etc.

I think you misunderstand, I don''t want to modify the IDE at all, I want to
embed Ruby in my program which is compiled using the IDE. What I meant
when I said that it was tied to that environment was that it uses a lot of
Microsoftisms in the code and other things that make it unportable code.

So, I''m stuck using Visual C++ for this project, but I still want to embed
Ruby in the executable.

Looking around the directories, so far I found two .lib files that appear
to be what are needed to do this. I used the non-static one (the static
one caused errors about multiply defined functions), and once I moved the
.dll I found in the ruby/bin directory into the project directory things
compiled.

In fact, things seem to be working well, but I can''t seem to load the Ruby
file. I''ve tried with the file in the project directory, as well as in the
Debug directory, but Ruby doesn''t seem to find it. Any suggestions on how
I can figure out Ruby''s load-path? (Normally I''d do rb_p("$:") or
something similar, but since this is a GUI project I don''t know where
stdout/stderr go).

Thanks,

Ben



Clifford Heath

9/18/2003 11:59:00 PM

0

Lee Fisher wrote:
> Recently, the VS team added a new free level to this VSIP program.

That''s great news, thanks Lee.

I have a much simpler VS question. In Tools->Options->Text Editor,
there is a list of supported languages. You can set the indenting
depths and tab usage for each language. Lots of folk here are editing
Ruby using VS, but there doesn''t appear to be a way to add Ruby as
a recognised language - obviously not for debugging purposes but even
for editing. Anyone have a clue how to fix this? It seems amazing to
me that a sophisticated IDE like this doesn''t have extensible editor
settings...

Clifford.

nobu.nokada

9/24/2003 6:02:00 AM

0

Hi,

At Fri, 19 Sep 2003 08:43:07 +0900,
Ben Giddings wrote:
> In fact, things seem to be working well, but I can''t seem to load the Ruby
> file. I''ve tried with the file in the project directory, as well as in the
> Debug directory, but Ruby doesn''t seem to find it. Any suggestions on how
> I can figure out Ruby''s load-path? (Normally I''d do rb_p("$:") or
> something similar, but since this is a GUI project I don''t know where
> stdout/stderr go).

Do you call rb_init_loadpath()? And you will need to call
$stdout.reopen to use rb_p().

--
Nobu Nakada