New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Wrappers for common types, e.g. BSTR, VARIANT, SAFEARRAY #182
Comments
If helpful at all, we do a similar thing in https://github.com/Traverse-Research/hassle-rs/blob/ms-com-rs/src/os.rs We'd be happy if these can be moved to a (Windows common) crate as long as types and wrappers are exposed for Linux. |
We're working on a solution for this that we hope to be able to share shortly. Stay tuned! |
Does this old crate can help? Or, is there any news? I'm stuck on the IRtdServer interface, that has this idl with // TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");
// Forward declare all types defined in this typelib
interface IScripRTD;
interface IRTDUpdateEvent;
[
uuid(A04A3240-D051-4B4C-B004-CA92151F11E5),
helpstring("ScripRTD Class")
]
coclass ScripRTD {
[default] interface IScripRTD;
};
[
odl,
uuid(EC0E6191-DB51-11D3-8F3E-00C04F3651B8),
helpstring("IScripRTD Interface"),
dual,
nonextensible,
oleautomation
]
interface IScripRTD : IDispatch {
[id(0x0000000a)]
HRESULT ServerStart(
[in] IRTDUpdateEvent* callback,
[out, retval] long* result);
[id(0x0000000b)]
HRESULT ConnectData(
[in] long topicId,
[in] SAFEARRAY(VARIANT)* strings,
[in, out] VARIANT_BOOL* newValues,
[out, retval] VARIANT* values);
[id(0x0000000c)]
HRESULT RefreshData(
[in, out] long* topicCount,
[out, retval] SAFEARRAY(VARIANT)* data);
[id(0x0000000d)]
HRESULT DisconnectData([in] long topicId);
[id(0x0000000e)]
HRESULT Heartbeat([out, retval] long* result);
[id(0x0000000f)]
HRESULT ServerTerminate();
};
[
odl,
uuid(A43788C1-D91B-11D3-8F39-00C04F3651B8),
dual,
oleautomation
]
interface IRTDUpdateEvent : IDispatch {
[id(0x0000000a)]
HRESULT UpdateNotify();
[id(0x0000000b), propget]
HRESULT HeartbeatInterval([out, retval] long* value);
[id(0x0000000b), propput]
HRESULT HeartbeatInterval([in] long value);
[id(0x0000000c)]
HRESULT Disconnect();
}; |
While
winapi
exposes many of these types of functions necessary to use them, there isn't any good support for these types often used in COM. For example, I wrote aBStr
(though, I suppose that should beBString
to match the Rust naming convention) that exposes just enough of what I need, but this could be expanded considerably to implementFrom
traits and more, and be readily available for use with thecom
crate. Same forVARIANT
and evenSAFEARRAY
.The text was updated successfully, but these errors were encountered: