internal SafeModuleHandle LoadLibrary() { SafeModuleHandle handle = NativeMethods.LoadLibraryEx(ResourceFile, IntPtr.Zero, NativeMethods.LoadLibraryExFlags.LoadLibraryAsDatafile); if (handle.IsInvalid) { int error = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); if (error == NativeMethods.ErrorFileNotFound) { throw new FileNotFoundException(string.Format(CultureInfo.CurrentCulture, Resources.FileNotFoundFormat, ResourceFile)); } else { throw new System.ComponentModel.Win32Exception(error); } } return(handle); }
public static extern int LoadString(SafeModuleHandle hInstance, uint uID, StringBuilder lpBuffer, int nBufferMax);