c# Programming Glossary: dllpath
check if unmanaged dll is 32-bit or 64-bit? http://stackoverflow.com/questions/1001404/check-if-unmanaged-dll-is-32-bit-or-64-bit public static MachineType GetDllMachineType string dllPath see http www.microsoft.com whdc system platform firmware PECOFF.mspx.. see document above for enum FileStream fs new FileStream dllPath FileMode.Open FileAccess.Read BinaryReader br new BinaryReader.. if unknown public static bool UnmanagedDllIs64Bit string dllPath switch GetDllMachineType dllPath case MachineType.IMAGE_FILE_MACHINE_AMD64..
Embedding unmanaged dll into a managed C# dll http://stackoverflow.com/questions/666799/embedding-unmanaged-dll-into-a-managed-c-sharp-dll dirName Directory.CreateDirectory dirName string dllPath Path.Combine dirName MyAssembly.Unmanaged.dll Get the embedded.. to the temporary file try using Stream outFile File.Create dllPath const int sz 4096 byte buf new byte sz while true int nRead.. is already loaded into the process. IntPtr h LoadLibrary dllPath Debug.Assert h IntPtr.Zero Unable to load library dllPath ..
|