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

DLL using unicode Program not using unicode.

$
0
0

I have some code that I have to support that is not UNICODE but compiled as standard C++. I have a new dll that uses unicode. The examples that was given were written in unicode. The structure of an object is in the dll and it is as follows:

struct READERINFO
{
TCHAR serial[32];
TCHAR altSerial[32];
TCHAR name[32];
TCHAR fccId[48];
TCHAR hwVersion[16];
int swVerMajor;
int swVerMinor;
char devBuild;
int numGpio;
int numSensors;
int numRegions;
int numAntennas;
};

All I am interested in is in my C++ code is getting the swVerMajor and the swVerMinor and the char devBuild.

When I call the function from the DLL using the following code:

struct READERINFO info;

int error = 0;

HANDLE hApi = ApiCreate();

ApiGetReaderInfor(hApi, &info, sizeof(info);

printf("[%d. %d - %c]\r\n\r\b", info.swVerMajor, info.swVerMinor, info.devBuild);

I get for info.swVerMajor  -858993460

for info.swVerMinor -858993460 

for info.devBuild  'Ì'

for info.seiral "ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ̸£ô”ø´"

I belive it has to due with the way I am getting the UNICODE from the DLL 


Viewing all articles
Browse latest Browse all 15302

Trending Articles



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