ext/win32ole/win32ole.c(typelib_file_from_typelib): search "win16"
entry to get library path. ext/win32ole/win32ole.c(oletypelib_path): ditto. ext/win32ole/win32ole.c(ole_typedesc2val): add VT_LPWSTR, VT_LPSTR, VT_ERROR case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e42cec58db
commit
e4a65e4427
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Thu Nov 4 21:13:48 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* ext/win32ole/win32ole.c(typelib_file_from_typelib): search "win16"
|
||||||
|
entry to get library path.
|
||||||
|
|
||||||
|
* ext/win32ole/win32ole.c(oletypelib_path): ditto.
|
||||||
|
|
||||||
|
* ext/win32ole/win32ole.c(ole_typedesc2val): add VT_LPWSTR, VT_LPSTR,
|
||||||
|
VT_ERROR case.
|
||||||
|
|
||||||
Thu Nov 4 15:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Thu Nov 4 15:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk/variable.rb: forget to initialize instance_variables
|
* ext/tk/lib/tk/variable.rb: forget to initialize instance_variables
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
||||||
|
|
||||||
#define WIN32OLE_VERSION "0.6.1"
|
#define WIN32OLE_VERSION "0.6.2"
|
||||||
|
|
||||||
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
||||||
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
||||||
@ -1136,6 +1136,18 @@ reg_get_val(hkey, subkey)
|
|||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
reg_get_typelib_file_path(hkey)
|
||||||
|
HKEY hkey;
|
||||||
|
{
|
||||||
|
VALUE path = Qnil;
|
||||||
|
path = reg_get_val(hkey, "win32");
|
||||||
|
if (path == Qnil) {
|
||||||
|
path = reg_get_val(hkey, "win16");
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
typelib_file_from_clsid(ole)
|
typelib_file_from_clsid(ole)
|
||||||
VALUE ole;
|
VALUE ole;
|
||||||
@ -1216,7 +1228,7 @@ typelib_file_from_typelib(ole)
|
|||||||
break;
|
break;
|
||||||
err = reg_open_vkey(hversion, lang, &hlang);
|
err = reg_open_vkey(hversion, lang, &hlang);
|
||||||
if (err == ERROR_SUCCESS) {
|
if (err == ERROR_SUCCESS) {
|
||||||
if ((file = reg_get_val(hlang, "win32")) != Qnil)
|
if ((file = reg_get_typelib_file_path(hlang)) != Qnil)
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
RegCloseKey(hlang);
|
RegCloseKey(hlang);
|
||||||
}
|
}
|
||||||
@ -3237,6 +3249,19 @@ ole_typedesc2val(pTypeInfo, pTypeDesc, typedetails)
|
|||||||
if(typedetails != Qnil)
|
if(typedetails != Qnil)
|
||||||
rb_ary_push(typedetails, rb_str_new2("DISPATCH"));
|
rb_ary_push(typedetails, rb_str_new2("DISPATCH"));
|
||||||
return rb_str_new2("DISPATCH");
|
return rb_str_new2("DISPATCH");
|
||||||
|
case VT_ERROR:
|
||||||
|
if(typedetails != Qnil)
|
||||||
|
rb_ary_push(typedetails, rb_str_new2("ERROR"));
|
||||||
|
return rb_str_new2("ERROR");
|
||||||
|
|
||||||
|
case VT_LPWSTR:
|
||||||
|
if(typedetails != Qnil)
|
||||||
|
rb_ary_push(typedetails, rb_str_new2("LPWSTR"));
|
||||||
|
return rb_str_new2("LPWSTR");
|
||||||
|
case VT_LPSTR:
|
||||||
|
if(typedetails != Qnil)
|
||||||
|
rb_ary_push(typedetails, rb_str_new2("LPSTR"));
|
||||||
|
return rb_str_new2("LPSTR");
|
||||||
default:
|
default:
|
||||||
str = rb_str_new2("Unknown Type ");
|
str = rb_str_new2("Unknown Type ");
|
||||||
rb_str_concat(str, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
|
rb_str_concat(str, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
|
||||||
@ -3846,7 +3871,7 @@ oletypelib_path(guid, version)
|
|||||||
break;
|
break;
|
||||||
err = reg_open_vkey(hkey, lang, &hlang);
|
err = reg_open_vkey(hkey, lang, &hlang);
|
||||||
if (err == ERROR_SUCCESS) {
|
if (err == ERROR_SUCCESS) {
|
||||||
path = reg_get_val(hlang, "win32");
|
path = reg_get_typelib_file_path(hlang);
|
||||||
RegCloseKey(hlang);
|
RegCloseKey(hlang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3897,11 +3922,12 @@ foletypelib_ole_classes(self)
|
|||||||
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
|
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
|
||||||
SysFreeString(pbuf);
|
SysFreeString(pbuf);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Failed to LoadTypeLibEx");
|
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Failed to LoadTypeLibEx from `%s'",
|
||||||
|
StringValuePtr(path));
|
||||||
ole_classes_from_typelib(pTypeLib, classes);
|
ole_classes_from_typelib(pTypeLib, classes);
|
||||||
OLE_RELEASE(pTypeLib);
|
OLE_RELEASE(pTypeLib);
|
||||||
} else {
|
} else {
|
||||||
rb_raise(eWIN32OLE_RUNTIME_ERROR, "fail to get type library path");
|
rb_raise(eWIN32OLE_RUNTIME_ERROR, "Failed to get type library path");
|
||||||
}
|
}
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user