natan1107
asked on
RAPI - CeOpenDatabase,CeReadRecordProps,CeCreateDatabase - DllImport with C#
Hello,
Can someone show me how can i import thoose functions (DataBase functions) with DllImport in C#
Thank You.
Can someone show me how can i import thoose functions (DataBase functions) with DllImport in C#
Thank You.
public const short FILE_ATTRIBUTE_NORMAL = 0x80;public const short INVALID_HANDLE_VALUE = -1;public const uint GENERIC_READ = 0x80000000;public const uint GENERIC_WRITE = 0x40000000;public const short CREATE_NEW = 1;public const short CREATE_ALWAYS = 2;public const short OPEN_EXISTING = 3;public const short ERROR_FILE_EXISTS = 80;public const short ERROR_INVALID_PARAMETER = 87;public const short ERROR_DISK_FULL = 112;[StructLayout(LayoutKi nd.Sequent ial)]publi c struct OSVERSIONINFO{public int dwOSVersionInfoSize;public int dwMajorVersion;public int dwMinorVersion;public int dwBuildNumber;public int dwPlatformId;[MarshalAs(Un managedTyp e.ByValTSt r,SizeCons t= 128)]public string szCSDVersion;}[StructLayou t(LayoutKi nd.Sequent ial)]publi c struct RAPIINIT{int cbSize;int heRapiInit;int hrRapiInit;}[StructLayout( LayoutKind .Sequentia l)]public struct SECURITY_ATTRIBUTES{public int nLength;public int lpSecurityDescriptor;publi c int bInheritHandle;}[DllImport ("rapi.dll ", CharSet=CharSet.Unicode)]p ublic static extern int CeCloseHandle(int hObject);[DllImport("rapi. dll", CharSet=CharSet.Unicode)]p ublic static extern int CeCreateFile(string lpFileName,uint dwDesiredAccess,int dwShareMode,int lpSecurityAttributes,intdw CreationDi sposition, int dwFlagsAndAttributes,int hTemplateFile);[DllImport( "rapi.dll" , CharSet=CharSet.Unicode)]p ublic static extern int CeRapiInitEx ([MarshalAs(UnmanagedType. Struct)] ref RAPIINIT pRapiInit);[DllImport("rap i.dll", CharSet=CharSet.Unicode)]p ublic static extern int CeRapiInit ();[DllImport("rapi.dll", CharSet=CharSet.Unicode)]p ublic static extern int CeRapiUninit ();[DllImport("rapi.dll", CharSet=CharSet.Unicode)]p ublic static extern int CeReadFile(int hFile,StringBuilder lpBuffer,int nNumberOfbytesToRead, out int lpNumberOfbytesRead, int lpOverlapped);[DllImport(" rapi.dll", CharSet=CharSet.Unicode)]p ublic static extern int CeWriteFile(int hFile,StringBuilder lpBuffer, int nNumberOfbytesToWrite, out int lpNumberOfbytesWritten, int lpOverlapped);[DllImport(" rapi.dll", CharSet=CharSet.Unicode)]p ublic static extern int GetLastError();[DllImport( "rapi.dll" , CharSet=CharSet.Unicode)]p ublic static extern int CeSetEndOfFile(int hFile);[DllImport("rapi.dl l", CharSet=CharSet.Unicode)]p ublic static extern int CeGetFileSize(int hFile,int lpFileSizeHigh);[DllImport ("rapi.dll ", CharSet=CharSet.Unicode)]p ublic static extern int CeGetLastError();
ASKER
all DllImport are ok, but there is no fuction that know to open a database !
I need the flowing funcitons:
CeOpenDatabase,CeReadRecor dProps,CeC reateDatab ase.
I need to call them by C#,
I know that I can do it with C++
Thank You
I need the flowing funcitons:
CeOpenDatabase,CeReadRecor
I need to call them by C#,
I know that I can do it with C++
Thank You
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.