Support Forums > Other Software and Code

FF3 - Suspicious Pointer Assignment



I can't get rid of the compiler warning "Suspicious Pointer Assignment" generated by the code below:

--- Code: ---
                              hWndForm      as HWnd, _      ' handle of Form
                              wMsg          as UInteger,  _  ' type of message
                              wParam        as WPARAM, _    ' first message parameter
                              lParam        as LPARAM   _   ' second message parameter
                              ) as Long
    Select Case wMsg
        Case WM_NOTIFY
            Dim lpNmh  as NMHDR Ptr
            lpNmh => lParam ' <- Suspicious Pointer assignment warning.
            ' or
            lpNmh = lParam ' <- Suspicious Pointer assignment warning.

--- End code ---

The code works correctly but the warnings are there regardless of what I try. Researched on FB forum also.
Using this line as an example resulted in a syntax error:

--- Code: ---LPWSTR = Cptr(LPWSTR, RT_RCDATA)

--- End code ---
Any ideas would be helpful, thanks...

Josť Roca:
Use lpNmh = CAST(NMHDR PTR, lParam)

Works! Thanks Josť,

I tried (almost) that code previously but got an error because I didn't use PTR correctly.


[0] Message Index

Go to full version