El 24/10/2016 a las 8:17, LacaK escribió:
I'm not "sure" because if the flag does not tell us nothing (no IN, no
OUT) I do not know if there is a "default behavior" except the "ByRef"
flag and both "constref" and "var" are "ByRef".
I have found:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367051(v=vs.85).aspx
"The*[in]*attribute is applied to a parameter by default when no
directional parameter attribute is specified."
Hello,
I was not aware about that "default" so, yes you are right.
Take a look in you TLB looking for a widestring that should return
information, if with this code is marked as "var" everything should be
ok, if it will be marked as "constref" something in the logic is wrong.
? I do not understand what do you mean
When I use Microsofts OLEView to look at TLB I see only:
long ScGetStringValue(long Type, BSTR* Value);
There is no attribute [in],[out],... specified
I'm quite sure that using "var" in both cases is safe in 99.9% of the cases.
OLEView will not show you the "attributes", only in the IDL source.
According to:
https://msdn.microsoft.com/en-us/library/cc237804.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms221019(v=vs.85).aspx
*"PARAMFLAG_NONE: *The behavior of the parameter is not specified."
I guess, that my case is PARAMFLAG_NONE so patch should look like:
case FD^.lprgelemdescParam[k].paramdesc.wParamFlags and (PARAMFLAG_FIN
or PARAMFLAG_FOUT) of
PARAMFLAG_FIN or PARAMFLAG_FOUT:sPar:='var ';
PARAMFLAG_FOUT:sPar:='out ';
*PARAMFLAG_NONE,*
PARAMFLAG_FIN:sPar:='var '; //constref in safecall? TBD
end;
I leave 'var ' for Delphi compatibility ...
Yes.
--
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal