On Mon, Feb 14, 2011 at 12:30 PM,  <[email protected]> wrote:
> Hi,
>
> I want to convert this following c/c++ code into vfp. This code is
> provided by the Biometric TA SDK.
>
> Their .NET/VB sample is working fine. But VB ocx control has some strange
> problem in vfp. Sometimes, when I open the form to receive input from the
> device through this ocx, it does not capture data. If I minimize the form
> or vfp main window then it starts pulling/receiving the previous data (no
> idea where vfp hold it in).
>
> Now I want to use this ocx directly in vfp by calling its dll directly. So
> I need the following code conversion in vfp.
>
> C/C++ code
> ========================
> typedef struct {
>   unsigned char event;
>   unsigned char reserved1;
>   unsigned short tnaEvent;
>   time_t eventTime;
>   unsigned userID;
>   unsigned reserved2;
> } BSLogRecord;
>
>
> BSLogRecord logRecords[128];

This creates an array of 128 BSLogRecords.  The size of BSLogRecord is
1+1+2+(4)+4+4 = 16.
Note: I'm assuming time_t is 4 bytes on Windows, but it may be 8.

> I tried this in vfp as
>
> lnhandle = 0
> lnNumOfLog = 0
> dime lcBuffs(128)
>
> *- if lcBuffs = space(16)+chr(0) then vfp crash so it stored more space.
> store space(254)+chr(0) to lcBuffs

Looks like you need to allocate more space.  Try 128 * 16 bytes.

> DECLARE INTEGER BS_ReadLogCache IN BS_SDK.DLL INTEGER handle, INTEGER
> @numOfLog, STRING @logRecord
>
> result = BS_ReadLogCache(lnhandle, @lnNumOfLog, @lcBuffs)
>
> lnNumOfLog : returns integer 2 when I record my finger on device
> lcBuffs : garbage value
>
> What will be the correct syntax in vfp?

Your syntax looks OK.  What should lcBuffs return?  Are you sure it's garbage?

-- 
Paul

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to