Desktop Functions: Smart Device Functions:
|
CeRapiInvoke (rapi)
rapi is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for CeRapiInvoke in other DLLs exists, click on Find References to the right. C# Signature:[DllImport("rapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal extern static int CeRapiInvoke(
string pDllPath, User-Defined Types:None. Notes:sDllPath must be in the MSDOS 8.3 filename format. Any other format that results in a larger filename will fail. You can use this to access records in databases on the Windows CE Device. Therefore, no platform invoke for the CeDatabase functions are needed. Sample Code: [C#]string sDllPath = @"\dbaccess.dll"; string sFunction = @"MyFunction"; int hResult = CeRapiInvoke(sDllPath, sFunction, 0, IntPtr.Zero, out uiOutput, out pOutput, IntPtr.Zero, 0); if ( hResult != 0 ) {
// Execution Failed } unsafe {
retOutput = new string((char*)pOutput.ToPointer()); } Sample DLL: [C++][dbaccess.h] #ifndef DBACCESS_H #define DBACCESS_H #ifndef RAPISTREAMFLAG typedef enum tagRAPISTREAMFLAG {
STREAM_TIMEOUT_READ } RAPISTREAMFLAG; DECLARE_INTERFACE_ (IRAPIStream, IStream ) {
STDMETHOD(SetRapiStat)(THIS_ RAPISTREAMFLAG Flag, DWORD dwValue) PURE; }; #endif #ifdef __cplusplus extern "C"{ #endif __declspec (dllexport) INT MyFunction( DWORD, BYTE*, DWORD*, BYTE*, IRAPIStream *, PVOID ); __declspec (dllexport) INT GetScannedInXML( DWORD, BYTE*, DWORD*, BYTE*, IRAPIStream *, PVOID ); #ifdef __cplusplus } #endif #endif [dbaccess.cpp] #include "dbaccess.h" #define MAXSTRINGLENGTH 1024 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
return TRUE; } INT MyFunction( DWORD cbInput, BYTE pInput, DWORD pcbOutput, BYTE *ppOutput, IRAPIStream *pStream, PVOID reserved ) INT GetScannedInXML( DWORD cbInput, BYTE pInput, DWORD pcbOutput, BYTE *ppOutput, IRAPIStream *pStream, PVOID reserved ) {
LPTSTR outBuffer;
LocalFree( pInput ); } Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|