OsStr
to a const * _
?
ID3D10Blob
question, you would call the GetBufferPointer
and GetBufferSize
methods to get the pointer and size, and pass them to std::slice::from_raw_parts
to get a &[T]
.
&[u16]
and pass it to OsStringExt::from_wide()
CoCreateInstance
with a class not found
error? https://github.com/LiHRaM/egpu-rs/blob/master/src/main.rs
HRESULT
specifically is: 0x80040154
tlhelp32
error[E0432]: unresolved import `winapi::um::tlhelp32`
winapi::um
works though
lihram
This is the relevant windows documentation for C++
lihram
Nvm, found it here: https://github.com/contextfree/winrt-rust/blob/master/examples/toast_notify.rs
Hello, I'm struggling with following problem:
I have a BITMAP declared like this
let mut bmp: BITMAP = mem::uninitialized();
then I'm trying to call a GetObject
GetObjectW(
bitmap as HANDLE,
mem::size_of::<BITMAP>() as i32,
&mut bmp as * LPVOID,
);
And I'm getting
error[E0606]: casting `&mut winapi::um::wingdi::BITMAP` as `*mut std::ffi::c_void` is invalid
--> src\main.rs:118:17
|
118 | &mut bmp as LPVOID,
| ^^^^^^^^^^^^^^^^^^
<*mut _>::cast(&mut bmp)
pvData
and pcbData
from a call to winapi::um::winreg::RegGetValueA
... the function returns ERROR_SUCCESS
if I set those both to std::ptr::null_mut()
, so all other parameters are OK! I'm just stuck on how do declare those variables and converting then to and from... I'm new to rust!!!
let mut pvData = vec![0; 2];
let lstatus = unsafe { RegGetValueA(HKEY_CURRENT_USER,
hkey.as_ptr(),
lpSubKey.as_ptr(),
RRF_RT_REG_DWORD,
std::ptr::null_mut(),
pvData.as_mut_ptr() as *mut c_void,
std::ptr::null_mut()
)};
println!("SUCCESS {:?}", pvData[0]);