It will be fine for Windows, because in Window long and unsigned long are always 4 byte. But other systems (for instance, all Linux distros) have long and unsigned long 8 bytes under 64-bit systems. c_ulong makes sure, that it's the correct size on all systems.<br>
<br><div class="gmail_quote">On Mon, Oct 29, 2012 at 5:55 PM, Artie <span dir="ltr"><<a href="mailto:apple2000@mail.ru" target="_blank">apple2000@mail.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
As all your functions are `APIENTRY`, write `extern(Windows):` before them. And use `c_ulong` as analogue of `unsigned long`. So full correct `IBank` interface declaration here:<br>
---<br>
import core.stdc.config: c_ulong;<br>
<br>
extern(C++) interface IBank<br>
{<br>
extern(Windows):<br>
    const char* getLastError();<br>
    const char* getDetail(char* detail);<br>
    bool deposit(c_ulong number, double amount);<br>
    bool withdraw(c_ulong number, double amount);<br>
    double getBalance(c_ulong number);<br>
    bool transfer(c_ulong numberFrom, IBank* bankTo, c_ulong numberTo, double amount);<br>
    bool transferAccept(IBank* bankFrom, c_ulong numberTo, double amount);<br>
};<br>
---<br>
</blockquote>
<br></div>
Thank you very much, Denis. It was quite confusing to mix extern(C++) and extern(Windows). And I also thank Jakob for syntax specification.<br>
<br>
BTW, it's said in the ABI reference that `unsigned long` must be substituted with `uint`. And it seems to work fine for the data I used in the example.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>