Click here to Skip to main content
14,975,219 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my Vc DLL Source is
-=========================================================
#ifndef IZZIXFELAPI32_H
#define IZZIXFELAPI32_H

#ifdef IZZIXFELAPI32_EXPORTS
#define IZZIXFELAPI32_API __declspec(dllexport)
#else
#define IZZIXFELAPI32_API __declspec(dllimport)
#endif

#define MAX_FEATUREVECT_LEN 480
#define HIGH_LEVEL 2
#define MEDIUM_LEVEL 1
#define LOW_LEVEL 0

// Error code of FingerAPI 
#define FPAPIERR_NO 0 
#define FPAPIERR_OK 1
#define FPAPIERR_GENERAL_ERROR -1
#define FPAPIERR_CAN_NOT_OPEN_DEVICE -2

#define FPAPIERR_MATCH_FAILED -101
#define FPAPIERR_CAN_NOT_ALLOC_MEMORY -201
#define FPAPIERR_VECT_FAILED -301 
#define FPAPIERR_INVALID_IMAGESIZE -401
#define FPAPIERR_FAKER_FINGERPRINT -501

#define FPAPIERR_LEFT_FINGERPRINT -601
#define FPAPIERR_RIGHT_FINGERPRINT -602
#define FPAPIERR_UP_FINGERPRINT -603
#define FPAPIERR_DOWN_FINGERPRINT -604
#define FPAPIERR_SMALL_FINGERPRINT -605

#define FPAPIERR_TOO_WET -701
#define FPAPIERR_TOO_DRY -702


typedef struct
{
BYTE Data[MAX_FEATUREVECT_LEN];
} MINUTIAVECT, *LPMINUTIAVECT;


#ifdef __cplusplus
#define EXTWRN_C extern "C"
#else
#define EXTWRN_C
#endif

#ifdef __cplusplus
extern "C" {
#endif


namespace IzzixFELAPI32
{
void __stdcall DESEncode0(UCHAR *src,UCHAR *dec,UCHAR *key,int num);
void __stdcall DESEncode1(UCHAR *src,UCHAR *dec,UCHAR *key);
int __stdcall DESDecode(UCHAR *src,UCHAR *dec,UCHAR *key);
int __stdcall GetFinger(INT DeviceNumber,BYTE* pRawImage,LPMINUTIAVECT pFeature);
int __stdcall MatchFingerOneToOne(LPMINUTIAVECT pFeatureVect1,
LPMINUTIAVECT pFeatureVect2,
int securitylevel
);

int __stdcall MatchFingerOneToN(
LPMINUTIAVECT pFeatureVect,
LPMINUTIAVECT pDataBaseVects,
int nDataBaseSize,
int securitylevel,
int* pDataBaseIDs,
int* pAlwaysNULL
);

int __stdcall CollectFeature(LPMINUTIAVECT pFeatureVect1,
LPMINUTIAVECT pFeatureVect2,
LPMINUTIAVECT pFeatureVect3,
LPMINUTIAVECT pCollectVect
);

int __stdcall DisplayImage(HWND hWnd,int x1,int y1,int x2,int y2,
BYTE* pImage,int nWidth,int nHeight);

int __stdcall IsAvailableDevice(INT DeviceNumber);
int __stdcall GetSortedIndex(LPMINUTIAVECT pFeatureVect,
LPMINUTIAVECT pDataBaseVects,
int nDataBaseSize,
int* pIndex
);

int __stdcall GetFingerAPIVersion(UCHAR *Version);
int __stdcall GetSerial(INT DeviceNumber,UCHAR *Serial);
int __stdcall ConvertToISO(LPMINUTIAVECT pFeature,int fPos,unsigned char* Template);
int __stdcall ConvertFromISO(unsigned char* Template,LPMINUTIAVECT pFeature);
int __stdcall GetTouchStatus(INT DeviceNumber, BOOL &bTouch);
int __stdcall GetDevInfos(INT DeviceNumber, int *nProductType, int *nSensorType);
}

#ifdef __cplusplus
}
#endif
#endif

Function "DisplayImage" and "GetFinger"
The two do not use at all.
I want to know how to use the structure


-> AccessViolationException
-> Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Posted

1 solution

I suggest you look at www.pinvoke.net[^] to see examples of how to pass a struct to unmanaged code.
   

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