win32ole 1.8.9 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +4 -0
- data/{LICENSE.txt → BSDL} +3 -3
- data/COPYING +56 -0
- data/ext/win32ole/.document +1 -0
- data/ext/win32ole/win32ole.c +70 -134
- data/ext/win32ole/win32ole_error.c +13 -4
- data/ext/win32ole/win32ole_event.c +26 -25
- data/ext/win32ole/win32ole_method.c +64 -63
- data/ext/win32ole/win32ole_param.c +57 -56
- data/ext/win32ole/win32ole_record.c +26 -25
- data/ext/win32ole/win32ole_type.c +73 -69
- data/ext/win32ole/win32ole_typelib.c +38 -37
- data/ext/win32ole/win32ole_variable.c +19 -18
- data/ext/win32ole/win32ole_variant.c +34 -33
- data/ext/win32ole/win32ole_variant_m.c +7 -5
- data/lib/win32ole/property.rb +15 -3
- data/lib/win32ole.rb +1 -2
- data/{ext/win32ole/sample → sample/win32ole}/olegen.rb +2 -2
- metadata +22 -31
- data/.git-blame-ignore-revs +0 -7
- data/.github/dependabot.yml +0 -6
- data/.github/workflows/windows.yml +0 -24
- data/.gitignore +0 -8
- data/Gemfile +0 -7
- data/Rakefile +0 -19
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/rakelib/changelogs.rake +0 -34
- data/rakelib/epoch.rake +0 -5
- data/rakelib/sync_tool.rake +0 -6
- data/rakelib/version.rake +0 -45
- data/win32ole.gemspec +0 -22
- /data/{ext/win32ole/sample → sample/win32ole}/excel1.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/excel2.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/excel3.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/ie.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/ieconst.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/ienavi.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/ienavi2.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/oledirs.rb +0 -0
- /data/{ext/win32ole/sample → sample/win32ole}/xml.rb +0 -0
@@ -54,9 +54,9 @@ static const rb_data_type_t oletype_datatype = {
|
|
54
54
|
};
|
55
55
|
|
56
56
|
/*
|
57
|
-
* Document-class:
|
57
|
+
* Document-class: WIN32OLE::Type
|
58
58
|
*
|
59
|
-
*
|
59
|
+
* +WIN32OLE::Type+ objects represent OLE type library information.
|
60
60
|
*/
|
61
61
|
|
62
62
|
static void
|
@@ -106,10 +106,12 @@ ole_type_from_itypeinfo(ITypeInfo *pTypeInfo)
|
|
106
106
|
|
107
107
|
/*
|
108
108
|
* call-seq:
|
109
|
-
*
|
109
|
+
* ole_classes(typelib)
|
110
110
|
*
|
111
|
-
* Returns array of
|
112
|
-
*
|
111
|
+
* Returns array of WIN32OLE::Type objects defined by the <i>typelib</i> type library.
|
112
|
+
*
|
113
|
+
* This method will be OBSOLETE.
|
114
|
+
* Use <code>WIN32OLE::TypeLib.new(typelib).ole_classes</code> instead.
|
113
115
|
*/
|
114
116
|
static VALUE
|
115
117
|
foletype_s_ole_classes(VALUE self, VALUE typelib)
|
@@ -118,8 +120,8 @@ foletype_s_ole_classes(VALUE self, VALUE typelib)
|
|
118
120
|
|
119
121
|
/*
|
120
122
|
rb_warn("%s is obsolete; use %s instead.",
|
121
|
-
"
|
122
|
-
"
|
123
|
+
"WIN32OLE::Type.ole_classes",
|
124
|
+
"WIN32OLE::TypeLib.new(typelib).ole_types");
|
123
125
|
*/
|
124
126
|
obj = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("new"), 1, typelib);
|
125
127
|
return rb_funcall(obj, rb_intern("ole_types"), 0);
|
@@ -127,10 +129,12 @@ foletype_s_ole_classes(VALUE self, VALUE typelib)
|
|
127
129
|
|
128
130
|
/*
|
129
131
|
* call-seq:
|
130
|
-
*
|
132
|
+
* typelibs
|
131
133
|
*
|
132
134
|
* Returns array of type libraries.
|
133
|
-
*
|
135
|
+
*
|
136
|
+
* This method will be OBSOLETE.
|
137
|
+
* Use <code>WIN32OLE::TypeLib.typelibs.collect{|t| t.name}</code> instead.
|
134
138
|
*
|
135
139
|
*/
|
136
140
|
static VALUE
|
@@ -138,15 +142,15 @@ foletype_s_typelibs(VALUE self)
|
|
138
142
|
{
|
139
143
|
/*
|
140
144
|
rb_warn("%s is obsolete. use %s instead.",
|
141
|
-
"
|
142
|
-
"
|
145
|
+
"WIN32OLE::Type.typelibs",
|
146
|
+
"WIN32OLE::TypeLib.typelibs.collect{t|t.name}");
|
143
147
|
*/
|
144
|
-
return rb_eval_string("
|
148
|
+
return rb_eval_string("WIN32OLE::TypeLib.typelibs.collect{|t|t.name}");
|
145
149
|
}
|
146
150
|
|
147
151
|
/*
|
148
152
|
* call-seq:
|
149
|
-
*
|
153
|
+
* progids
|
150
154
|
*
|
151
155
|
* Returns array of ProgID.
|
152
156
|
*/
|
@@ -214,7 +218,6 @@ create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name)
|
|
214
218
|
static VALUE
|
215
219
|
oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
|
216
220
|
{
|
217
|
-
|
218
221
|
long count;
|
219
222
|
int i;
|
220
223
|
HRESULT hr;
|
@@ -245,14 +248,14 @@ oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
|
|
245
248
|
|
246
249
|
/*
|
247
250
|
* call-seq:
|
248
|
-
*
|
251
|
+
* new(typelib, ole_class) -> WIN32OLE::Type object
|
249
252
|
*
|
250
|
-
* Returns a new
|
253
|
+
* Returns a new WIN32OLE::Type object.
|
251
254
|
* The first argument <i>typelib</i> specifies OLE type library name.
|
252
255
|
* The second argument specifies OLE class name.
|
253
256
|
*
|
254
|
-
*
|
255
|
-
* # =>
|
257
|
+
* WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
258
|
+
* # => WIN32OLE::Type object of Application class of Excel.
|
256
259
|
*/
|
257
260
|
static VALUE
|
258
261
|
foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
|
@@ -284,10 +287,10 @@ foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
|
|
284
287
|
|
285
288
|
/*
|
286
289
|
* call-seq:
|
287
|
-
*
|
290
|
+
* name #=> OLE type name
|
288
291
|
*
|
289
292
|
* Returns OLE type name.
|
290
|
-
* tobj =
|
293
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
291
294
|
* puts tobj.name # => Application
|
292
295
|
*/
|
293
296
|
static VALUE
|
@@ -344,10 +347,10 @@ ole_ole_type(ITypeInfo *pTypeInfo)
|
|
344
347
|
|
345
348
|
/*
|
346
349
|
* call-seq:
|
347
|
-
*
|
350
|
+
* ole_type #=> OLE type string.
|
348
351
|
*
|
349
352
|
* returns type of OLE class.
|
350
|
-
* tobj =
|
353
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
351
354
|
* puts tobj.ole_type # => Class
|
352
355
|
*/
|
353
356
|
static VALUE
|
@@ -378,10 +381,10 @@ ole_type_guid(ITypeInfo *pTypeInfo)
|
|
378
381
|
|
379
382
|
/*
|
380
383
|
* call-seq:
|
381
|
-
*
|
384
|
+
* guid #=> GUID
|
382
385
|
*
|
383
386
|
* Returns GUID.
|
384
|
-
* tobj =
|
387
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
385
388
|
* puts tobj.guid # => {00024500-0000-0000-C000-000000000046}
|
386
389
|
*/
|
387
390
|
static VALUE
|
@@ -412,10 +415,10 @@ ole_type_progid(ITypeInfo *pTypeInfo)
|
|
412
415
|
|
413
416
|
/*
|
414
417
|
* call-seq:
|
415
|
-
*
|
418
|
+
* progid #=> ProgID
|
416
419
|
*
|
417
420
|
* Returns ProgID if it exists. If not found, then returns nil.
|
418
|
-
* tobj =
|
421
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
419
422
|
* puts tobj.progid # => Excel.Application.9
|
420
423
|
*/
|
421
424
|
static VALUE
|
@@ -446,10 +449,10 @@ ole_type_visible(ITypeInfo *pTypeInfo)
|
|
446
449
|
|
447
450
|
/*
|
448
451
|
* call-seq:
|
449
|
-
*
|
452
|
+
* visible? #=> true or false
|
450
453
|
*
|
451
454
|
* Returns true if the OLE class is public.
|
452
|
-
* tobj =
|
455
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application')
|
453
456
|
* puts tobj.visible # => true
|
454
457
|
*/
|
455
458
|
static VALUE
|
@@ -475,10 +478,10 @@ ole_type_major_version(ITypeInfo *pTypeInfo)
|
|
475
478
|
|
476
479
|
/*
|
477
480
|
* call-seq:
|
478
|
-
*
|
481
|
+
* major_version
|
479
482
|
*
|
480
483
|
* Returns major version.
|
481
|
-
* tobj =
|
484
|
+
* tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents')
|
482
485
|
* puts tobj.major_version # => 8
|
483
486
|
*/
|
484
487
|
static VALUE
|
@@ -504,10 +507,10 @@ ole_type_minor_version(ITypeInfo *pTypeInfo)
|
|
504
507
|
|
505
508
|
/*
|
506
509
|
* call-seq:
|
507
|
-
*
|
510
|
+
* minor_version #=> OLE minor version
|
508
511
|
*
|
509
512
|
* Returns minor version.
|
510
|
-
* tobj =
|
513
|
+
* tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents')
|
511
514
|
* puts tobj.minor_version # => 2
|
512
515
|
*/
|
513
516
|
static VALUE
|
@@ -533,10 +536,10 @@ ole_type_typekind(ITypeInfo *pTypeInfo)
|
|
533
536
|
|
534
537
|
/*
|
535
538
|
* call-seq:
|
536
|
-
*
|
539
|
+
* typekind #=> number of type.
|
537
540
|
*
|
538
541
|
* Returns number which represents type.
|
539
|
-
* tobj =
|
542
|
+
* tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents')
|
540
543
|
* puts tobj.typekind # => 4
|
541
544
|
*
|
542
545
|
*/
|
@@ -561,10 +564,10 @@ ole_type_helpstring(ITypeInfo *pTypeInfo)
|
|
561
564
|
|
562
565
|
/*
|
563
566
|
* call-seq:
|
564
|
-
*
|
567
|
+
* helpstring #=> help string.
|
565
568
|
*
|
566
569
|
* Returns help string.
|
567
|
-
* tobj =
|
570
|
+
* tobj = WIN32OLE::Type.new('Microsoft Internet Controls', 'IWebBrowser')
|
568
571
|
* puts tobj.helpstring # => Web Browser interface
|
569
572
|
*/
|
570
573
|
static VALUE
|
@@ -594,10 +597,10 @@ ole_type_src_type(ITypeInfo *pTypeInfo)
|
|
594
597
|
|
595
598
|
/*
|
596
599
|
* call-seq:
|
597
|
-
*
|
600
|
+
* src_type #=> OLE source class
|
598
601
|
*
|
599
602
|
* Returns source class when the OLE class is 'Alias'.
|
600
|
-
* tobj =
|
603
|
+
* tobj = WIN32OLE::Type.new('Microsoft Office 9.0 Object Library', 'MsoRGBType')
|
601
604
|
* puts tobj.src_type # => I4
|
602
605
|
*
|
603
606
|
*/
|
@@ -622,10 +625,10 @@ ole_type_helpfile(ITypeInfo *pTypeInfo)
|
|
622
625
|
|
623
626
|
/*
|
624
627
|
* call-seq:
|
625
|
-
*
|
628
|
+
* helpfile
|
626
629
|
*
|
627
630
|
* Returns helpfile path. If helpfile is not found, then returns nil.
|
628
|
-
* tobj =
|
631
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
|
629
632
|
* puts tobj.helpfile # => C:\...\VBAXL9.CHM
|
630
633
|
*
|
631
634
|
*/
|
@@ -650,10 +653,10 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo)
|
|
650
653
|
|
651
654
|
/*
|
652
655
|
* call-seq:
|
653
|
-
*
|
656
|
+
* helpcontext
|
654
657
|
*
|
655
658
|
* Returns helpcontext. If helpcontext is not found, then returns nil.
|
656
|
-
* tobj =
|
659
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
|
657
660
|
* puts tobj.helpfile # => 131185
|
658
661
|
*/
|
659
662
|
static VALUE
|
@@ -701,11 +704,11 @@ ole_variables(ITypeInfo *pTypeInfo)
|
|
701
704
|
|
702
705
|
/*
|
703
706
|
* call-seq:
|
704
|
-
*
|
707
|
+
* variables
|
705
708
|
*
|
706
|
-
* Returns array of
|
709
|
+
* Returns array of WIN32OLE::Variable objects which represent variables
|
707
710
|
* defined in OLE class.
|
708
|
-
* tobj =
|
711
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
|
709
712
|
* vars = tobj.variables
|
710
713
|
* vars.each do |v|
|
711
714
|
* puts "#{v.name} = #{v.value}"
|
@@ -728,11 +731,11 @@ foletype_variables(VALUE self)
|
|
728
731
|
|
729
732
|
/*
|
730
733
|
* call-seq:
|
731
|
-
*
|
734
|
+
* ole_methods # the array of WIN32OLE::Method objects.
|
732
735
|
*
|
733
|
-
* Returns array of
|
736
|
+
* Returns array of WIN32OLE::Method objects which represent OLE method defined in
|
734
737
|
* OLE type library.
|
735
|
-
* tobj =
|
738
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
|
736
739
|
* methods = tobj.ole_methods.collect{|m|
|
737
740
|
* m.name
|
738
741
|
* }
|
@@ -747,11 +750,11 @@ foletype_methods(VALUE self)
|
|
747
750
|
|
748
751
|
/*
|
749
752
|
* call-seq:
|
750
|
-
*
|
753
|
+
* ole_typelib
|
751
754
|
*
|
752
|
-
* Returns the
|
755
|
+
* Returns the WIN32OLE::TypeLib object which is including the WIN32OLE::Type
|
753
756
|
* object. If it is not found, then returns nil.
|
754
|
-
* tobj =
|
757
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
|
755
758
|
* puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library'
|
756
759
|
*/
|
757
760
|
static VALUE
|
@@ -804,11 +807,11 @@ ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags)
|
|
804
807
|
|
805
808
|
/*
|
806
809
|
* call-seq:
|
807
|
-
*
|
810
|
+
* implemented_ole_types
|
808
811
|
*
|
809
|
-
* Returns the array of
|
812
|
+
* Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type
|
810
813
|
* object.
|
811
|
-
* tobj =
|
814
|
+
* tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
|
812
815
|
* p tobj.implemented_ole_types # => [_Worksheet, DocEvents]
|
813
816
|
*/
|
814
817
|
static VALUE
|
@@ -820,13 +823,13 @@ foletype_impl_ole_types(VALUE self)
|
|
820
823
|
|
821
824
|
/*
|
822
825
|
* call-seq:
|
823
|
-
*
|
826
|
+
* source_ole_types
|
824
827
|
*
|
825
|
-
* Returns the array of
|
828
|
+
* Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type
|
826
829
|
* object and having IMPLTYPEFLAG_FSOURCE.
|
827
|
-
* tobj =
|
830
|
+
* tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer")
|
828
831
|
* p tobj.source_ole_types
|
829
|
-
* # => [#<
|
832
|
+
* # => [#<WIN32OLE::Type:DWebBrowserEvents2>, #<WIN32OLE::Type:DWebBrowserEvents>]
|
830
833
|
*/
|
831
834
|
static VALUE
|
832
835
|
foletype_source_ole_types(VALUE self)
|
@@ -837,12 +840,12 @@ foletype_source_ole_types(VALUE self)
|
|
837
840
|
|
838
841
|
/*
|
839
842
|
* call-seq:
|
840
|
-
*
|
843
|
+
* default_event_sources
|
841
844
|
*
|
842
|
-
* Returns the array of
|
845
|
+
* Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type
|
843
846
|
* object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT.
|
844
|
-
* tobj =
|
845
|
-
* p tobj.default_event_sources # => [#<
|
847
|
+
* tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer")
|
848
|
+
* p tobj.default_event_sources # => [#<WIN32OLE::Type:DWebBrowserEvents2>]
|
846
849
|
*/
|
847
850
|
static VALUE
|
848
851
|
foletype_default_event_sources(VALUE self)
|
@@ -853,13 +856,13 @@ foletype_default_event_sources(VALUE self)
|
|
853
856
|
|
854
857
|
/*
|
855
858
|
* call-seq:
|
856
|
-
*
|
859
|
+
* default_ole_types
|
857
860
|
*
|
858
|
-
* Returns the array of
|
861
|
+
* Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type
|
859
862
|
* object and having IMPLTYPEFLAG_FDEFAULT.
|
860
|
-
* tobj =
|
863
|
+
* tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer")
|
861
864
|
* p tobj.default_ole_types
|
862
|
-
* # => [#<
|
865
|
+
* # => [#<WIN32OLE::Type:IWebBrowser2>, #<WIN32OLE::Type:DWebBrowserEvents2>]
|
863
866
|
*/
|
864
867
|
static VALUE
|
865
868
|
foletype_default_ole_types(VALUE self)
|
@@ -870,17 +873,17 @@ foletype_default_ole_types(VALUE self)
|
|
870
873
|
|
871
874
|
/*
|
872
875
|
* call-seq:
|
873
|
-
*
|
876
|
+
* inspect -> String
|
874
877
|
*
|
875
878
|
* Returns the type name with class name.
|
876
879
|
*
|
877
880
|
* ie = WIN32OLE.new('InternetExplorer.Application')
|
878
|
-
* ie.ole_type.inspect => #<
|
881
|
+
* ie.ole_type.inspect => #<WIN32OLE::Type:IWebBrowser2>
|
879
882
|
*/
|
880
883
|
static VALUE
|
881
884
|
foletype_inspect(VALUE self)
|
882
885
|
{
|
883
|
-
return default_inspect(self, "
|
886
|
+
return default_inspect(self, "WIN32OLE::Type");
|
884
887
|
}
|
885
888
|
|
886
889
|
VALUE cWIN32OLE_TYPE;
|
@@ -888,6 +891,7 @@ VALUE cWIN32OLE_TYPE;
|
|
888
891
|
void Init_win32ole_type(void)
|
889
892
|
{
|
890
893
|
cWIN32OLE_TYPE = rb_define_class_under(cWIN32OLE, "Type", rb_cObject);
|
894
|
+
/* Alias of WIN32OLE::Type, for the backward compatibility */
|
891
895
|
rb_define_const(rb_cObject, "WIN32OLE_TYPE", cWIN32OLE_TYPE);
|
892
896
|
rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
|
893
897
|
rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0);
|
@@ -127,19 +127,19 @@ ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
|
|
127
127
|
}
|
128
128
|
|
129
129
|
/*
|
130
|
-
* Document-class:
|
130
|
+
* Document-class: WIN32OLE::TypeLib
|
131
131
|
*
|
132
|
-
*
|
132
|
+
* +WIN32OLE::TypeLib+ objects represent OLE tyblib information.
|
133
133
|
*/
|
134
134
|
|
135
135
|
/*
|
136
136
|
* call-seq:
|
137
137
|
*
|
138
|
-
*
|
138
|
+
* typelibs
|
139
139
|
*
|
140
|
-
* Returns the array of
|
140
|
+
* Returns the array of WIN32OLE::TypeLib object.
|
141
141
|
*
|
142
|
-
* tlibs =
|
142
|
+
* tlibs = WIN32OLE::TypeLib.typelibs
|
143
143
|
*
|
144
144
|
*/
|
145
145
|
static VALUE
|
@@ -364,9 +364,9 @@ oletypelib_search_registry2(VALUE self, VALUE args)
|
|
364
364
|
|
365
365
|
/*
|
366
366
|
* call-seq:
|
367
|
-
*
|
367
|
+
* new(typelib [, version1, version2]) -> WIN32OLE::TypeLib object
|
368
368
|
*
|
369
|
-
* Returns a new
|
369
|
+
* Returns a new WIN32OLE::TypeLib object.
|
370
370
|
*
|
371
371
|
* The first argument <i>typelib</i> specifies OLE type library name or GUID or
|
372
372
|
* OLE library file.
|
@@ -376,11 +376,11 @@ oletypelib_search_registry2(VALUE self, VALUE args)
|
|
376
376
|
* If the first argument is type library name, then the second and third argument
|
377
377
|
* are ignored.
|
378
378
|
*
|
379
|
-
* tlib1 =
|
380
|
-
* tlib2 =
|
381
|
-
* tlib3 =
|
382
|
-
* tlib4 =
|
383
|
-
* tlib5 =
|
379
|
+
* tlib1 = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
380
|
+
* tlib2 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}')
|
381
|
+
* tlib3 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}', 1.3)
|
382
|
+
* tlib4 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}', 1, 3)
|
383
|
+
* tlib5 = WIN32OLE::TypeLib.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL")
|
384
384
|
* puts tlib1.name # -> 'Microsoft Excel 9.0 Object Library'
|
385
385
|
* puts tlib2.name # -> 'Microsoft Excel 9.0 Object Library'
|
386
386
|
* puts tlib3.name # -> 'Microsoft Excel 9.0 Object Library'
|
@@ -428,11 +428,11 @@ foletypelib_initialize(VALUE self, VALUE args)
|
|
428
428
|
|
429
429
|
/*
|
430
430
|
* call-seq:
|
431
|
-
*
|
431
|
+
* guid -> The guid string.
|
432
432
|
*
|
433
433
|
* Returns guid string which specifies type library.
|
434
434
|
*
|
435
|
-
* tlib =
|
435
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
436
436
|
* guid = tlib.guid # -> '{00020813-0000-0000-C000-000000000046}'
|
437
437
|
*/
|
438
438
|
static VALUE
|
@@ -456,11 +456,11 @@ foletypelib_guid(VALUE self)
|
|
456
456
|
|
457
457
|
/*
|
458
458
|
* call-seq:
|
459
|
-
*
|
459
|
+
* name -> The type library name
|
460
460
|
*
|
461
461
|
* Returns the type library name.
|
462
462
|
*
|
463
|
-
* tlib =
|
463
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
464
464
|
* name = tlib.name # -> 'Microsoft Excel 9.0 Object Library'
|
465
465
|
*/
|
466
466
|
static VALUE
|
@@ -500,11 +500,11 @@ make_version_str(VALUE major, VALUE minor)
|
|
500
500
|
|
501
501
|
/*
|
502
502
|
* call-seq:
|
503
|
-
*
|
503
|
+
* version -> The type library version String object.
|
504
504
|
*
|
505
505
|
* Returns the type library version.
|
506
506
|
*
|
507
|
-
* tlib =
|
507
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
508
508
|
* puts tlib.version #-> "1.3"
|
509
509
|
*/
|
510
510
|
static VALUE
|
@@ -523,11 +523,11 @@ foletypelib_version(VALUE self)
|
|
523
523
|
|
524
524
|
/*
|
525
525
|
* call-seq:
|
526
|
-
*
|
526
|
+
* major_version -> The type library major version.
|
527
527
|
*
|
528
528
|
* Returns the type library major version.
|
529
529
|
*
|
530
|
-
* tlib =
|
530
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
531
531
|
* puts tlib.major_version # -> 1
|
532
532
|
*/
|
533
533
|
static VALUE
|
@@ -546,11 +546,11 @@ foletypelib_major_version(VALUE self)
|
|
546
546
|
|
547
547
|
/*
|
548
548
|
* call-seq:
|
549
|
-
*
|
549
|
+
* minor_version -> The type library minor version.
|
550
550
|
*
|
551
551
|
* Returns the type library minor version.
|
552
552
|
*
|
553
|
-
* tlib =
|
553
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
554
554
|
* puts tlib.minor_version # -> 3
|
555
555
|
*/
|
556
556
|
static VALUE
|
@@ -568,11 +568,11 @@ foletypelib_minor_version(VALUE self)
|
|
568
568
|
|
569
569
|
/*
|
570
570
|
* call-seq:
|
571
|
-
*
|
571
|
+
* path -> The type library file path.
|
572
572
|
*
|
573
573
|
* Returns the type library file path.
|
574
574
|
*
|
575
|
-
* tlib =
|
575
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
576
576
|
* puts tlib.path #-> 'C:\...\EXCEL9.OLB'
|
577
577
|
*/
|
578
578
|
static VALUE
|
@@ -604,15 +604,15 @@ foletypelib_path(VALUE self)
|
|
604
604
|
|
605
605
|
/*
|
606
606
|
* call-seq:
|
607
|
-
*
|
607
|
+
* visible?
|
608
608
|
*
|
609
609
|
* Returns true if the type library information is not hidden.
|
610
610
|
* If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN,
|
611
611
|
* the method returns false, otherwise, returns true.
|
612
612
|
* If the method fails to access the TLIBATTR information, then
|
613
|
-
*
|
613
|
+
* WIN32OLE::RuntimeError is raised.
|
614
614
|
*
|
615
|
-
* tlib =
|
615
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
616
616
|
* tlib.visible? # => true
|
617
617
|
*/
|
618
618
|
static VALUE
|
@@ -636,12 +636,12 @@ foletypelib_visible(VALUE self)
|
|
636
636
|
|
637
637
|
/*
|
638
638
|
* call-seq:
|
639
|
-
*
|
639
|
+
* library_name
|
640
640
|
*
|
641
641
|
* Returns library name.
|
642
|
-
* If the method fails to access library name,
|
642
|
+
* If the method fails to access library name, WIN32OLE::RuntimeError is raised.
|
643
643
|
*
|
644
|
-
* tlib =
|
644
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
645
645
|
* tlib.library_name # => Excel
|
646
646
|
*/
|
647
647
|
static VALUE
|
@@ -790,11 +790,11 @@ typelib_file(VALUE ole)
|
|
790
790
|
|
791
791
|
/*
|
792
792
|
* call-seq:
|
793
|
-
*
|
793
|
+
* ole_types -> The array of WIN32OLE::Type object included the type library.
|
794
794
|
*
|
795
795
|
* Returns the type library file path.
|
796
796
|
*
|
797
|
-
* tlib =
|
797
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
798
798
|
* classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
|
799
799
|
*/
|
800
800
|
static VALUE
|
@@ -809,17 +809,17 @@ foletypelib_ole_types(VALUE self)
|
|
809
809
|
|
810
810
|
/*
|
811
811
|
* call-seq:
|
812
|
-
*
|
812
|
+
* inspect -> String
|
813
813
|
*
|
814
814
|
* Returns the type library name with class name.
|
815
815
|
*
|
816
|
-
* tlib =
|
817
|
-
* tlib.inspect # => "<#
|
816
|
+
* tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library')
|
817
|
+
* tlib.inspect # => "<#WIN32OLE::TypeLib:Microsoft Excel 9.0 Object Library>"
|
818
818
|
*/
|
819
819
|
static VALUE
|
820
820
|
foletypelib_inspect(VALUE self)
|
821
821
|
{
|
822
|
-
return default_inspect(self, "
|
822
|
+
return default_inspect(self, "WIN32OLE::TypeLib");
|
823
823
|
}
|
824
824
|
|
825
825
|
VALUE cWIN32OLE_TYPELIB;
|
@@ -827,7 +827,8 @@ VALUE cWIN32OLE_TYPELIB;
|
|
827
827
|
void
|
828
828
|
Init_win32ole_typelib(void)
|
829
829
|
{
|
830
|
-
cWIN32OLE_TYPELIB = rb_define_class_under(cWIN32OLE, "
|
830
|
+
cWIN32OLE_TYPELIB = rb_define_class_under(cWIN32OLE, "TypeLib", rb_cObject);
|
831
|
+
/* Alias of WIN32OLE::TypeLib, for the backward compatibility */
|
831
832
|
rb_define_const(rb_cObject, "WIN32OLE_TYPELIB", cWIN32OLE_TYPELIB);
|
832
833
|
rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0);
|
833
834
|
rb_define_alloc_func(cWIN32OLE_TYPELIB, foletypelib_s_allocate);
|