C # Notes For Calling C ++ Functions

Source: Internet
Author: User

I recently developed a client that interacts with hardware. The Development Kit is written in C ++. The client must be implemented in C #. I have encountered some problems during development, make yourself available for future reference.

 

1. Function Name: FPITemplate

2. function prototype

Int FPITemplage (int nPort, unsigned char * psMB, int * lpLength)

3. Function Description

The user enters the fingerprint three times, generates and uploads the fingerprint template.

4. Entry Parameters

NPort: Device Type

5. Exit Parameters

PsMB: the fingerprint template needs to allocate a buffer of 513 bytes.

LpLength: the fingerprint template consists of 512 bytes.

 

Define DLL Functions

         [DllImport(, EntryPoint =              FPITemplate( nPort,  _psMB,  lpLength);

Call in C #

        [] _psMB =   [ _lpLength = _psMB.Length -  i = FPITemplate(FPIDevDetect(), _psMB[], _lpLength);

In this way, fingerprint data can be obtained.

Read the returned byte fingerprint data

 FPI_Str =  (i == =

We hope this will help park friends and avoid detours.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.