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