Ruby + COM + OLEGEN

Hello.

I have this TLB, and when I run OLEGEN
(\doc\ruby\ruby-1.8.6\sample\win32ole) I obtain a file that is either
incomplete or I’m missing something. It only generates only one class
and 5 modules. If so, how can I run, for example, AcdEvent’s Connect()
method since there’s no class to instantiate AcdEvent objects? When I
import the same TLB into VisualStudio, I get a DLL with 3 instantiable
classes (AcdAutomationServer, AcdEvent and AcdObject). Is this a
limitation of OLEGEN?

I have attached to this issue the TLB file in question, if anyone can
tell me how to do this, I would be very, very, very thankful! :smiley:

Thanks for your time!

Bruno Antunes wrote:

Hello.

I have this TLB, and when I run OLEGEN
(\doc\ruby\ruby-1.8.6\sample\win32ole) I obtain a file that is either
incomplete or I’m missing something. It only generates only one class
and 5 modules. If so, how can I run, for example, AcdEvent’s Connect()
method since there’s no class to instantiate AcdEvent objects? When I
import the same TLB into VisualStudio, I get a DLL with 3 instantiable
classes (AcdAutomationServer, AcdEvent and AcdObject). Is this a
limitation of OLEGEN?

I have attached to this issue the TLB file in question, if anyone can
tell me how to do this, I would be very, very, very thankful! :smiley:

Thanks for your time!

(one thing: posting here since my post to the Google group didn’t went
through…)

Hello,

At 09/10/2009 11:17 PM, Bruno Antunes wrote:

I have this TLB, and when I run OLEGEN
(\doc\ruby\ruby-1.8.6\sample\win32ole) I obtain a file that is either
incomplete or I’m missing something. It only generates only one class
and 5 modules. If so, how can I run, for example, AcdEvent’s Connect()
method since there’s no class to instantiate AcdEvent objects? When I
import the same TLB into VisualStudio, I get a DLL with 3 instantiable
classes (AcdAutomationServer, AcdEvent and AcdObject). Is this a
limitation of OLEGEN?

OLEGEN is for early binding and not tested well.
Direct Instantiating object from class made by OLEGEN
is not stable.

Do you know how to instantiate object from these classes in VBScript?
For example, in VBScript:
Set acdEvent = CreateObject(“ABC.XYZ”)
then in Win32OLE:
acdEvent = WIN32OLE.new(“ABC.XYZ”)

Regards,
Masaki S.

Masaki S. wrote:

Hello,

At 09/10/2009 11:17 PM, Bruno Antunes wrote:

I have this TLB, and when I run OLEGEN
(\doc\ruby\ruby-1.8.6\sample\win32ole) I obtain a file that is either
incomplete or I’m missing something. It only generates only one class
and 5 modules. If so, how can I run, for example, AcdEvent’s Connect()
method since there’s no class to instantiate AcdEvent objects? When I
import the same TLB into VisualStudio, I get a DLL with 3 instantiable
classes (AcdAutomationServer, AcdEvent and AcdObject). Is this a
limitation of OLEGEN?

OLEGEN is for early binding and not tested well.
Direct Instantiating object from class made by OLEGEN
is not stable.

Do you know how to instantiate object from these classes in VBScript?
For example, in VBScript:
Set acdEvent = CreateObject(“ABC.XYZ”)
then in Win32OLE:
acdEvent = WIN32OLE.new(“ABC.XYZ”)

Regards,
Masaki S.

The problem is not creating the CCS application object - it’s the only
class that I can from OLEGEN’s output. However, AcdEvent should also be
a class and I can’t instantiate any objects of that type, since OLEGEN’s
output only gives me a module :expressionless:

Regards,
Bruno Antunes

Hello,

At 09/11/2009 11:11 PM, Bruno Antunes wrote:

class that I can from OLEGEN’s output. However, AcdEvent should also be
a class and I can’t instantiate any objects of that type, since OLEGEN’s
output only gives me a module :expressionless:

What is the result of the following code?

require ‘win32ole’
WIN32OLE_TYPE.ole_classes(“Ccs.tlb”).each do |k|
puts k.name
puts k.ole_type
puts k.guid
puts k.progid
puts “—”
end

If k.progid or k.guid is nil, then OLEGEN outputs a module.
Because Win32OLE does not know how to instantiate a Class
without guid and progid.

Anyway, if you could instantiate AcdEvent object in VBScript,
then you could instantiate AcdEvent object in Win32OLE.
If you could not instantiate it in VBScript,
then you could not instantiate it in Win32OLE.
And OLEGEN’s output depends on Win32OLE, so OLEGEN’s output is same.

You should ask the provider of CCS how to instantiate
AcdEvent in VBScript.

Regards,
Masaki S.