Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

Unable to compile project - inconsistent dll linkage

$
0
0

I decided (after many years) to re-compile my project using MFC as a shared DLL rather than statically.

I did a full rebuild and encountered several errors with inconsistent dll linkage. The class in question is defined in the header like this:

class AFX_EXT_CLASS CFileVersionInfo
{
}

How to compile?


DLL file is missing after successful BUILD

$
0
0

Hello everybody

I have a small problem and I would like to ask for some help.

I inherited a small VS solution which has 2 sub-projects. The first sub-project should return an executable file and the other one a .dll file. I compile each one separately and in fact the executable file appears but when I build the other one no dll file is to be found!

After being built successfully I did a file search for the dll but it isn't anywhere.

I checked each sub-project's properties and everything seems to be ok (albeit ok to a beginner like me doesn't mean much!)

I should also add that this had been built on VS 6 a few years ago without any issues so I don't believe that there's something wrong with the code itself.

Here are some printscreens :

Any ideas what I am doing wrong?

If there's any further information that I can provide just let me know!

thanks a lot!! :-)

Opening Microsoft Store URIs under Windows 8/8.1

$
0
0

I'm working on a feature that opens Windows Apps in the Microsoft Store from an unmanaged application.

As far as I know, the correct way to programmatically interact with the Store is through URI's descried in
docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-store-app

This works well on Windows 10, however the same URI's seem to only launch the Store as if without any arguments under Windows 8/8.1 (ex. start ms-windows-store://settings just launches the store without navigating to the settings page, the same thing happens when I try to open an app's page.)

Are there any working alternatives for opening apps in the store under 8/8.1?
I've attempted launching "Microsoft.WindowsStore_8wekyb3d8bbwe" through the IApplicationActivationManager interface however I don't know how to format the arguments so that the store recognizes them, currently I'm only able to open the store.

CFile::Close does not flush unwritten data before close the handle. Why?

$
0
0

Hi,

Originally I think CFile::Close will flush all unwritten data into the disk, then close the file handle gracefully. However, after checking the source code for CFile::Close, I find the code below:

void CFile::Close()
{
ASSERT_VALID(this);
ASSERT(m_hFile != INVALID_HANDLE_VALUE);
BOOL bError = FALSE;
if (m_hFile != INVALID_HANDLE_VALUE)
bError = !::CloseHandle(m_hFile);

m_hFile = INVALID_HANDLE_VALUE;
m_bCloseOnDelete = FALSE;
m_strFileName.Empty();

if (bError)
CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName);
}

So it does not invoke CFile::Flush to flush the buffer at all. The only chance is ::CloseHandle. But in document for ::CloseHandle at https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle , it does not mention that the function will flush the buffer as well.

Therefore, if some data are in the written buffer, then CFile::Close will just ignore them and close the file, which makes data losses. Also such a behavior is not expected. Very strange.

wglMakeCurrent fails error 2004

$
0
0

MDI MFC application . Trying to migrate to OpenGL.

wglMakeCurrent fails with error 2004 when different views are activated. Each CView object has its own DC and rendering context.

No idea how to solve.

Thanks

What is the purpose of creating a C++ service and how to use OpenSCManager and CreateService functions when creating a service?

$
0
0

Hello All,

                 

In my windows desktop based application we are creating a C++ service. If the service is running then only the VC++ application executable that is consuming the service is working.

This service is showing under services.msc

I wanted to know what is the purpose of creating a C++ service?

I navigate through the code and understood that we are using the service to add some stuff to the registry. In the code we are using OpenSCManager function and it is to open a handle to the service control manager database. If it is valid handle then we are creating the service using CreateService. Is my understanding is correct?

If it is to add some entries to the registry do we really need to create a service?
 Below is the service related code snippet. 

ErrCode RegisterService (LPCTSTR aServicePath, LPCTSTR aServiceName, LPCTSTR aDisplayName, LPCTSTR aServiceDescription) 
{
    ErrCode err;

    //Just in case the service is installed allready.
UnRegisterService (aServiceName);

    //Get a handle to the Service Manager.
    SC_HANDLE  schSCManager = OpenSCManager(NULL, NULL,SC_MANAGER_ALL_ACCESS);  

    if (schSCManager)
    {     
        //Install the new service
        SC_HANDLE schService = CreateService(schSCManager, 
                                            aServiceName, 
                                            aDisplayName, 
                                            SERVICE_ALL_ACCESS,
                                            SERVICE_WIN32_OWN_PROCESS,// PCPE-663 | SERVICE_INTERACTIVE_PROCESS,
                                            SERVICE_AUTO_START, 
                                            SERVICE_ERROR_NORMAL,
                                            aServicePath, 
                                            NULL, 
                                            NULL, 
                                            NULL, 
                                            NULL, 
                                            NULL);

        if (schService) 
        {
// Give the service a description ...
SERVICE_DESCRIPTION desc; 
desc.lpDescription = LPTSTR(aServiceDescription); 

ChangeServiceConfig2 (schService, SERVICE_CONFIG_DESCRIPTION, &desc);

if (StartService(schService, 0, NULL))
{
err = ERR_SUCCESS;
}
            CloseServiceHandle(schService); 
        }

        CloseServiceHandle(schSCManager); 
    }
    else
    {
        assert("RegisterService()" == NULL);  //OpenSCManager failed.
    }

    return err;

}

Regards

MFC CEdit and 'Want Return"

$
0
0

It is VS 2019 Community 2019 16.1.6, Win 7 Pro SP1, VC++ Dialog-based application.

Among Project Properties: Win SDK 10.0.17763.0; Platform Tools VS 2019 (142); Use MFC as Shared Dll; Use Unicode Character Set. 

In my CDialogEx I have a standard CEdit added to my dialog via Resource Editor. The  "Want Return" option is set to "True."

All is compile and built and run just fine.

But the only problem I have:: When the user is entering characters from KBD into the CEdit,  the "Enter" Key pressing terminates the app. I expect, because of "Want Return", the "Enter" should be swallowed by CEdit control and does not terminate the App

