// include FoxPro LCK header file #include "pro_ext.h" void _fastcall StringToHexEx(ParamBlk *parm) { unsigned char *pString, *pHexString; unsigned char cHexChar; Value vHexString; vHexString.ev_type = 'C'; // compute length of resulting hex string vHexString.ev_length = parm->p[0].val.ev_length * 3; // if len is equal to 0, return an empty string if (vHexString.ev_length == 0) { _RetVal(&vHexString); return; } // allocate a memory buffer for the hex string vHexString.ev_handle = _AllocHand(vHexString.ev_length); // raise Error "Insufficient memory" if allocation failed if (!vHexString.ev_handle) _Error(182); // lock memory handles and get real pointers _HLock(vHexString.ev_handle); pHexString = (unsigned char*)_HandToPtr(vHexString.ev_handle); _HLock(parm->p[0].val.ev_handle); pString = (unsigned char*)_HandToPtr(parm->p[0].val.ev_handle); // transform the string to hexadecimal for (unsigned int xj = 1; xj <= parm->p[0].val.ev_length; xj++) { *pHexString++ = '%'; // upper 4 bits (divide by 16) cHexChar = *pString / 16 + '0'; if (cHexChar > '9') cHexChar += 0x7; *pHexString++ = cHexChar; // lower 4 bits (modulo of 16) cHexChar = *pString % 16 + '0'; if (cHexChar > '9') cHexChar += 0x7; *pHexString++ = cHexChar; pString++; } // unlock memory handles and return the hex string _HUnLock(parm->p[0].val.ev_handle); _HUnLock(vHexString.ev_handle); _RetVal(&vHexString); } #ifdef __cplusplus extern "C" { #endif FoxInfo FLLFuncs[] = { {"YourPreferredFoxProFunctionName", (FPFI) StringToHexEx, 1, "C"} }; FoxTable _FoxTable = { (FoxTable *)0, sizeof(FLLFuncs)/sizeof(FoxInfo), FLLFuncs }; #ifdef __cplusplus } #endifhave a look @ message #1132393 how to setup a Visual Studio project to compile a FLL.