Twain_DSM
1.0
|
Functions | |
DSMENTRY | DSM_Entry (TW_IDENTITY *_pOrigin, TW_IDENTITY *_pDest, TW_UINT32 _DG, TW_UINT16 _DAT, TW_UINT16 _MSG, TW_MEMREF _pData) |
Data Source Manager Entry Point. More... | |
BOOL WINAPI | DllMain (HINSTANCE _hmodule, DWORD _dwReasonCalled, LPVOID) |
DllMain is only needed for Windows, and it's only needed to collect our instance handle, which is also our module handle. More... | |
BOOL CALLBACK | SelectDlgProc (HWND _hWnd, UINT _Message, WPARAM _wParam, LPARAM _lParam) |
We support a selection dialog on Windows. More... | |
BOOL CALLBACK | EnumChildProc (HWND hwnd, LPARAM lParam) |
We support a selection dialog on Windows. More... | |
TW_HANDLE PASCAL | DSM_MemAllocate (TW_UINT32 _bytes) |
void PASCAL | DSM_MemFree (TW_HANDLE _handle) |
TW_MEMREF PASCAL | DSM_MemLock (TW_HANDLE _handle) |
void PASCAL | DSM_MemUnlock (TW_HANDLE _handle) |
void * | DSM_LoadFunction (void *_pHandle, const char *_pszSymbol) |
This function wraps the function loading calls. More... | |
Variables | |
TW_INT16 | TwLocalize::Language |
Language. | |
BYTE | TwLocalize::CharSet |
Character Set. | |
LANGID | TwLocalize::LangId |
Language Id. | |
char * | TwLocalize::Title |
the Title string | |
char * | TwLocalize::Sources |
the Sources string | |
char * | TwLocalize::Select |
the Select string | |
char * | TwLocalize::Cancel |
the Cancel string | |
BOOL WINAPI DllMain | ( | HINSTANCE | _hmodule, |
DWORD | _dwReasonCalled, | ||
LPVOID | |||
) |
DllMain is only needed for Windows, and it's only needed to collect our instance handle, which is also our module handle.
Don't ever put anything else in here, not even logging messages. It just isn't safe...
[in] | _hmodule | handle to the application that loaded the DSM |
[in] | _dwReasonCalled | why this function is being called |
Definition at line 1425 of file dsm.cpp.
References CTwnDsm::DSMGetState(), dsmState_Open, g_hinstance, g_ptwndsm, kLOG, and kLOGERR.
DSMENTRY DSM_Entry | ( | TW_IDENTITY * | _pOrigin, |
TW_IDENTITY * | _pDest, | ||
TW_UINT32 | _DG, | ||
TW_UINT16 | _DAT, | ||
TW_UINT16 | _MSG, | ||
TW_MEMREF | _pData | ||
) |
Data Source Manager Entry Point.
The entry point we want to return to the caller, instead of the one they thought they were getting from TWAIN_32.DLL...
The only entry point into the Data Source Manager. This is the only function not a part of CTwnDsm. It's responsible for managing the class. We keep things organized this way to make sure that we don't allocate any resources until MSG_OPENDSM, and that we release all resources as a part of MSG_CLOSEDSM. If this is done correctly then we won't mind if the library isn't freed (which has been seen to happen sometimes with COM)...
Defined in twain.h
[in] | _pOrigin | Identifies the source module of the message. This could identify an Application, a Source, or the Source Manager. |
[in] | _pDest | Identifies the destination module for the message. This could identify an application or a data source. If this is NULL, the message goes to the Source Manager. |
[in] | _DG | The Data Group. Example: DG_IMAGE. |
[in] | _DAT | The Data Attribute Type. Example: DAT_IMAGEMEMXFER. |
[in] | _MSG | The message. Messages are interpreted by the destination module with respect to the Data Group and the Data Attribute Type. Example: MSG_GET. |
[in,out] | _pData | A pointer to the data structure or variable identified by the Data Attribute Type. Example: (TW_MEMREF)&ImageMemXfer where ImageMemXfer is a TW_IMAGEMEMXFER structure. |
Definition at line 314 of file dsm.cpp.
References CTwnDsm::DSM_Entry(), CTwnDsm::DSMGetState(), dsmState_Open, g_ptwndsm, and kPANIC.
void* DSM_LoadFunction | ( | void * | _pHandle, |
const char * | _pszSymbol | ||
) |
This function wraps the function loading calls.
Linux has a special way to check dlsym failures.
Definition at line 3892 of file dsm.cpp.
References kLOG, kLOGERR, and LOADFUNCTION.
BOOL CALLBACK EnumChildProc | ( | HWND | hwnd, |
LPARAM | lParam | ||
) |
We support a selection dialog on Windows.
This function is part of our CTwnDsm class, so we don't have to have a lot of pointers, and we can keep things private, unlike what we would have to do if we put this code into the function we actually pass to DialogBox...
[in] | hwnd | Window handle of the dialog |
[in] | lParam | lparam |
Definition at line 1505 of file dsm.cpp.
Referenced by CTwnDsm::SelectDlgProc().
BOOL CALLBACK SelectDlgProc | ( | HWND | _hWnd, |
UINT | _Message, | ||
WPARAM | _wParam, | ||
LPARAM | _lParam | ||
) |
We support a selection dialog on Windows.
I wish we didn't, it's more trouble than it's worth, but it's part of that legacy thing. This function is properly constructed for use with DialogBox...
[in] | _hWnd | Window handle of the dialog |
[in] | _Message | message |
[in] | _wParam | wparam |
[in] | _lParam | lparam |
Definition at line 1472 of file dsm.cpp.
References g_ptwndsm, and CTwnDsm::SelectDlgProc().