I suspect you've misinterpreted the advice. I suspect it was actually suggesting:
private static extern int ReadMenu1File([MarshalAs(UnmanagedType.LPWStr)]
string Menu1Path);
EDIT: This fits in with the advice:
or by explicitly marshaling the parameter as
UnmanagedType.LPWStr
That's not the same as saying "Change the parameter type to UnmanagedType.LPWStr
" - it's just telling you that's how you ought to marshal the parameter.
The other recommendations are to be set on the [DllImport]
instead.