• Welcome to PlanetSquires Forums.
 

FF3 - Suspicious Pointer Assignment

Started by SeaVipe, July 17, 2019, 07:42:07 PM

Previous topic - Next topic

SeaVipe

Hello,


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




Function FRMTASKEDITOR_CUSTOM ( _
                              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.



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:

LPWSTR = Cptr(LPWSTR, RT_RCDATA)

Any ideas would be helpful, thanks...
Clive
Clive Richey

José Roca


SeaVipe

Works! Thanks José,


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