B
bonk
I have a plain unmanaged exe (no /CLR) that is supposed to to use classes
from a mixed mode dll (dll that uses .NET internally). That dll only needs
to expose unmanaged interfaces (classes and/or functions). This is of course
no problem and it works fine. However I have the special scenario where the
exe needs to be able to run even when there is no .NET Framework installed.
The exe is supposed to check at runtime if the .NET Framework is available
(in its correct version) and only in that case it will use classes/functions
from that dll.
As long as I link at runtime (via Loadlibrary()) this works fine. I obtain
processadress of an exportet function wich then delivers me a pointer to an
instance of some interface class. If that fails I know .net is not
available. Correct ?
But what if I wanted to use classes ( class __declspec( dllexport )
MyUnmanagedClassWichUsesNETInternally ) that are exportet in that dll. I
suppose that would require compiletime linking (if that is the correct term
....) with a .lib and a .h ? Do you see any way to expose classes in my
mixed mode dll and use them in my unmanaged exe AND still be able to run
that exe even if there is no .NET Framework available.
The exe would just need to check if it is availbale and only then "use" that
dll. This would somehow require that the CLR only gets initialized when the
dll is "touched".
I hope this make at least a little bit sense .....
from a mixed mode dll (dll that uses .NET internally). That dll only needs
to expose unmanaged interfaces (classes and/or functions). This is of course
no problem and it works fine. However I have the special scenario where the
exe needs to be able to run even when there is no .NET Framework installed.
The exe is supposed to check at runtime if the .NET Framework is available
(in its correct version) and only in that case it will use classes/functions
from that dll.
As long as I link at runtime (via Loadlibrary()) this works fine. I obtain
processadress of an exportet function wich then delivers me a pointer to an
instance of some interface class. If that fails I know .net is not
available. Correct ?
But what if I wanted to use classes ( class __declspec( dllexport )
MyUnmanagedClassWichUsesNETInternally ) that are exportet in that dll. I
suppose that would require compiletime linking (if that is the correct term
....) with a .lib and a .h ? Do you see any way to expose classes in my
mixed mode dll and use them in my unmanaged exe AND still be able to run
that exe even if there is no .NET Framework available.
The exe would just need to check if it is availbale and only then "use" that
dll. This would somehow require that the CLR only gets initialized when the
dll is "touched".
I hope this make at least a little bit sense .....