You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
Currently, I'm trying to use IOleObject interface.
To fulfill the interface, it seems like I should provide IOleClientSite implementation via SetClientSite.
I tried to use class! macro to implement IOleClientSite interface.
I couldn't find a way to use OleClientSite class as an input of set_client_site.
I'm new to both rust and com, so any comment would be appreciated.
class!{pub class OleClientSite:IOleClientSite{}implIOleClientSiteforOleClientSite{unsafefn save_object(&self) -> HRESULT{let result:HRESULT = 0;
result
}unsafefn get_moniker(&self) -> HRESULT{let result:HRESULT = 0;
result
}unsafefn get_container(&self) -> HRESULT{let result:HRESULT = 0;
result
}unsafefn show_object(&self) -> HRESULT{let result:HRESULT = 0;
result
}unsafefn on_show_window(&self) -> HRESULT{let result:HRESULT = 0;
result
}unsafefn request_new_object_layout(&self) -> HRESULT{let result:HRESULT = 0;
result
}}}implDefaultforOleClientSite{// Required for com-rs, even if we never want it to create an instance for us.fndefault() -> Self{OleClientSite::new()}}
The text was updated successfully, but these errors were encountered:
konghk78
changed the title
Using IOleObject interface
[Help] Using IOleObject interface
Aug 7, 2020
if you want to set your OleClientSite class then you need to first create and allocate one:
// assumes you already have a handle to an `IOleObject` in an `ole_object` variablelet client_site = OleClientSite::alloc::<IOleClientSite>(OleClientSite::default()).expect("Could not get OleClientSite class as an IOleClientSite");
ole_object.set_client_site(client_site);
Hello,
Currently, I'm trying to use IOleObject interface.
To fulfill the interface, it seems like I should provide IOleClientSite implementation via SetClientSite.
I tried to use class! macro to implement IOleClientSite interface.
I couldn't find a way to use OleClientSite class as an input of set_client_site.
I'm new to both rust and com, so any comment would be appreciated.
The text was updated successfully, but these errors were encountered: