[Issue 14318] Shared library stdio not loaded
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Mar 22 06:54:23 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=14318
--- Comment #3 from toop at mt2015.com ---
(In reply to toop from comment #2)
> I get error: privileged instruction at windowsHandleOpen line because there
> is no console.
>
> if (!AttachConsole(ATTACH_PARENT_PROCESS))
> {
> AllocConsole();
> }
>
> After this there is still no output from writeln, writefln and printf in my
> app calling DLL and in DLL itself but writefln no longer fails with
> std.exception.ErrnoException (Bad file descriptor). flush() doesn't do
> anything but writeln/fln works after you call stdout.setvbuf(1, _IONBF);
> with any value above 0. printf doesn't work at all.
Sorry, it turned out to be my fault. dll_process_attach( hInstance, true );
call was missing in the dll and it caused all sorts of problems.
--
More information about the Digitalmars-d-bugs
mailing list