When creating dlls (Add-ins) for a third party program that loads Native DLLs dynamically, is there a way, in a Mixed Mode DLL (C++/cli) to natively catch the fact that the .Net framework is not available. So that the Parent program that is dynamically trying to consume this DLL does not throw an error?
+1
A:
It might be possible to do something with a custom entry point in the dll, but I expect you are walking in 'undocumented' territory.
The only 'simple' way I can think to do this would be to create a native shim dll that performs the check and handles the condition in whatever way you see fit. If the framework is present it in turn loads the real plugin DLL and mirrors all calls through to it.
How easy this is will depend on the complexity of the plugin interface you are working with.
Rob Walker
2010-07-19 20:21:10
Thanks. I think you are right, the only way would be to use a wrapper. Any links showing how to "ping" the presence of the framework using native code? (Or should that be another question :-) )
saunderl
2010-07-20 03:11:14
You can check for certain registry keys, see: http://support.microsoft.com/kb/315291
Rob Walker
2010-07-20 13:53:09