问题
Using the following code as example:
[DllImport("C:\\Users\\Rodrigo\\Desktop\\ds08_asio\\dsproEtherFaceAsio\\x64\\Debug\\dsproEtherFaceAsio.dll")]
public static extern void open_console();
[DllImport("C:\\Users\\Rodrigo\\Desktop\\ds08_asio\\dsproEtherFaceAsio\\x64\\Debug\\dsproEtherFaceAsio.dll")]
public static extern int get_available_interface(int index, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder buffer, int maxSize);
[DllImport("C:\\Users\\Rodrigo\\Desktop\\ds08_asio\\dsproEtherFaceAsio\\x64\\Debug\\dsproEtherFaceAsio.dll")]
public static extern int get_buffer();
[DllImport("C:\\Users\\Rodrigo\\Desktop\\ds08_asio\\dsproEtherFaceAsio\\x64\\Debug\\dsproEtherFaceAsio.dll")]
public static extern int get_channels();
What would be the loading behaviour of the DLL? To be more specific, will each DllImport create one instance of the DLL and export a single function? Or will one instance of the DLL be created and all functions exported?
来源:https://stackoverflow.com/questions/27301840/what-is-the-dll-loading-behavior-when-using-dllimport-in-c