Does RTTI and exceptions work in dlls on windows?

MrSmith via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 27 13:52:25 PST 2014


On Thursday, 27 November 2014 at 11:24:45 UTC, Martin Nowak wrote:
> On 11/24/2014 07:20 PM, MrSmith wrote:
>> I've got little test here
>> https://gist.github.com/MrSmith33/8750dd43c0843d45ccf8#file-sharedmodule2-d-L17-L29.
>>
>>
>> I have one application and two dlls. Application loads both 
>> dlls, calls
>> their factory functions and then passes each IModule instance 
>> that it
>> got from factories to those modules.
>>
>> Modules then try to cast those IModule refs back to their real
>> interfaces (ISharedModule1) but i am getting null there.
>>
>> A have found a workaround for this by returning a void* 
>> pointer to real
>> interface and it back when needed.
>>
>> Another, and more major issue is, that when exception is thrown
>> application fail immediately.
>>
>> Is it broken on windows, or it is me doing it wrong?
>
> On Windows we currently only support static linkage of phobos 
> and druntime. DLLs do work as long as each one is isolated, 
> once you start exchanging data across DLL boundaries you run in 
> ODR issues.
> We need to make phobos itself a DLL to solve this, but that's 
> quite a lot of work.

Can you suggest a good way to design mod system? Where each mod 
can depend on others and use their real functionality. All mods 
should be in form of dlls.

Another question is: What dll features are currently supported on 
linux and what they should be idealy? How do i use them?


More information about the Digitalmars-d mailing list