What is my error and how the user can notify the CEdit that he/she ended entering characters into CEdit?

Thanks.

How to determine a CFile object is writable or not?

$
0
0

Hi,

I am writing a function void MyFun(CFile& File), which receive a CFile object(which is already opened). In MyFun, I need to check whether I can write data to File. How to do that?

Thanks



How to get portable device windows path?

$
0
0
I am trying to open from my c++ application the folder location of the newly connected portable device.
The device when in opened in explorer, it is in "Computer/Xperia Z2". But when I try to use this directly or simply hardcoding this path, path was not found.

I was able to get

    dbcc_name = "\\\\?\\USB#VID_0FCE&PID_01AF#CB5A20JNTB#{6ac27878-a6fa-4155-ba85-f98f491d4f33}"
    Device Friendly Name = "Xperia Z2" 
Can you please help me get the file system location?

How make algorithm processsor cache friendly?

$
0
0

I tested methods of Suffix Array creating, naive method, although using quick sort was more cache friendly than SA-IS.

SA-IS  for 150 kB block is even 4x faster than naive, but for 10 MB block is only 1.1 x faster, although should be linear compared to n*log(n) naive. Probably it is processor cache problem. How change it to "external"? For small blocks would be a bit slower, but for large blocks faster (?). How determine processor cache size? Is any tool for cache analyzing?


MIDL 2813 "Unexpected end of file found"

$
0
0

Hi guys,

Recently, There were problems have plagued me for a long time. I have not a permission to show my code in full in term of some restrications from my company. Nonetheless, I can just demonstrate simply what codes in my project, one of which were  written in below section:

#import "xxx.idl"

#import "xxx.idl"

[
uuid(xxx),
version(xxx),
helpstring(xxx)
]
library xxx
{
#include "xxx"
};

As the above stuff you saw, This file have suffix name .idl. And, this file can be fine compiled by vs2013, However, it's surprising that the same code can't be compiled by vs2017 well. I can't understand what problems the vs2017 encounter. The error information can be reported in following format:

Code:                                 Description:

MIDL 2813                          unexpected end of file found

can someone supply information to fix this issue?

thanks,guys!

Lnk 2019 occurred in static library at MFC project

$
0
0

I'v got 3 files from a SW provider, idkit.h, sample.cpp and idkit.lib. I include sample.cpp in my a MFC project. I did a little trivial modification. I am sure below:

1. From Linker --> General --> Additional Library Directories, the folder containing idkit.lib was included.

2. From Linker --> Advanced --> Import Library, the idkit.lib was included

I built it, passing compilation, but getting below linking failure. How come?

Sampe.cpp and idkit.h are as below. I removed some unimportant snippet.

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_IEngine_InitModule referenced in function "int __cdecl match(void)" (?match@@YAHXZ) MFCApplication3 D:\programs\IDKit\face-match\MFCApplication3\MFCApplication3Dlg.obj 1 

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_IEngine_TerminateModule referenced in function "int __cdecl match(void)" (?match@@YAHXZ) MFCApplication3 D:\programs\IDKit\face-match\MFCApplication3\MFCApplication3Dlg.obj 1 

….

Sample.cpp

/*******************************************************************************
*
*   Project         :   Sample Face Modality
*   Filename        :   sample.cpp
*   Description     :   This sample will extract face templates from
*                       images 001-003.png. Templates are then compared against
*                       each other and a matching score is calculated.
*
*
*   Company         :   Innovatrics
*   Product         :   IDKit Multi SDK
*   Platform        :   Linux/Windows
*   Language        :   C++
*   Operating System:   Universal
*
*
*   Copyright (C) 2006-2018 Innovatrics.  All rights reserved.
******************************************************************************/
#include <cstdlib>
#include <iostream>
#include <vector>
#include "idkit.h"
// Error Checking Macro
#define CHECK_ERROR( msg, err ) {                                                                           \
    if ( (err) != IENGINE_E_NOERROR ) {                                                                     \
        std::cout << (msg) << ": Error code " << (err) << " - " << IEngine_GetErrorMsg(err) << std::endl;   \
  exit(err);                       \
 }                                                                                                       \
}                                                                                                           \
int main()
{
    // Get and display Hardware ID for support purposes
    int hwid_len = 0;
    int ret = IEngine_GetHardwareId(NULL, &hwid_len);
    CHECK_ERROR("IEngine_GetHardwareId", ret);
    std::vector<char> hwId(static_cast<unsigned long>(hwid_len + 1));
    ret = IEngine_GetHardwareId(&hwId[0], &hwid_len);
 CHECK_ERROR("IEngine_GetHardwareId", ret);
 hwId[hwid_len] = '\0';
    std::cout << "This computer's HWID is: " << &hwId[0] << std::endl;
    // Get and display IDKit version
    const char *vers_string = IEngine_GetProductString();
    std::cout << "Product string is: " << vers_string << std::endl;
    int userID, score;
    // Module initialization
    ret = IEngine_InitModule();
    CHECK_ERROR("IEngine_InitModule", ret);
    std::cout << "IEngine Library Initialized." << std::endl;
    // Initialize user structures
    IENGINE_USER user1 = IEngine_InitUser();
 IENGINE_USER user2 = IEngine_InitUser();
 IENGINE_USER user3 = IEngine_InitUser();
    if(user1 == NULL || user2 == NULL || user3 == NULL) {
        std::cout << "InitUser memory error." << std::endl;
        exit(1);
    }
    // Extract user's templates
    ret = IEngine_AddFaceFromFile(user1, "001.png", 0, 0);
    CHECK_ERROR("IEngine_AddFaceFromFile", ret);
    ret = IEngine_AddFaceFromFile(user2, "002.png", 0, 0);
    CHECK_ERROR("IEngine_AddFaceFromFile", ret);
    ret = IEngine_AddFaceFromFile(user3, "003.png", 0, 0);
    CHECK_ERROR("IEngine_AddFaceFromFile", ret);
    // Get face quality score
    int quality = 0;
    ret = IEngine_GetFaceQuality(user1, 0, &quality);
    CHECK_ERROR("IEngine_GetFaceQuality", ret);
    std::cout << "user1 face quality score: " << quality << std::endl;
    ret = IEngine_GetFaceQuality(user2, 0, &quality);
    CHECK_ERROR("IEngine_GetFaceQuality", ret);
    std::cout << "user2 face quality score: " << quality << std::endl;
    ret = IEngine_GetFaceQuality(user3, 0, &quality);
    CHECK_ERROR("IEngine_GetFaceQuality", ret);
    std::cout << "user3 face quality score: " << quality << std::endl;
    // Match users
    ret = IEngine_MatchUsers(user1, user2, &score);
    CHECK_ERROR("IEngine_MatchUsers", ret);
    std::cout << "Matching user1 to user2, score: " << score << std::endl;
    ret = IEngine_MatchUsers(user3, user2, &score);
    CHECK_ERROR("IEngine_MatchUsers", ret);
    std::cout << "Matching user3 to user2, score: " << score << std::endl;
    // Release resources
    if (user1) {
        ret = IEngine_FreeUser(user1);
        CHECK_ERROR("IEngine_FreeUser", ret);
    }
    if (user2) {
        ret = IEngine_FreeUser(user2);
        CHECK_ERROR("IEngine_FreeUser", ret);
    }
    if (user3) {
        ret = IEngine_FreeUser(user3);
        CHECK_ERROR("IEngine_FreeUser", ret);
    }

    ret = IEngine_TerminateModule();
    CHECK_ERROR("IEngine_TerminateModule", ret);
}

