These 2 links might be useful in helping you troubleshoot: http://vfpx.codeplex.com/wikipage?title=VFP2C32&referringTitle=Home
http://www.news2news.com/vfp/index.php -- rk -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Wednesday, February 16, 2011 3:57 AM To: [email protected] Subject: Re: Win API Struct conversion to vfp Hi Paul, >> 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 > Your syntax looks OK. What should lcBuffs return? Are you sure it's > garbage? Thanks for reply. From VFP I got garbage values which can be displayed on screen but can't copied to _cliptext to paste here. See this sample code of VB which returns text values from the device. ************* VB Code ************* Dim numoflogs As Long Dim result As Long result = BS_SDK.BS_ReadLogCache(handle, numoflogs, logRecord(0)) If numoflogs > 0 Then For i = 0 To numoflogs - 1 If logRecord(i).event = "55" Then Dim eventdatetime As Date eventdatetime = DateAdd("s", logRecord(i).eventTime, "1/1/1970") RaiseEvent OnData(mTCPAddress + "," + CStr(logRecord(i).userID) + "," + Format(eventdatetime, "dd/mm/yyyy HH:mm:ss")) End If Next End If *********** END CODE *************** and the result is like this 138,192.168.0.241,0,13/02/2011,07:28:24 55,192.168.0.241,271,13/02/2011,07:28:24 Why VFP is not getting text output as in VB 6? I attached the Debug Locals window jpg file with my message. TIA Naeem > 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? >> 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 > Your syntax looks OK. What should lcBuffs return? Are you sure it's > garbage? > > -- > Paul > [excessive quoting removed by server] _______________________________________________ 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/DF1EEF11E586A64FB54A97F22A8BD04419222821F0@ACKBWDDQH1.artfact.local ** 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.

