Hello, All.

I have this code.

I need to pass a certain procedure (`SetFocus`) as parameter (`LPVOID`) to 
another procedure (`pass`).

But as it turned out there are a lot of `SetFocus` procs in `winim` module. I 
need only one of them. Question: how can I elegantly specify the one that i 
need (`HWND SetFocus(HWND)`)
    
    
    from winim as win import LPVOID
    #from winim/inc/winuser as win import nil
    
    proc pass(p: LPVOID) =
        echo p.repr
    
    #pass(win.MessageBoxA)  # this works
    pass(win.SetFocus)      # this doesn't. type mismatch. because "SetFocus" 
symbol is ambiguous.
    
    echo win.SetFocus.typeof  # type = None
    
    
    
    Run

if i uncomment the second line, the code works, but i think it looks like 
workaround/hack.

Reply via email to