use windows::Win32::System::Com::*;
pub use com_shim::IsA;
pub mod types;
pub use types::*;
pub type Result<T> = ::windows::core::Result<T>;
pub struct SAPComInstance;
impl SAPComInstance {
pub fn new() -> Result<Self> {
tracing::debug!("CoInitialize'ing.");
unsafe {
CoInitialize(None)?;
}
Ok(SAPComInstance)
}
pub fn sap_wrapper(&self) -> Result<SAPWrapper> {
tracing::debug!("New CSapROTWrapper object generating.");
SAPWrapper::new()
}
}
impl Drop for SAPComInstance {
fn drop(&mut self) {
unsafe {
CoUninitialize();
}
}
}