Doc Comments /
Windows
Difference (last change) (no other diffs, normal page display)
Changed: 56,167c56
*Windows API headers |
D for Win32
![]() |
|
More Information
EricAnderton: There are some caveats to working with Dll's in D, these are largely due to D's status as a beta technology (for now).
- Bug: stdin/stdout will be set to an invalid state when a win32 D-dll (built against dmd) is unloaded.
- The dll stub code provided in the comments is incomplete (see example below)
- As is mentioned in the original code, multithreading is not explicitly handled in DllMain. You'll have to roll your own hooks for this.
Examples
EricAnderton: The DllMain provided on the digitalmars site doesn't catch exceptions during startup, nor does it execute the module destructors on process-detach. This is in contrast to the WinMain example that at least performs the exception handling.
The example below is a how to handle those two cases correctly:
![]() |
|
Messages
Add your comments here...
Links
Corresponding page in the D Specification
- Windows API headers