<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 11, 2016 at 3:41 PM, Anthony Walter <span dir="ltr"><<a href="mailto:sysrpl@gmail.com" target="_blank">sysrpl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">I believe in Delphi only external functions may use varargs. In your case you are declaring a variable, which could be assigned to a local function.</div></div></blockquote><div><br></div><div>You are right:</div><div><br></div><div><a href="http://docwiki.embarcadero.com/RADStudio/XE8/en/E2591_Only_cdecl_functions_may_use_varargs_(Delphi)">http://docwiki.embarcadero.com/RADStudio/XE8/en/E2591_Only_cdecl_functions_may_use_varargs_(Delphi)</a><br></div><div><br></div><div><a href="http://docwiki.embarcadero.com/RADStudio/XE8/en/E2277_Only_external_cdecl_functions_may_use_varargs_(Delphi)">http://docwiki.embarcadero.com/RADStudio/XE8/en/E2277_Only_external_cdecl_functions_may_use_varargs_(Delphi)</a></div><div><br></div><div>So it seems that I can't use `varargs` loading libraries dynamically on Delphi. :-(</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">function <span style="font-size:16px">FmtStr</span><span style="font-size:16px">(const fmt: PAnsiChar): PAnsiChar; </span>varargs; cdecl; external yourlibname;</div></div></blockquote><div> </div><div>I need to use it in variables because I wanna load my library dynamically. :-/</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra">Note: varargs comes before cdecl, though I am not sure if it matters.</div></div></blockquote></div><div><br></div><div>It seems irrelevant, but I saw it in some Delphi units declaring it as `... cdecl; varargs; ...`.</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>