<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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 class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)">By using the correct types for the fields: </span><a href="http://www.freepascal.org/docs-html/rtl/ctypes/index-3.html" rel="noreferrer" target="_blank">http://www.freepascal.org/docs-html/rtl/ctypes/index-3.html</a><br></div></div>
<br>
E.g., "unsigned long" is not (always) the same as "dword".<br><div class="gmail_default" style="font-family:monospace,monospace;font-size:large;display:inline">​</div><br></blockquote><div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">​OK, as a matter of fact, the stuff was copied from output of h2pas conversion program. :-)  I will use ctypes to test again.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">However, another issue: if I use this :</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">​{$CODEALIGN RECORDMIN=4}</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">It worked. i.e. output size same as C version.   I wonder what's the difference between $CODEALIGN and $A/$PACKRECORDS?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">Also, if I use "packed records", alignment will never take place, regardless of $A settings, right?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">Thanks!</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">​Xiangrong​</div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jonas<br>
_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br>
</blockquote></div><br></div></div>