=============================================

Idkit.h

#ifndef INNOVATRICS_IDKIT_H
#define INNOVATRICS_IDKIT_H
#ifdef __cplusplus
# define IDKIT_BOOL bool
#else
# define IDKIT_BOOL char
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MSC_VER
#define IDKIT_API __declspec( dllimport )
#else
#define IDKIT_API
#endif
#define CRYPT_KEY_LENGTH 32
#define MAX_CRITICAL_POINTS_COUNT 16
#define IPLUGIN_DESCRIPTION_MAX_LEN 256

// === Types definition === //
typedef enum
{
    UNKNOWN_FINGER = 0,
    RIGHT_THUMB = 1,
    RIGHT_INDEX = 2,
    RIGHT_MIDDLE = 3,
    RIGHT_RING = 4,
    RIGHT_LITTLE = 5,
    LEFT_THUMB = 6,
    LEFT_INDEX = 7,
    LEFT_MIDDLE = 8,
    LEFT_RING = 9,
    LEFT_LITTLE = 10,
    UNKNOWN_PALM = 20,
    RIGHT_FULL_PALM = 21,
    LEFT_FULL_PALM = 23,
    UNKNOWN_PRINT = 40
} IENGINE_FINGER_POSITION;
typedef enum
{
    UNKNOWN_EYE = 0,
    LEFT_EYE    = 1,
    RIGHT_EYE   = 2
} IENGINE_IRIS_POSITION;
typedef enum
{
  IRIS_IMAGE_TYPE_DEFAULT  = 0,
  IRIS_IMAGE_TYPE_ISOTYPE2 = 1,
  IRIS_IMAGE_TYPE_ISOTYPE3 = 2,
  IRIS_IMAGE_TYPE_ISOTYPE7 = 3
} IENGINE_IRIS_IMAGE_TYPE;
typedef enum
{
 IENGINE_FORMAT_BMP = 0,
 IENGINE_FORMAT_PNG = 1,
 IENGINE_FORMAT_JPG = 2,
 IENGINE_FORMAT_GIF = 3,
 IENGINE_FORMAT_TIF = 4,
 IENGINE_FORMAT_WSQ = 5,
 IENGINE_FORMAT_JPEG2K=6
} IENGINE_IMAGE_FORMAT;
typedef enum
{
    FORMAT_ICS = 1,
    FORMAT_ANSI = 2,
 FORMAT_ISO = 3,
    FORMAT_ANSI_PLUS = 4,
    FORMAT_ISO_PLUS = 5
} IENGINE_TEMPLATE_FORMAT;
typedef enum
{
    CFG_BEST_CANDIDATES_COUNT = 0,
    CFG_SIMILARITY_THRESHOLD = 1,
    CFG_SCANNER_TYPE = 2,
    CFG_RESOLUTION_DPI = 3,
    CFG_MAX_ROTATION = 4,
    CFG_STORE_IMAGES = 5,
    CFG_IDENTIFICATION_SPEED = 6,
    CFG_NETWORK_COMPRESSION = 7,
    CFG_LOG_LEVEL = 8,
    CFG_MAX_TEMPLATE_SIZE = 10,
    CFG_JPEG2K_COMPRESSION_RATIO = 11,
    CFG_WSQ_BITRATE = 12,
    CFG_DB_IMAGE_FORMAT = 13,
    CFG_LOAD_IMAGES = 14,
    CFG_MAX_ODBC_LOADING_THREADS = 15,
    //  not supported CFG_ICS_TEMPLATE_VERSION = 16,
    CFG_EXTRACT_CRITICAL_POINTS = 17,
    CFG_EXTRACTOR_ALGORITHM = 18,
    CFG_IFACE_DETECT_FORCED = 19,
 CFG_IFACE_IGNORE_MULTIPLE_FACES = 23,
 CFG_IFACE_DETECTION_MODE = 24,
 CFG_MAX_IENGINE_THREAD_COUNT = 25,
    CFG_IFACE_EXTRACTION_MODE = 26
} IENGINE_CONFIG;
typedef enum
{
    MODE_GENERAL = 0,
    MODE_ROLLED = 6
} IENGINE_SCANNER_TYPE;
typedef enum
{
 EXTRACTOR_SPEED_NORMAL = 0,
 EXTRACTOR_SPEED_FAST = 2,
 EXTRACTOR_SPEED_FASTEST = 4
} IENGINE_EXTRACTOR_ALGORITHM;
typedef enum
{
    MODALITY_FINGER = 1<<0,
    MODALITY_FACE = 1<<1,
    MODALITY_IRIS = 1<<3,
    MODALITY_ALL = 0xFFFFFFFF
} IENGINE_MATCHING_MODALITY;
typedef void *IENGINE_USER;
typedef void *IENGINE_COLLECTION;
typedef void *IENGINE_CONNECTION;
typedef struct
{
    unsigned char angle;
    unsigned short x;
    unsigned short y;
    unsigned char type;
    unsigned char quality;
} IENGINE_MINUTIAE, *IENGINE_MINUTIAE_PTR;
typedef struct
{
 unsigned char angle;
 unsigned short x;
 unsigned short y;
 unsigned char type;
} IENGINE_CRITICAL_POINT, *IENGINE_CRITICAL_POINT_PTR;
// === Initialization and Termination functions ===//
IDKIT_API int IEngine_InitModule( );
IDKIT_API int IEngine_InitWithLicense( const unsigned char *license, int length );
IDKIT_API int IEngine_InitWithChallenge(unsigned char *challenge, unsigned int * challenge_size, const unsigned char *hmac_signature, unsigned int hmac_size);
IDKIT_API int IEngine_TerminateModule( );

