Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How VFP handles Binary data?
Message
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00531339
Message ID:
00531852
Views:
59
Jess,

It sounds like you need to:

lcx = oScanner.GetFingerprint()
replace thetable.memofield with createbinary( lcX )
...
lcX = thetable.memofield
oScanner.CheckFingerPrint( lcX )

>In VB, the OCX method emits "xyz" binary data but using VFP it emits different one: "abc." Looking at the CREATEBINARY() docs it says:
>
>Visual FoxPro character strings can contain binary data. However, an ActiveX control or automation object character string (OLE VT_BSTR type data) cannot contain binary data. An ActiveX control or automation object passes binary data to applications such as Visual FoxPro as an array of VT_UI1 type data.
>
>Visual FoxPro automatically converts binary data passed from an ActiveX control or automation object as an array of VT_UI1 type data to a Visual FoxPro character string. Visual FoxPro internally marks this character string as binary data passed from an ActiveX control or automation object. When the character string is passed back to an ActiveX control or automation object, Visual FoxPro automatically converts the character string to an array of VT_UI1 type data the ActiveX control or automation object expects.
>
>Use CREATEBINARY( ) to convert character type data created in Visual FoxPro to a binary type character string you can pass to an ActiveX control or automation object. The minimum number of characters to which CREATEBINARY( ) can be abbreviated is 7.
>

>In my best capacity to understand the above statement, the data passed by the OLE OCX is no longer the RAW data expected. What we needed is the RAW data. Unfortunately, when we asked the OCX vendor about this matter, they said that they are not supporting VFP language but they added that since VFP is also an MS product, the OCX might run with the same expected functionality. Vague answer though.
>
>I suspect that since the OCX was done in VB, it behaves native to VB. Meaning, it emits OLE VT_BSTR binary data which is the RAW data we needed. In VFP, the OCX emits VT_UI1 type data.
>
>How do you interpret the above CREATEBINARY() doc?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform