hardknocks
hardknocks

Reputation: 155

Requirements for .NET .dll to be accessible by Ruby WIN32OLE

My question is very similar to Calling a C# .dll from Ruby via COM

I am a developer working in Ruby / WebDriver and have had a lot of success automating our web applications. I would like to send notifications via our email service and to do so, the body of my email must be encrypted by a cipher dll written in vb.Net.

My question is, what part or attribute of the dll file corresponds to the OLE server parameter of the 'new' method? Specifically, if I'm creating an object new_ole_thing = WIN32OLE.new('whatgoes.here')

For excel, it's (Excel.Application) and in the previous linked question, it's ('DllAttempt.CsharpDll'). The second part of my question is where would that dll ideally be located in the file structure of my application? Same directory? Or how do I point to it / require it?

Also, the file was just re-compiled with COM available.

Thanks!

Upvotes: 2

Views: 496

Answers (1)

gbjbaanb
gbjbaanb

Reputation: 52689

If you create a COM dll using any technology it'll get registered in the registry. You then use the "progid" to look up the dll location in the registry using standard routines in the os.

A progid is the text name. You can view the details using oleview (comes with visual studio and possibly the windows SDK)

The progid will be set in the VB code that defines the interface of the class exposed as a com object. In c# it's an attribute you specify - called ProgId.

Upvotes: 3

Related Questions