// === Connections === //
IDKIT_API IENGINE_CONNECTION IEngine_InitConnection();
IDKIT_API int IEngine_SelectConnection(const IENGINE_CONNECTION connection);
IDKIT_API int IEngine_CloseConnection(IENGINE_CONNECTION connection);
#ifndef IDKIT_LIGHT_SDK
IDKIT_API int IEngine_Connect( const char * databaseFile);
IDKIT_API int IEngine_InitClient( const char * connectionString );
#endif
// === Configuration Functions === //
IDKIT_API int IEngine_SetParameter( IENGINE_CONFIG parameter, int value );
IDKIT_API int IEngine_GetParameter( IENGINE_CONFIG parameter, int *value );
IDKIT_API int IEngine_SetCryptKey(const unsigned char cryptKey[CRYPT_KEY_LENGTH]);

// === Product Version Information === //
IDKIT_API const char * IEngine_GetProductString();

// === Database Management Related Functions === //
#ifndef IDKIT_LIGHT_SDK
IDKIT_API int IEngine_ClearDatabase();
IDKIT_API int IEngine_RegisterUser(const IENGINE_USER user, int * userID );
IDKIT_API int IEngine_RegisterUserAs(const IENGINE_USER user, int userID );
IDKIT_API int IEngine_UpdateUser( const IENGINE_USER user, int userID );
IDKIT_API int IEngine_RemoveUser( int userID );
IDKIT_API int IEngine_GetUserIfExists( IENGINE_USER user , int userID, int * userExists );
IDKIT_API int IEngine_GetUser( IENGINE_USER user, int userID );
IDKIT_API int IEngine_UserExists( int userID , int * userExists );
IDKIT_API int IEngine_GetUserCount(int *userCount);
IDKIT_API int IEngine_GetMemoryUsage(int * memoryUsage);
IDKIT_API int IEngine_GetUserLimit(int *userLimit);
IDKIT_API int IEngine_GetAllUserIDs(IENGINE_COLLECTION collection);
IDKIT_API int IEngine_GetUserIDsByQuery(IENGINE_COLLECTION collection, const char * query);
#endif
// === User Related Functions === //
IDKIT_API IENGINE_USER IEngine_InitUser();
IDKIT_API int IEngine_CopyUser( const IENGINE_USER srcUser, IENGINE_USER dstUser, IDKIT_BOOL withImages);
IDKIT_API int IEngine_ClearUser( IENGINE_USER user);
IDKIT_API int IEngine_FreeUser( IENGINE_USER user);
IDKIT_API int IEngine_AddFingerprint( IENGINE_USER user, IENGINE_FINGER_POSITION fingerPosition, const unsigned char * fingerprintImage, int imgSize);
IDKIT_API int IEngine_AddFingerprintRAW( IENGINE_USER user, IENGINE_FINGER_POSITION position, const unsigned char * rawImage, int width, int height);
IDKIT_API int IEngine_GetIntermediateImages(const unsigned char* rawImage, int width, int height, unsigned char* skeleton, unsigned char* filtered, unsigned char* binarized, int* bWidth, int* bHeight, unsigned char* bMask);
IDKIT_API int IEngine_AddFingerprintFromFile( IENGINE_USER user, IENGINE_FINGER_POSITION fingerPosition, const char * filename);
IDKIT_API int IEngine_AddFingerprintFromUser( IENGINE_USER user, IENGINE_USER fromUser, int fromIndex, IDKIT_BOOL withImage );
IDKIT_API int IEngine_SetCustomData( IENGINE_USER user, const unsigned char *data, int length );
IDKIT_API int IEngine_SetFingerprint( IENGINE_USER user, int fingerprintIndex, IENGINE_FINGER_POSITION fingerPosition, const unsigned char * fingerprintImage, int imgSize);
IDKIT_API int IEngine_SetFingerprintRAW( IENGINE_USER user, int fingerprintIndex, IENGINE_FINGER_POSITION fingerPosition, const unsigned char * rawImage, int width, int height );
IDKIT_API int IEngine_SetFingerprintFromFile( IENGINE_USER user, int fingerprintIndex, IENGINE_FINGER_POSITION fingerPosition, const char * filename);
IDKIT_API int IEngine_SetFingerprintFromUser( IENGINE_USER user, int index, const IENGINE_USER fromUser, int fromIndex, IDKIT_BOOL withImage );
IDKIT_API int IEngine_SetFingerPosition( IENGINE_USER user, int fingerprintIndex, IENGINE_FINGER_POSITION fingerPosition);
IDKIT_API int IEngine_RemoveFingerprint( IENGINE_USER user, int fingerprintIndex);
IDKIT_API int IEngine_AttachFingerprintImage(IENGINE_USER user, int fingerprintIndex, const unsigned char * fingerprintImage);
IDKIT_API int IEngine_GetCustomData( const IENGINE_USER user, unsigned char *data, int *length );
IDKIT_API int IEngine_FingerprintImageExists( const IENGINE_USER user, int index, int * exists );
IDKIT_API int IEngine_GetFingerprintImage( const IENGINE_USER user, int fingerprintIndex, IENGINE_IMAGE_FORMAT format, unsigned char * fingerprintImage, int * length );
IDKIT_API int IEngine_SaveFingerprintImage( const IENGINE_USER user, int fingerprintIndex, IENGINE_IMAGE_FORMAT format, const char *filename);
IDKIT_API int IEngine_GetFingerPosition( const IENGINE_USER user, int fingerprintIndex, IENGINE_FINGER_POSITION *fingerPosition);
IDKIT_API int IEngine_GetFingerprintCount( const IENGINE_USER user, int *fingerprintCount);
IDKIT_API int IEngine_GetFingerprintQuality(const IENGINE_USER user,int fingerprintIndex, int *quality);
IDKIT_API int IEngine_GetFingerprintPresence(const unsigned char * fingerprintImage, int imgSize, int *presence);
IDKIT_API int IEngine_GetFingerprintPresenceRAW( const unsigned char * rawImage, int width, int height, int *presence );
IDKIT_API int IEngine_GetFingerprintClass(const unsigned char* fingerprintImage, int length, int *fingerprintClass);
IDKIT_API int IEngine_SaveMinutiaeImage( const IENGINE_USER user, int fingerprintIndex, IENGINE_IMAGE_FORMAT format, const char *filename);
IDKIT_API int IEngine_GetMinutiaeImage( const IENGINE_USER user, int fingerprintIndex, IENGINE_IMAGE_FORMAT format,unsigned char * minutiaeImage, int * length );
IDKIT_API int IEngine_GetMinutiaePoints( const IENGINE_USER user, int fingerprintIndex, int *minutiaeCount, IENGINE_MINUTIAE* minutiae);
IDKIT_API int IEngine_GetDeltasAndCores( const IENGINE_USER user, int fingerprintIndex, int * criticalPointsCount, IENGINE_CRITICAL_POINT criticalPoints[MAX_CRITICAL_POINTS_COUNT] );

