Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I have write the following codes to work with an I2C device but i have received this error message :
unable to load dll="coredll" the specified module could not be found.

C#
[DllImport("coredll.dll", EntryPoint = "DeviceIoControl",SetLastError = true)]
        internal static extern int DeviceIoControlCE(int hDevice, int dwIoControlCode, byte[] lpInBuffer, int nInBufferSize, 
            byte[] lpOutBuffer,int nOutBufferSize, ref int lpBytesReturned, IntPtr lpOverlapped);

[DllImport("coredll", SetLastError = true)]
        static extern IntPtr CreateFile(String lpFileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes, UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile);

[DllImport("coredll.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool CloseHandle(IntPtr hObject);
Posted
Updated 24-Feb-12 22:33pm
v3

Might want to try again all that ended up showing is the imports...no error message.
 
Share this answer
 
Comments
M_Mogharrabi 25-Feb-12 4:38am    
Hi Mike,
Excuse me for my imperfect question!!!I have correct it.
Please help me...
This is an excellent site when working with imports [^].
This dll is for use with Smart devices not desktop and will produce the error above if you are using it for desktop app.
 
Share this answer
 
Comments
M_Mogharrabi 27-Feb-12 0:55am    
So how should i use it with Smart devices??Because i have found this code to use in a Windows Application that works with Smart devices.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900