1use windows::Win32::System::Com::*;
6
7pub mod types;
9
10pub use types::*;
11
12pub type Result<T> = ::windows::core::Result<T>;
14
15pub struct SAPComInstance;
17
18impl SAPComInstance {
19 pub fn new() -> Result<Self> {
21 log::debug!("CoInitialize'ing.");
22 unsafe {
23 CoInitialize(None)?;
24 }
25 Ok(SAPComInstance)
26 }
27
28 pub fn sap_wrapper(&self) -> Result<SAPWrapper> {
30 log::debug!("New CSapROTWrapper object generating.");
31 SAPWrapper::new()
32 }
33}
34
35impl Drop for SAPComInstance {
36 fn drop(&mut self) {
37 unsafe {
38 CoUninitialize();
39 }
40 }
41}