// === User Related Functions : Extended Use === //
IDKIT_API int IEngine_ExportUserTemplate(const IENGINE_USER user, IENGINE_TEMPLATE_FORMAT format, unsigned char *templateData, int *length);
IDKIT_API int IEngine_ImportUserTemplate(IENGINE_USER user, IENGINE_TEMPLATE_FORMAT format, const unsigned char *templateData);
IDKIT_API int IEngine_ExportCompactTemplate(const IENGINE_USER userRecord,int fingerprintIndex,int maxTemplateSize,unsigned char *compactTemplate,int *templateSize);
IDKIT_API int IEngine_ImportCompactTemplate( IENGINE_USER user, const unsigned char * compactTemplate, IENGINE_FINGER_POSITION fingerPosition );
IDKIT_API int IEngine_SerializeUser( const IENGINE_USER user, IDKIT_BOOL serializeImages, unsigned char * buffer, int * length );
IDKIT_API int IEngine_DeserializeUser( IENGINE_USER user, const unsigned char * buffer );

// === User Related Functions : Tags === //
IDKIT_API int IEngine_SetStringTag(IENGINE_USER user, const char * name, const char * value);
IDKIT_API int IEngine_GetStringTag(const IENGINE_USER user, const char * name, char * value, int * length);
IDKIT_API int IEngine_SetIntTag(IENGINE_USER user, const char * name, int value);
IDKIT_API int IEngine_GetIntTag(const IENGINE_USER user, const char * name, int * value);
IDKIT_API int IEngine_ClearTag(IENGINE_USER user, const char * name);
IDKIT_API int IEngine_HasTag(const IENGINE_USER user, const char * name, int * present);
IDKIT_API int IEngine_GetTagCount(const IENGINE_USER user, int * count);
IDKIT_API int IEngine_GetTagName(const IENGINE_USER user, int offset, char * name, int * length);
// === User Collection Functions === //
#ifndef IDKIT_LIGHT_SDK
IDKIT_API IENGINE_COLLECTION IEngine_InitCollection();
IDKIT_API int IEngine_FreeCollection(IENGINE_COLLECTION collection);
IDKIT_API int IEngine_GetCollectionSize(const IENGINE_COLLECTION collection, int * count);
IDKIT_API int IEngine_GetCollectionIDs(const IENGINE_COLLECTION collection, int * ids, int count);
#endif
// === Conversion Functions === //
IDKIT_API int IEngine_ConvertBmp2RawImage(const unsigned char *bmpImage, int bmpSize,unsigned char * rawImage, int *width, int *height);
IDKIT_API int IEngine_ConvertRawImage2Bmp(const unsigned char *rawImage, int width, int height, unsigned char * bmpImage, int *length);
IDKIT_API int IEngine_ConvertImage(const unsigned char *inImage, int inLength, IENGINE_IMAGE_FORMAT format, unsigned char *outImage, int *outLength);
IDKIT_API int IEngine_RescaleImage(const unsigned char *inImage, int inWidth, int inHeight, int dpi, unsigned char *outImage, int *outWidth, int *outHeight);
// === Identification Functions === //
#ifndef IDKIT_LIGHT_SDK
IDKIT_API int IEngine_FindUser(const IENGINE_USER user, int * userID, int * score );
IDKIT_API int IEngine_FindFingerprint(const IENGINE_USER user, int fingerprintIndex, int * userID, int *bestIndex, int * score );
IDKIT_API int IEngine_FindUserInSelection(const IENGINE_USER user,int selectionCount, const int *selectedUserIDs,int *userID,int *score);
IDKIT_API int IEngine_FindFingerprintInSelection(const IENGINE_USER user, int index, int selectionCount, const int *selectedUserIDs,int * userID, int *bestIndex, int *score);
IDKIT_API int IEngine_FindUserInMemory(const IENGINE_USER user, int recordCount, const unsigned char **recordsInMemory, int *userID, int *score);
IDKIT_API int IEngine_FindFingerprintInMemory(const IENGINE_USER user, int index, int recordCount, const unsigned char **recordsInMemory, int *userID, int *bestIndex, int *score);
IDKIT_API int IEngine_FindUserByQuery(const IENGINE_USER user, const char * query, int * uids, int * scores);
IDKIT_API int IEngine_FindFingerprintByQuery(const IENGINE_USER user, int index, const char * query, int * uids, int * bestIndices, int * scores);
#endif
// === Database Verification Functions (userID) === //
#ifndef IDKIT_LIGHT_SDK
IDKIT_API int IEngine_MatchUser(const IENGINE_USER user, int userID, int * score );
IDKIT_API int IEngine_MatchUserEx(const IENGINE_USER user, int userID, int * score, int * matchingFingersCount );
IDKIT_API int IEngine_MatchUsersModalities(const IENGINE_USER user, const IENGINE_USER user2, int modalities, int * score);
IDKIT_API int IEngine_MatchFingerprint(const IENGINE_USER user, int fingerprintIndex, int userID,int *bestIndex,int * score );
#endif

