2
Copyright (c) 1993-2008, Cognitive Technologies
5
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
8
* ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
���� ����������� �� ��������� �����, ���� ������ ������� � �����������
11
* ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
������ ����������, ������������ ��� ���������������, ������ �����������
13
��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
����������� ����� �� ��������.
15
* �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
���� ������������ � �������� �������� ��������� �/��� �����������
17
���������, ���������� �� ���� ��, ��� ���������������� �����������
20
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
������������� ������, ��������� � �������������� ��� ���������� ����������
27
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
36
* Redistributions of source code must retain the above copyright notice,
37
this list of conditions and the following disclaimer.
38
* Redistributions in binary form must reproduce the above copyright notice,
39
this list of conditions and the following disclaimer in the documentation
40
and/or other materials provided with the distribution.
41
* Neither the name of the Cognitive Technologies nor the names of its
42
contributors may be used to endorse or promote products derived from this
43
software without specific prior written permission.
45
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57
// ============================================================================
59
// ============================================================================
61
/*# include <windows.h>*/
62
#include "compat_defs.h"
66
///////////////////////////////////GLOBAL VARIABLES///////////////////////////////
67
static Word16 gwHeightRC = 0;
68
static Word16 gwLowRC = 0;
69
static HANDLE ghStorage = NULL;
70
static HINSTANCE ghInst = NULL;
71
//////////////////////////////////////////////////////////////////////////////////
73
BOOL APIENTRY DllMain( HINSTANCE hModule,
74
DWORD ul_reason_for_call,
77
switch( ul_reason_for_call )
79
case DLL_PROCESS_ATTACH:
82
case DLL_THREAD_ATTACH:
84
case DLL_THREAD_DETACH:
86
case DLL_PROCESS_DETACH:
92
/////////////////////////////////////////////////////////////////////////////////
93
RPIC_FUNC(Bool32) RPIC_Init(Word16 wHeightCode,HANDLE hStorage)
95
gwHeightRC = wHeightCode;
103
////////////////////////////////////////////////////////////////////////////////
104
RPIC_FUNC(Bool32) RPIC_Done()
112
//////////////////////////////////////////////////////////////////////////////////
113
RPIC_FUNC(Word32) RPIC_GetReturnCode()
116
if(gwLowRC && (gwLowRC - IDS_ERR_NO)> 0 )
117
rc = (Word32)(gwHeightRC<<16)|(gwLowRC - IDS_ERR_NO);
120
//////////////////////////////////////////////////////////////////////////////////
121
RPIC_FUNC(Int8 *) RPIC_GetReturnString(Word32 dwError)
123
Word16 rc = (Word16)(dwError & 0xFFFF) + IDS_ERR_NO;
124
static Int8 szBuffer[512];
126
if( dwError >> 16 != gwHeightRC)
127
gwLowRC = IDS_ERR_NOTIMPLEMENT;
129
if( rc >= IDS_ERR_NO )
130
LoadString(ghInst,rc,(char *)szBuffer,sizeof(szBuffer));
136
//////////////////////////////////////////////////////////////////////////////////
137
RPIC_FUNC(Bool32) RPIC_GetExportData(Word32 dwType, void * pData)
143
#define CASE_FUNCTION(a) case RPIC_FN##a: *(FN##a *)pData = a; break
144
#define CASE_DATA(a,b,c) case a: *(b *)pData = c; break
148
CASE_FUNCTION(RPIC_SearchPictures);
155
*(char **)pData = NULL;
156
gwLowRC = IDS_ERR_NOTIMPLEMENT;
164
//////////////////////////////////////////////////////////////////////////////////
165
RPIC_FUNC(Bool32) RPIC_SetImportData(Word32 dwType, void * pData)
171
#define CASE_DATA(a,b,c) case a: c = *(b *)pData; break
174
// CASE_DATA(RLINE_Bool32_NOFILLGAP3,Bool32,gbNOFILLGAP3);
177
gwLowRC = IDS_ERR_NOTIMPLEMENT;
183
//////////////////////////////////////////////////////////////////////////////////
185
void SetReturnCode_rpic(Word32 rc)
187
Word16 low = (Word16)(rc & 0xFFFF);
188
Word16 hei = (Word16)(rc >> 16);
191
gwLowRC = (Word16)rc;
195
gwLowRC = (Word16)((Word32)(gwHeightRC<<16)|(low - IDS_ERR_NO));
201
Word32 GetReturnCode_rpic()
204
Word16 low = (Word16)(gwLowRC & 0xFFFF);
205
Word16 hei = (Word16)(gwLowRC >> 16);
207
if(hei == gwHeightRC || hei == 0)
208
rc = low + IDS_ERR_NO;
212
//////////////////////////////////////////////////////////////////////////////////
214
//////////////////////////////////////////////////////////////////////////////////