Hi all,
I store my UDT variable to a pointer with Varptr function. I then retrieve it with GetWindowLong function. So far so good. I got the same number here. But how do i convert this pointer (or number) to my udt variable ?
Here are the code lines for clarity.
SetWindowLong(me.mHandle, -21, Varptr(Me)) '// After creating window, I store my type here.
Function WndProc(hwnd As DWord, message As DWord, wParam As DWord, lParam As Long) As DWord    
    Dim t = GetWindowLong(hwnd, -21)   '// Here i got the number. 
    Dim myWin As TWindow = t  '// Won't work.
    ... '// Function continues