// === Plain Verification Functions === //
IDKIT_API int IEngine_MatchUsers(const IENGINE_USER probeUser, const IENGINE_USER galleryUser, int * score );
IDKIT_API int IEngine_MatchUsersEx(const IENGINE_USER probeUser, const IENGINE_USER galleryUser, int * score, int * matchingFingersCount );
IDKIT_API int IEngine_MatchFingerprints(const IENGINE_USER probeUser, int fingerprintIndex, const IENGINE_USER galleryUser, int fingerprintIndex2, int * score );
IDKIT_API int IEngine_MatchFingerprints_transformation(const IENGINE_USER probeUser, int index, const IENGINE_USER galleryUser, int index2, int * score, int *dx, int *dy, unsigned char *dAngle);
IDKIT_API int IEngine_MatchFingerprintsEx(const IENGINE_USER probeUser, int fingerprintIndex, const IENGINE_USER galleryUser, int fingerprintIndex2, int * score, int * dx, int * dy, unsigned char * dAngle, int * associationCount, unsigned short * assocProbeMinutiae, unsigned short * assocGalleryMinutiae, unsigned char * assocQuality);

// === Error Handling === //
IDKIT_API const char * IEngine_GetErrorMsg( int errcode );
IDKIT_API int IEngine_SetLogFile( const char * filename );
// === FACE MODALITY API === //
IDKIT_API int IEngine_AddFace( IENGINE_USER user, const unsigned char * image, int imgSize, int minEyeDist, int maxEyeDist );
IDKIT_API int IEngine_AddFaceFromFile( IENGINE_USER user, const char * filename, int minEyeDist, int maxEyeDist );
IDKIT_API int IEngine_AddFaceTemplate( IENGINE_USER user, const unsigned char * templateData, int length );
IDKIT_API int IEngine_AddFaceRAW( IENGINE_USER user, const unsigned char * rawImage, int width, int height, int minEyeDist, int maxEyeDist );
IDKIT_API int IEngine_SetFace( IENGINE_USER user, int index, const unsigned char * image, int imgSize, int minEyeDist, int maxEyeDist );
IDKIT_API int IEngine_SetFaceRAW( IENGINE_USER user, int index, const unsigned char * rawImage, int width, int height, int minEyeDist, int maxEyeDist );
IDKIT_API int IEngine_SetFaceTemplate( IENGINE_USER user, int index, const unsigned char * templateData, int length );
IDKIT_API int IEngine_GetFaceTemplate( const IENGINE_USER user, int index, unsigned char* templateData, int * length );
IDKIT_API int IEngine_RemoveFace( IENGINE_USER user, int index );
IDKIT_API int IEngine_GetFaceCount( const IENGINE_USER user, int * count );
IDKIT_API int IEngine_MatchFace( const IENGINE_USER user, int index, int uid, int * bestIndex, int * score );
IDKIT_API int IEngine_MatchFaces(const IENGINE_USER user, int index, const IENGINE_USER user2, int index2, int * score );
IDKIT_API int IEngine_GetFaceQuality(const IENGINE_USER user,int faceIndex, int *quality);
// === IRIS MODALITY API === //
IDKIT_API int IEngine_AddIris( IENGINE_USER user, IENGINE_IRIS_POSITION position, IENGINE_IRIS_IMAGE_TYPE imageType, const unsigned char * image, int imgSize, int expectedIrisRadius );
IDKIT_API int IEngine_AddIrisFromFile( IENGINE_USER user, IENGINE_IRIS_POSITION position, IENGINE_IRIS_IMAGE_TYPE imageType, const char * filename, int expectedIrisRadius );
IDKIT_API int IEngine_AddIrisTemplate( IENGINE_USER user, const unsigned char * templateData, int length, int expectedIrisRadius );
IDKIT_API int IEngine_AddIrisRAW( IENGINE_USER user, IENGINE_IRIS_POSITION position, IENGINE_IRIS_IMAGE_TYPE imageType, const unsigned char * rawImage, int width, int height, int expectedIrisRadius );
IDKIT_API int IEngine_SetIris( IENGINE_USER user, int index, IENGINE_IRIS_POSITION position, IENGINE_IRIS_IMAGE_TYPE imageType, const unsigned char * image, int imgSize, int expectedIrisRadius );
IDKIT_API int IEngine_SetIrisRAW( IENGINE_USER user, int index, IENGINE_IRIS_POSITION position, IENGINE_IRIS_IMAGE_TYPE imageType, const unsigned char * rawImage, int width, int height, int expectedIrisRadius );
IDKIT_API int IEngine_SetIrisTemplate( IENGINE_USER user, int index, const unsigned char * templateData, int length );
IDKIT_API int IEngine_GetIrisTemplate( const IENGINE_USER user, int index, unsigned char* templateData, int * length );
IDKIT_API int IEngine_RemoveIris( IENGINE_USER user, int index );
IDKIT_API int IEngine_GetIrisCount( const IENGINE_USER user, int * count );
IDKIT_API int IEngine_MatchIris( const IENGINE_USER user, int index, int uid, int * bestIndex, int * score );
IDKIT_API int IEngine_MatchIrises(const IENGINE_USER user, int index, const IENGINE_USER user2, int index2, int * score );
IDKIT_API int IEngine_GetIrisQuality(const IENGINE_USER user,int irisIndex, int *quality);
IDKIT_API int IEngine_GetIrisPosition( const IENGINE_USER user, int irisIndex, IENGINE_IRIS_POSITION *irisPosition);
IDKIT_API int IEngine_SetIrisPosition( IENGINE_USER user, int irisIndex, IENGINE_IRIS_POSITION irisPosition);
// == NEW == //
IDKIT_API int IEngine_GetHardwareId( char * hwId, int *length);
IDKIT_API int IEngine_GetLicenseInformation( char *hwId, int *hwId_length, char *clientId, int *clientId_length, int *userLimit, int *clientLimit, int *expYear, int *expMonth, int *expDay, char *licFileLocation );
IDKIT_API int IEngine_GetLicenseValue(const char *key, char *value, int *valueLength);
IDKIT_API const char * IEngine_GetServiceState(int *err);
// == Unsupported enums for internal purposes == //
typedef enum {
 CFG_IDENTIFICATION_MINUTIAE_FEATURE_MAP_BUFFER_LEN = 5000,
 CFG_IDENTIFICATION_MINUTIAE_FEATURE_MAP_BUFFER = 5001
} IENGINE_INTERNAL_CONFIG;
typedef enum {
 ACCESS_MODE_READ_ONLY = 0,
 ACCESS_MODE_READ_WRITE,
 ACCESS_MODE_UNKNOWN
} IENGINE_ACCESS_MODE;
// == Unsupported functions for internal purposes == //
IDKIT_API int IEngine_AddMultiScaleFingerprint( IENGINE_USER user, IENGINE_FINGER_POSITION position, const unsigned char * image, int imgSize, int dpi1, int dpi2, int dpi3, int dpi4 );
IDKIT_API int IEngine_AddFingerprintWithMinutiaePoints( IENGINE_USER user, IENGINE_FINGER_POSITION position, const unsigned char * image, int imgSize, unsigned char * imageMask, IENGINE_MINUTIAE * forcedMinutiae, int minutiaeCount );
IDKIT_API int IEngine_SetFingerprintWithMinutiaePoints( IENGINE_USER user, int index, IENGINE_FINGER_POSITION position, const unsigned char * image, int imgSize, unsigned char * imageMask, IENGINE_MINUTIAE * forcedMinutiae, int minutiaeCount );
IDKIT_API int IEngine_AddFingerprintRAWWithMinutiaePoints( IENGINE_USER user, IENGINE_FINGER_POSITION position, const unsigned char * rawImage, int width, int height, unsigned char * imageMask, IENGINE_MINUTIAE * forcedMinutiae, int minutiaeCount );
IDKIT_API int IEngine_SetFingerprintRAWWithMinutiaePoints( IENGINE_USER user, int index, IENGINE_FINGER_POSITION position, const unsigned char * rawImage, int width, int height, unsigned char * imageMask, IENGINE_MINUTIAE * forcedMinutiae, int minutiaeCount );
IDKIT_API int IEngine_SetPtrParameter( IENGINE_CONFIG , void * ptr );
IDKIT_API int IEngine_GetAccessMode(IENGINE_ACCESS_MODE* accessMode);
IDKIT_API int IEngine_ReloadLicense();
// === Error Messages === //
#define IENGINE_E_NOERROR           0
#define IENGINE_E_BADPARAM          1101
#define IENGINE_E_NOFINGERPRINT     1102
#define IENGINE_E_DBOPEN            1111
#define IENGINE_E_DBFAILED          1112
#define IENGINE_E_DBACCESSDENIED    1113
............................................... (removed by me)


