Artifact cc2ab2b91c87057b3522028258f6b9806ee4df71
- File
src/testexe.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
import win32.windows;
import std.stdio;
import std.string;
import core.runtime;
alias extern(Windows) int function( HWND a, immutable char* b, char* c, DWORD d ) CmdFuncT;
void main()
{
HINSTANCE h = cast(HINSTANCE) Runtime.loadLibrary("QBga32.DLL");
for(;;) {
write("> ");
string s = readln();
if(s.length > 0) {
CmdFuncT Bga = cast(CmdFuncT)GetProcAddress(h, "Bga");
int r = Bga(NULL, s.toStringz(), null, 0);
writeln("Return: ", r);
}
}
Runtime.unloadLibrary(h);
}