Hello,
Thanks to the wonderful people here I was able to create a Windows dice roll dll based on this code
library ChucklesGenuine;
{$mode objfpc}{$H+}
var
RandomizeAlreadyCalled: Boolean = False;
function Dice: Integer; {$ifdef windows}stdcall{$else}cdecl{$endif};
var
D1, D2: Integer;
begin
// call randomize once and never again.
if not RandomizeAlreadyCalled then begin
Randomize;
RandomizeAlreadyCalled := True;
end;
D1 := Random(6) + 1;
D2 := Random(6) + 1;
Result := D1 * 8 + D2;
end;
exports
Dice;
begin
end.
I'm now using a new version of Lazarus; I opened the *.lpr file for the above code and simply renamed it and changed the Random(6) lines to Random(4) - I don't want to see 5 or 6 in the dice rolls generated.
It compiled fine but the program (ExtremeGammon) that calls the dll says it's in the wrong format. The dll filesize is 210kb versus 72kb for the original on which its based so has anyone any thoughts on what's happening? Has something changed between versions of Lazarus?
Thank you for reading and compliments of the season :-)