-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I have no clue.
Whats even more irritating is, that listing the COM interfaces via
def getIidsOfComObject(com):
import ctypes
from win32more import POINTER, Guid, UInt32
count = UInt32()
guids = POINTER(Guid)()
hr = com.GetIids(ctypes.byref(count), ctypes.byref(guids))
if hr != 0:
raise ctypes.WinError(hr)
return [ str(guids[i])[1:-1] for i in range(0, count.value) ]
with
listView = xamlElement.as_(ListView)
on the ListView itself
getIidsOfComObject(listView)
works, but on the ItemsSource as
getIidsOfComObject(listView.ItemsSource)
fails with a ValueError: NULL COM pointer access
...
The function is called from the main thread, printing via
print(listView, listView.ItemsSource)
works and shows <ListView object at 0x..> <IInspectable object at 0x...>
as expected. But without getting the Interfaces of the ItemsSource object I have no clue what and how to create one myself...
The ListView was created via XAML like:
<ListView>
<x:String>Hello Python!</x:String>
<x:String>Hello win32more!</x:String>
</ListView>
and the strings show up, so I guess there is an ItemsSource.
Metadata
Metadata
Assignees
Labels
No labels