#define IENGINE_E_SOAPFAILED        1212
// === Deprecated Symbols === //

#ifdef __cplusplus
}
#endif
#endif // INNOVATRICS_IDKIT_H



Calling postmessage with user defined message on checkbox's click event

$
0
0

Hi,

I need to execute 10 commands(API) when checking the checkbox. I need to log each API's result in the richeditctrl immediately each api is executed.It will take 1 minute to execute these 10 commands

For that I am calling postmessage on checkbox click event. I am facing below problems.

  1. The checkbox is displayed with checked state only after coming out of ON_BN_CLICKED event.
  2. The richeditctrl is getting updated with text only after coming out of ON_BN_CLICKED event. It is not getting updated when each api is executed.
void CUtilityDlg::OnBnClickedCheck1()
{
	if(m_ctrlAutomate.GetCheck())
	{
		PostMessage(WM_USER_MY_OWN_MESSAGE);
	}
}


LRESULT CUtilityDlg::OnUserDefinedMessage(WPARAM wParam, LPARAM lParam)
{
	Automate();
	return 0;
}


Missing msjro.dll

$
0
0

Hello,

I have a pretty old project that was running fine on older windows versions (XP). This project uses odbc to connect to ms access data base. No the goal is to make it run on windows 10 without modifying it too much if possible.

I have Windows 10 1803 (X64), MS Access 2016 (16.0.4819 32 bit) 

When I try to compile this project it gives me the following error when I try to build:

fatal error C1083: Cannot open type library file: 'msjro.dll': No such file or directory.

when I double click on this entry on output console iit takes me to this line:

#import <msjro.dll> rename("EOF", "adoEOF")

msjro.dll windows search gives: program files (x86)/common files/system/ado/msjro.dll

I added \Program Files (x86)\Common Files\system\ado to Additional include directories and then the following error pop upped:

