带有Vb.net的Vc ++ DLL [英] Vc++ DLL With Vb.net

查看:60
本文介绍了带有Vb.net的Vc ++ DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Vc DLL源是
-================================================= ========

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


函数"DisplayImage"和"GetFinger"
两者根本不使用.
我想知道如何使用结构


-> AccessViolationException
->尝试读取或写入受保护的内存.这通常表明其他内存已损坏.


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.

推荐答案

建议您查看 www .pinvoke.net [ ^ ]来查看如何传递struct到非托管代码.
I suggest you look at www.pinvoke.net[^] to see examples of how to pass a struct to unmanaged code.


这篇关于带有Vb.net的Vc ++ DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