Search DLL before P/Invoke?
-
Hello! I'm trying to do some P/Invoke, but the native DLL is an optional component, i.e. it isn't sure that it is present. How can I test if P/Invoke will be able to call the DLL? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
Hello! I'm trying to do some P/Invoke, but the native DLL is an optional component, i.e. it isn't sure that it is present. How can I test if P/Invoke will be able to call the DLL? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
Well, I'd need to search in several directories (system directory, application directory, etc.), and even if I find a DLL it's not sure that this DLL is really a valid library (could be a text file for example)... Isn't there any way to test if a loadable DLL is present? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
Well, I'd need to search in several directories (system directory, application directory, etc.), and even if I find a DLL it's not sure that this DLL is really a valid library (could be a text file for example)... Isn't there any way to test if a loadable DLL is present? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
Well, I'd need to search in several directories (system directory, application directory, etc.), and even if I find a DLL it's not sure that this DLL is really a valid library (could be a text file for example)... Isn't there any way to test if a loadable DLL is present? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT)You might want to look into trying to load the .DLL using the Assembly class. You might also want to look into doing this in a seperate AppDomain so you can unload it. -- modified at 12:07 Friday 25th August, 2006
Dave Kreskowiak Microsoft MVP - Visual Basic
-
Hello! I'm trying to do some P/Invoke, but the native DLL is an optional component, i.e. it isn't sure that it is present. How can I test if P/Invoke will be able to call the DLL? Best regards Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT)No there is not. You could do interop to DllLoadLibrary to see if you can load the DLL this way. If it fails then the dll is not present.
Deus caritas est