<project path>\debug\msjro.tlh(198): error C3646: 'ConflictTables': unknown override specifier
<project path>\debug\msjro.tlh(198): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<project path>\debug\msjro.tlh(226): error C3646: 'GetConflictTables': unknown override specifier
<project path>\debug\msjro.tlh(226): error C2059: syntax error: '('
<project path>\debug\msjro.tlh(226): error C2238: unexpected token(s) preceding ';'
<project path>\debug\msjro.tli(111): error C2039: 'GetConflictTables': is not a member of 'JRO::IReplica'
<project path>\debug\msjro.tlh(187): note: see declaration of 'JRO::IReplica'
<project path>\debug\msjro.tli(111): error C7525: inline variables require at least '/std:c++17'
<project path>\debug\msjro.tli(111): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<project path>\debug\msjro.tli(111): error C2146: syntax error: missing ';' before identifier 'GetConflictTables'
<project path>\debug\msjro.tli(113): error C3861: 'get_ConflictTables': identifier not found
<project path>\debug\msjro.tli(114): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
<project path>\debug\msjro.tli(114): error C2660: '_com_issue_errorex': function does not take 1 arguments
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\comdef.h(229): note: see declaration of '_com_issue_errorex'
<project path>\debug\msjro.tli(115): error C2064: term does not evaluate to a function taking 2 arguments
<project path>\debug\msjro.tli(115): warning C4508: 'JRO::GetConflictTables': function should return a value; 'void' return type assumed
<project path>\debug\msjro.tli(116): error C2617: 'JRO::GetConflictTables': inconsistent return statement
<project path>\debug\msjro.tli(111): note: see declaration of 'JRO::GetConflictTables'

Any ideas how to fix this?

Disable GoForward/GoBackward CHtmlView

$
0
0

Hi,

I'm using a CHTMLView component in my c++ application, and I want to prevent the user from navigating back or forward. Is there a way to do that? I tried setting the "Navigate2" options "navNoHistory | navOpenInNewTap | navNoReadFromCache | navNoWriteToCache" but that didn't work. 


Cannot open file 'mfc100.lib'. I'm getting this error when I try to build project in Visual Studio 2017.

$
0
0

I'm migrating my project from VS2010 to VS2017. When I trying to build my project I'm getting error, LNK1104 Cannot open file 'mfc100.lib'. 

My project's Platform ToolSet is set toVisual Studio 2017(v141)

I set Use of MFC to Use MFC in a Shared DLL

Please help me find out a proper solution to fix this. 

Thanks in advance.  

CTreeCtrl keep expansion

$
0
0

Hello,

I have a CTreeCtrl which is fully expanded on creation (the root is expanded and all tree branches are expanded). I have set "Has Buttons" to false.

When I (double-)click on a tree branch item, the tree branch is expanded or closed. And when I select a branch, some other branches are closed.

I want to show the fully expanded tree every time. I don't want that the ctrl closes a branch.

How to achieve it?

Thanks for help,
Guido

CString convert from UTF-8 to Unicode

$
0
0

Hi,

I have a UTF-8 file(File1), which contains the following data when viewing it in hexidecimal editor UltraEdit:

0x20 0xE2 0x80 0x93 0x3C 0x2F

However, my program is Unicode-based, so I need to read the contents and convert them into Unicode string.

I use the following code:

    CFile File;
    CByteArray Data;

    if (File.Open(strFileName, CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary))
    {
        //  Prepare the data buffer
        Data.SetSize((INT_PTR)File.GetLength());
        ::memset(Data.GetData(), 0, Data.GetSize());

        //  Read all data to the buffer
        File.SeekToBegin();
        File.Read(Data.GetData(), Data.GetSize());
        File.Close();

        //  Convert the buffer to the string
        strData = CString((LPCSTR)Data.GetData(), Data.GetSize());

        returnTRUE;
    }
    else
        returnFALSE;

Then after getting the strData, to check if the data are correct, I try to save the strData into another new Unicode file(File2), as below:

    CFile File;

    if (File.Open(strNewFileName, CFile::modeCreate | CFile::modeWrite | CFile::shareExclusive | CFile::typeBinary))
    {

        //  Write the strData to the file

        File.Write((LPCTSTR)strData, strData.GetLength() * sizeof(TCHAR));

        File.Close();

    }

After opening the new Unicode file, I see the Unicode characters as below:

0x20 0x00 0x25 0x92 0x3F 0x00 0x2F 00

However, if I open File1 in UltraEdit directly, then using its menu function "Conversion" -> "UTF8->Unicode" feature. I will get a new file(File3), in File 3, the Unicode characters will be:

0x20 0x00 0x13 0x20 0x3C 0x00 0x2F 00

I find File2 and File3 have some different bytes, though they are both Unicode files. Therefore, I just wonder if my conversion has some problems?

Thanks

Missing versions of visualC + +

$
0
0

I keep getting a message when windows starts up saying The code execution cannot proceed because MSVCP110.d11 was not found reinstalling program may fix this problem What is the best thing to do 

Regards Len

Output file is missing

$
0
0

The following code, extracted from a larger program, seems to work correctly. But there is no sign of the output file anywhere.

Can anyone see what needs to be changed to cure this problem?

C++ PROGRAM:

char *in_filename ;
char *out_filename ;

// The in_filename and the out_filename have the command arguments as their values:
// "C:\Storage\JGW\Research\Dev\2018plus\LANGS\LANG1\LANG1\Debug\in\gr1.txt"
// "C:\Storage\JGW\Research\Dev\2018plus\LANGS\LANG1\LANG1\Debug\out\o_gr1.txt"

ifstream ifile("in_filename",ios::ate); // Leaving off the quote marks leads to an assertion failure.

// The input part of the larger program seems to work correctly.
// But there is no sign of the output file anywhere when the program exits.

ofstream ofile("out_filename",ios::ate); // Leaving off the quote marks leads to an assertion failure.

ofile.open(out_filename) ;
if(ofile.is_open() == false)
    abort_run("Unable to open output file.\n") ;

// Test message

ofile << "Test message." ;
ofile.close();
exit(0) ;


GerryWolff

Viewing all 15302 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>