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
require"win32cr"require"win32cr/system/com"LibWin32.CoInitializeEx(nil, LibWin32::COINIT::COINIT_APARTMENTTHREADED|LibWin32::COINIT::COINIT_DISABLE_OLE1DDE)
begin
com =ComPtr(LibWin32::IFileOpenDialog).new(LibWin32::CLSID_FileOpenDialog, LibWin32::IID_IFileOpenDialog)
default_flags =0_u32
com.get_options(pointerof(default_flags))
com.set_options((default_flags |LibWin32::FILEOPENDIALOGOPTIONS::FOS_PATHMUSTEXIST.to_i |LibWin32::FILEOPENDIALOGOPTIONS::FOS_PICKFOLDERS.to_i))
com.show(Pointer(Void).null)
item =LibWin32::IShellItem.new
buffer = uninitialized UInt16*if com.get_folder(pointerof(item))
result = item.get_display_name(pointerof(item), LibWin32::SIGDN::SIGDN_FILESYSPATH, pointerof(buffer))
pp result #String.from_utf16(buffer)# pp String.from_utf16(buffer)[0]elseputs"Failed."endrescue e
puts e.message
endLibWin32.CoUninitialize
Invalid memory access (C0000005) at address 0x7fffe5785de8
[0x7fffe5785de8] ShellExecuteExW +759464 in C:\Windows\SYSTEM32\windows.storage.dll
[0x7ff6a8c50cc1] get_display_name at C:\Users\cyber\Code\w3dhub_packager_webview\lib\win32cr\src\win32cr\ui\shell.cr:17422
[0x7ff6a8b8177e] __crystal_main at C:\Users\cyber\Code\w3dhub_packager_webview\src\w3dhub_packager.cr:16
[0x7ff6a8c57569] main_user_code at C:\Users\cyber\Applications\crystal-1.12.1\src\crystal\main.cr:129
[0x7ff6a8c5748a] main at C:\Users\cyber\Applications\crystal-1.12.1\src\crystal\main.cr:115
[0x7ff6a8bcf449] main at C:\Users\cyber\Applications\crystal-1.12.1\src\crystal\main.cr:141
[0x7ff6a8bcf563] wmain at C:\Users\cyber\Applications\crystal-1.12.1\src\crystal\system\win32\wmain.cr:37
[0x7ff6a8c58da0] __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
[0x7fffe7cb7344] BaseThreadInitThunk +20 in C:\Windows\System32\KERNEL32.DLL
[0x7fffe9ae26b1] RtlUserThreadStart +33 in C:\Windows\SYSTEM32\ntdll.dll
Function being used:
https://github.com/mjblack/win32cr/blob/c4da22cfbe3bf363bf7ef5af1c00408f6626ce42/src/win32cr/ui/shell.cr#L17421-L17423
*it is midnight, so I may be missing something obvious...
The text was updated successfully, but these errors were encountered: